6

I don't understand the purpose of a volume label on a linux file system. Can someone help me to understand?

2 Answers 2

14

Because adding/removing/changing disks can change drive mappings, i.e. your /dev/sda could change - so if you instead refer to the disk's UUID or volume label your system will be more stable/robust.

Does that make sense?

4

Adding to Chopper3, it is only an issue if you use the disk directly (e.g. /dev/sda1). You have more control over names with MD devices and even more with LVM, since LVM looks for metadata on the disk itself for VG and LV names.

A more detailed answer: when Linux boots, it finds all the disks and assigns names to them, e.g sda1. The names are usually assigned sequentially, depending on the order the disks are found. If you add/remove disks, the OS may give a different name to the same disk, causing problems.

The OS however assigns a unique name to each disk (more exactly to the filesystem) when you format it. This name is stored in the disk itself and can be used to uniquely identify it on the particular computer.

As I mentioned this is less of an issue with virtual devices, like software RAID (MD) devices and LVM devices (logical disks, or volumes LV, created from pools of physical disks, volume groups, VG), since often the name of the device is stored on the virtual disk itself or in a configuration file used to create the device in the first place.

3
  • Quick note...it's possible the Original Poster or other readers is/are unfamiliar with basic filesystem and device concepts and excessive use of acronyms may actually cause a cerebral hemorrhage while reading that note. Mar 26, 2010 at 12:23
  • @Bart Silverstrim: noted. Mar 26, 2010 at 12:48
  • MD = Multi-disk(?), this is the old software-based RAID for Linux, correct? LVM = Logical Volume Manager, similar to "Dynamic Disks" in windows. VG = Volume Group(?), part of the management/organization for LVM LV = Logical Volume, what the LVM presents to the system as a "disk". Mar 26, 2010 at 16:19

You must log in to answer this question.