Command syntax is:
- Code: Select all
mkswap -L <label> <partition>
Specify a label, to allow swapon by label.
Replace <label> with the label you would like to use. Replace the partition with the SWAP partition. If following is the output of:
- Code: Select all
fdisk -l
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00061a23
Device Boot Start End Blocks Id System
/dev/sda1 * 63 417689 208813+ 83 Linux
/dev/sda2 417690 8803619 4192965 82 Linux swap / Solaris
/dev/sda3 8803620 324545129 157870755 83 Linux
/dev/sda4 324545130 488392064 81923467+ 83 Linux
then <partition> would be replaced with /dev/sda2.
- Code: Select all
mkswap -L SWAP2 /dev/sda2
Once the SWAP partition has been labeled, remember to change the /etc/fstab to reflect the new label.