Home > Uncategorized > UUID in /etc/fstab

UUID in /etc/fstab

While I understood the value of using UUIDs to specify devices in /etc/fstab, it wasn’t clear how it all worked. After a bit of googling …

When a device is connected, the system automatically retrieves its UUID, regardless of which interface is used. The list of currently available devices can be displayed with:

ls /dev/disk/by-uuid -lh

Currently available block device ids can be displayed using blkid and attributes of individual devices is displayed by vol_id /dev/name.

Also, blkid information is cached in /etc/blkid.tab.

Very important: if you clone drives with dd, the UUID will be cloned too! If this isn’t what you had in mind, reset it using:

tune2fs -U UUID /dev/name

where UUID is one of the following:
a unique id like “c1b9d5a2-f162-11cf-9ece-0020afc76f16”
or clear, random or time.

Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.