What is the purpose of a volume label on a Linux file system?

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


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?


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.