Linux 101 : UDEV, device naming - Labels, UUIDs, ... -



The udev program provides a naming system for the devices in a Linux system.

Some of these methods embed the identifier in the filesystem, others - the persistent naming methods - keep the identifier outside of the filesystem, so if we format the drive/partition the identifier will be lost.

Unique identifier - UUID -:

We could find the UUID attributes for our devices in "/dev/disk/by-uuid" directory. 
That identifier could be used for mounting for identifying the drives to be mounted in the "/etc/fstab" file.

Labels:

The Label attributes for our devices could be found in the  "/dev/disk/by-label" directory, and like the UUID, it could also be used in the "/etc/fstab" file.

Modifying the UUID and Labels:

We could modify the UUIDs or the Labels using the tune2fs
utility as we can see below:


To display the Labels and UUID of a partition, we use the below command:


Partition UUID:

The partition  UUID as opposed to the above-mentioned identifiers is not stored in the filesystem, so it is not lost if we decide to format a drive.

The Partition UUIDs are stored in the "/dev/disk/by-partuuid" directory.

The Partition UUID identifies a partition according to the definition of the GPT partition table.

To check the partition UUID of the "/dev/sda1" partition for example, we use the below command:

Comments

Leave as a comment:

Archive