e2label: Label Your Disks

With cheaper storage you might find yourself literally submersed in storage devices. It is possible to have your block devices change (from sdc to sde) when using multiple controllers of the same model (I’ve experienced this with 3Ware controllers). So how do you know where to mount your devices after a reboot? Use e2label to label your disks (much like NTFS labels in Windows).


Labeling Your Device

To label your device follow these steps:

# e2label /dev/sdb1 awesomedisk


Modifying Your fstab

Now you can modify your fstab to reflect your label changes. Instead of using the path to the block device (/dev/sdb1) you can use this syntax: (LABEL=awesomedisk)


LABEL=awesomedisk                 /mnt/awesomedisk                       ext3    defaults        1 1


Check Current Label

To check the label currently set for a block device use this command:
# tune2fs -l /dev/sdb1 | grep "Filesystem volume name:"

Leave a Reply

Your email address will not be published / Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.