Skip to contentSkip to conversation

magic device renumbering was -- Re: Linux 2.4.2ac20

DISCUSSION Mikael Pettersson 1 participant 1 message Mar 15, 2001

lore
Share & tools
lore
#0 lore raw

On Wed, 14 Mar 2001 12:34:06 -0700 (MST), Andreas Dilger wrote in LKML:

Quoted 10 lines
Quoted 6 lines · Lars
Quoted 1 line

Put LABEL=<label set with e2label> in you fstab in place of the device name.

Which is great, for filesystems that support labels. Unfortunately, this isn't universally available -- for instance, you cannot mount a swap partition by label or uuid, so it is not possible to completely isolate yourself from the problems of disk device renumbering.

There is room for a LABEL and/or UUID in the swap superblock, if you would want to implement support for this.

Despair no more! I've implemented a patch for util-linux-2.11a which adds LABEL support to mkswap(8) and swapon/swapoff(8).

- I shrunk the padding field in the new-style swap_header to make room for 16 bytes worth of volume label (same as ext2)
- mkswap -L label also sets the volume label
- swapon -L label looks for a swap partition with the given label (using a clone of mount(8)'s LABEL/UUID= support code)
- swapon/swapoff -a also handles swap fstab entries where the device is specified as LABEL=<label>

The patch is available at http://www.csd.uu.se/~mikpe/linux/swap-label/

/Mikael