There are many possible options for how to decouple an fstab mount from the device names (sda, sdb, sdc, ...) that seldom, but may, change.
Originally Posted by
TheFu
uuid is filesystem specific which is what you want. We mount file systems, not partitions.
I've never seen PARTUUID used anywhere. Mounts, references, anywhere. In home systems, UUID is typically used unless LVM or ZFS are used. But you can use any links that point to a device or mapped device (DM-*) under /dev/disk/by-* ...
You can ignore the stuff below, unless you are interested in using a volume manager:
When I use LVM, I prefer to use the /dev/{VG}/{LV} mapping files. They clearly provide LVM information and are short. The device mapper sets those up automatically after any encrypted containers are properly opened. For example:
Code:
/dev/hadar-vg/root / ext4 noatime,errors=remount-ro 0 1
So, the VG is "hadar-vg" and the LV is "root." If I do an ls in that directory, I'll see a other LVs:
Code:
$ ls -Fl /dev/hadar-vg/
total 0
lrwxrwxrwx 1 root root 7 Jul 4 01:35 libvirt-lv -> ../dm-2
lrwxrwxrwx 1 root root 7 Jul 4 01:35 lv-blog44-1604 -> ../dm-5
lrwxrwxrwx 1 root root 7 Jul 4 01:35 lv-lubuntu11-1604 -> ../dm-6
lrwxrwxrwx 1 root root 8 Jul 4 01:35 lv-opnsense -> ../dm-11
lrwxrwxrwx 1 root root 8 Jul 4 01:35 lv-regulus -> ../dm-10
lrwxrwxrwx 1 root root 8 Jul 4 01:35 lv-regulus-2 -> ../dm-12
lrwxrwxrwx 1 root root 7 Jul 4 01:35 lv-spam3 -> ../dm-8
lrwxrwxrwx 1 root root 8 Jun 27 17:36 lv-tp-lxd -> ../dm-16
lrwxrwxrwx 1 root root 7 Jul 4 01:35 lv-vpn09-1604 -> ../dm-3
lrwxrwxrwx 1 root root 7 Jul 4 01:35 lv-xen41-1604 -> ../dm-4
lrwxrwxrwx 1 root root 7 Jul 4 01:35 lv-zcs45-1604 -> ../dm-7
lrwxrwxrwx 1 root root 7 Jul 4 01:35 lxd-lv -> ../dm-9
lrwxrwxrwx 1 root root 7 Jul 4 01:35 root -> ../dm-0
lrwxrwxrwx 1 root root 7 Jul 4 01:35 swap_1 -> ../dm-1
But the "root" and "swap_1" are the expected LVs for a system using LVM for storage management.
I use the LABEL= mount for portable USB storage so it gets mounted in predictable locations. Controlling the LABEL is easier and humans don't exactly think in UUIDs.
Bookmarks