LABEL for swap partition. - Setup

This is a discussion on LABEL for swap partition. - Setup ; I have added a second disk to my system that will be used for SWAP space. I have it ready to go and want to include it in my fstab. I'd like to use the LABEL method that is currently ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: LABEL for swap partition.

  1. LABEL for swap partition.

    I have added a second disk to my system that will be used for SWAP
    space. I have it ready to go and want to include it in my fstab. I'd
    like to use the LABEL method that is currently in fstab for the current
    swap space. It looks like this:

    LABEL=SWAP-sda2 swap swap and all that stuff.

    I can't find how to label a swap disk/space. The tune2fs, fdisk,
    parted, and e2label haven't been helpful. They seem to work only for a
    partition with a regular filesystem not a swap partition. Anyone know
    the command to label SWAP partition? Or perhaps the correct way to use
    one of those previously mentioned commands just in case I am missing
    something in the manpage. So my new swap entry in fstab would then
    look something like:


    #LABEL=SWAP-sda2 swap swap defaults 0 0
    LABEL=SWAP-hda1 swap swap defaults 0 0


    Operating system is Redhat Enterprise Linux Workstation 4.0 Update 4.

    Thanks all


  2. Re: LABEL for swap partition.

    george.e.sullivan@saic.com wrote:
    > I have added a second disk to my system that will be used for SWAP
    > space. I have it ready to go and want to include it in my fstab. I'd
    > like to use the LABEL method that is currently in fstab for the current
    > swap space. It looks like this:
    >
    > LABEL=SWAP-sda2 swap swap and all that stuff.
    >
    > I can't find how to label a swap disk/space. The tune2fs, fdisk,
    > parted, and e2label haven't been helpful. They seem to work only for a
    > partition with a regular filesystem not a swap partition. Anyone know
    > the command to label SWAP partition? Or perhaps the correct way to use
    > one of those previously mentioned commands just in case I am missing
    > something in the manpage. So my new swap entry in fstab would then
    > look something like:
    >
    >
    > #LABEL=SWAP-sda2 swap swap defaults 0 0
    > LABEL=SWAP-hda1 swap swap defaults 0 0
    >
    >
    > Operating system is Redhat Enterprise Linux Workstation 4.0 Update 4.
    >
    > Thanks all
    >

    You can't, since it is not a Linux file system in the usual sense. A label
    gets written in the first block of the file system, and this conflicts with
    how paging is done.

    --
    .~. Jean-David Beyer Registered Linux User 85642.
    /V\ PGP-Key: 9A2FC99A Registered Machine 241939.
    /( )\ Shrewsbury, New Jersey http://counter.li.org
    ^^-^^ 13:00:01 up 11 days, 15:27, 3 users, load average: 4.37, 4.28, 4.24

  3. Re: LABEL for swap partition.

    On 1 Nov 2006 09:46:54 -0800, george.e.sullivan@saic.com wrote:

    >I have added a second disk to my system that will be used for SWAP
    >space. I have it ready to go and want to include it in my fstab. I'd
    >like to use the LABEL method that is currently in fstab for the current
    >swap space. It looks like this:
    >
    >LABEL=SWAP-sda2 swap swap and all that stuff.
    >
    >I can't find how to label a swap disk/space. The tune2fs, fdisk,
    >parted, and e2label haven't been helpful. They seem to work only for a
    >partition with a regular filesystem not a swap partition. Anyone know
    >the command to label SWAP partition? Or perhaps the correct way to use
    >one of those previously mentioned commands just in case I am missing
    >something in the manpage. So my new swap entry in fstab would then
    >look something like:
    >
    >
    >#LABEL=SWAP-sda2 swap swap defaults 0 0
    >LABEL=SWAP-hda1 swap swap defaults 0 0
    >
    >
    >Operating system is Redhat Enterprise Linux Workstation 4.0 Update 4.
    >
    >Thanks all


    You can label it with the mkswap command:

    mkswap -L label /dev/hdxx

    see: man mkswap

    Mektub


+ Reply to Thread