Stable disk identifiers prevent mounts, services, and boot processes from depending on device names that can change between reboots. A UUID (Universally Unique Identifier) attached to a partition or block device remains consistent even if /dev/sdX numbering shifts, keeping storage configuration predictable.
On Linux systems, the udev subsystem exposes these identifiers as symbolic links under /dev/disk/by-uuid while tools such as lsblk and blkid read superblock metadata to show UUID, file system type, label, and PARTUUID information. Configuration files like /etc/fstab can reference these stable values instead of raw device paths to ensure the correct partitions mount every time.
Enumerating and using UUID values relies on access to the underlying block devices, which often requires elevated privileges and careful distinction between system disks and removable media. Confusing system partitions with external drives or writing incorrect UUID entries into /etc/fstab risks failed mounts or an unbootable system, so cross-checking outputs before making changes remains essential.
Steps to find disk and partition UUIDs:
- Open a terminal with sudo privileges.
$ whoami user
- Display block devices and existing file systems including UUID columns with lsblk.
$ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS ##### snipped ##### loop0 ├─loop0p1 ext4 1.0 data ed6aa5ab-3a4d-43bd-b7d2-ffec8c1d0291 /root/disk ├─loop0p2 ext4 1.0 mountdemo 03655b36-3709-4e28-a289-412ef4a6252f 94.9M 0% /mnt/uuidtest └─loop0p3 ext4 1.0 uuiddemo bea29d1f-abb8-4ed3-acd6-273280d2f4ba 205.8M 0% /mnt/uuiddemo loop1 ext4 1.0 data e2509569-0ada-480b-833e-797ee7ca99f1 sda ├─sda1 vfat FAT32 F410-21AB 1G 1% /boot/efi ├─sda2 ext4 1.0 92df6435-4bce-455b-9dff-2f517721e1d7 1.6G 10% /boot └─sda3 LVM2_member LVM2 001 nsoAwu-bMdN-ebGG-jbKp-I2Kp-tkHr-s2gz0z ##### snipped #####
The UUID column in lsblk output provides a quick overview of identifiers already visible to the system.
- Inspect symbolic links under /dev/disk/by-uuid to see how each UUID maps to a concrete device node.
$ ls -l /dev/disk/by-uuid/ total 0 lrwxrwxrwx 1 root root 13 Jan 10 13:09 03655b36-3709-4e28-a289-412ef4a6252f -> ../../loop0p2 lrwxrwxrwx 1 root root 10 Jan 10 12:09 50216b20-ddb4-4a36-b306-d028b09d7807 -> ../../dm-0 lrwxrwxrwx 1 root root 10 Jan 10 12:09 92df6435-4bce-455b-9dff-2f517721e1d7 -> ../../sda2 lrwxrwxrwx 1 root root 13 Jan 10 12:16 bea29d1f-abb8-4ed3-acd6-273280d2f4ba -> ../../loop0p3 lrwxrwxrwx 1 root root 11 Jan 10 12:16 e2509569-0ada-480b-833e-797ee7ca99f1 -> ../../loop1 lrwxrwxrwx 1 root root 13 Jan 10 12:16 ed6aa5ab-3a4d-43bd-b7d2-ffec8c1d0291 -> ../../loop0p1 lrwxrwxrwx 1 root root 10 Jan 10 12:09 F410-21AB -> ../../sda1
Each UUID symlink points to a device such as /dev/sda2, providing a stable identifier even when kernel device ordering changes.
- List all known identifiers using blkid to include file system type and PARTUUID information.
$ blkid /dev/mapper/ubuntu--vg-ubuntu--lv: UUID="50216b20-ddb4-4a36-b306-d028b09d7807" BLOCK_SIZE="4096" TYPE="ext4" /dev/sda2: UUID="92df6435-4bce-455b-9dff-2f517721e1d7" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="df4b4529-0e60-4518-a3eb-9af023816d32" /dev/sda3: UUID="nsoAwu-bMdN-ebGG-jbKp-I2Kp-tkHr-s2gz0z" TYPE="LVM2_member" PARTUUID="416d5da9-1c9d-405e-8b64-ee94f05243be" /dev/sda1: UUID="F410-21AB" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="93113b06-b459-4939-b273-425788bfe834" /dev/loop0p2: LABEL="mountdemo" UUID="03655b36-3709-4e28-a289-412ef4a6252f" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="primary" PARTUUID="5d273476-c6d7-4620-bd86-3aaf13188262" /dev/loop0p3: LABEL="uuiddemo" UUID="bea29d1f-abb8-4ed3-acd6-273280d2f4ba" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="primary" PARTUUID="e9b64fa3-a8b8-4c91-b8a8-fad4fb897c8f" ##### snipped #####
blkid reads on-disk metadata to report UUID, file system type, and related tags for each detected block device.
- Query a specific partition by passing its device file to blkid when only one UUID is needed.
$ blkid /dev/loop0p2 /dev/loop0p2: LABEL="mountdemo" UUID="03655b36-3709-4e28-a289-412ef4a6252f" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="primary" PARTUUID="5d273476-c6d7-4620-bd86-3aaf13188262"
Replace /dev/loop0p2 with the actual device node to retrieve a single partition’s UUID and related details.
- Cross-check discovered UUID values against entries in /etc/fstab to understand how partitions are configured to mount at boot time.
$ grep UUID /etc/fstab # device; this may be used with UUID= as a more robust way to name devices UUID=bfc23045-3e53-4853-99c6-6d9df90f3578 /mnt/uuidtest ext4 defaults 0 1 UUID=eec802f8-2777-4a81-a25b-47ed9d0cea11 /mnt/uuiddemo ext4 defaults 0 2
Incorrect UUID entries in /etc/fstab can prevent critical file systems from mounting and may render the system unbootable.
- Re-run lsblk -f after any changes to confirm that partitions and their UUID values align with the intended configuration.
$ lsblk -f NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS ##### snipped ##### loop0 ├─loop0p1 ext4 1.0 data ed6aa5ab-3a4d-43bd-b7d2-ffec8c1d0291 /root/disk ├─loop0p2 ext4 1.0 mountdemo 03655b36-3709-4e28-a289-412ef4a6252f 94.9M 0% /mnt/uuidtest └─loop0p3 ext4 1.0 uuiddemo bea29d1f-abb8-4ed3-acd6-273280d2f4ba 205.8M 0% /mnt/uuiddemo loop1 ext4 1.0 data e2509569-0ada-480b-833e-797ee7ca99f1 sda ├─sda1 vfat FAT32 F410-21AB 1G 1% /boot/efi ├─sda2 ext4 1.0 92df6435-4bce-455b-9dff-2f517721e1d7 1.6G 10% /boot └─sda3 LVM2_member LVM2 001 nsoAwu-bMdN-ebGG-jbKp-I2Kp-tkHr-s2gz0z ##### snipped #####
Matching UUID values across lsblk, /dev/disk/by-uuid, and /etc/fstab confirms consistent identification of disks and partitions.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
