Quick Tip: Get the UUID for a Disk or Partition

I was just quickly running up a small linux server to use as a backup server at a remote site, and added a new disk to an existing install.

Since it’s at a remote site, I don’t want the chance of it barfing on boot, so I definitely want to specify my partition by UUID.

The UUID is used to identify a device, independently from its device name. Especially useful when mounting physical disks, it’s also useful for LVM volumes, etc.

There are a few ways to get the UUID, but by far the easiest is to simply do an ls -l in /dev/disk/by-uuid.

In my case, I’m pointing at a LVM Logical Volume, so I can take a guess that I’m looking for dm-0, but to be sure, I want to check in /dev/mapper:

Yep, so to mount that new volume in fstab, I want to add a line like the following:


Leave a Reply