UUID and Partitions

Linux’s ext2, ext3, and ext4 filesystems uses UUID to identify partitions.

One way to look up the partition’s UUID in CentOS is blkid


# blkid /dev/sda1

To avoid the system booting on emergency mode due to an error in /etc/fstab, use the UUID instead of the device (/dev/sda1) to mount the partition in fstab.


Example of UUID in the fstab:

# /etc/fstab
# Accessible filesystems, by reference, are maintained
# under '/dev/disk'
# See man pages fstab(5), findfs(8), and/or blkid(8) for more info
UUID=a97702ff-0a20-475d-b371-4393efe9571a /      xfs   defaults  0 0
UUID=38441fd5-952b-43fe-af56-a5911ba5db9a /boot  xfs   defaults  0 0
UUID=7eb87829-b4ce-4f5d-9b13-894cee4d3f18 /home  xfs   defaults  0 0
UUID=feb9214d-2d18-4c33-8bd6-f912e05a7fa1 swap   swap  defaults  0 0
UUID=8200a464-fe75-49dc-aafe-f4805da64f48 /data  ext4  defaults  1 2