3

I am in the process of creating a backup script. First of all, I would like to make sure the source file-system/logical-volume is mounted (and know where it is mounted).

Apparently this can be done using both the file-system's UUID and the logical volume's UUID (Check logical volume mount point (command line)).

I would like to know which one should I be using and why (if there is any reason to prefer one over the other). Could there be any real difference?

In my case, I always create a single partition in each logical volume (filling up the logical volume space), but I do not know if other setups are possible that would allow more complex configurations.

  • either it's an (MBR/GPT) partition or a logical volume, it can't be both. I think you mean the filesystem instead of the partition. – sourcejedi Nov 12 '16 at 16:43
3

It depends on what you really care about.

If you want to see if a specific filesystem is mounted, you use the filesystem UUID. Because that's what identifies the filesystem itself. That's usually the default choice for everyone: People care about specific filesystem, and not which partition, volume, disk those reside on. It could be a network block device, who cares, as long as it's there.

Now, if you don't care about the filesystem at all - guess what, someone ran mkfs yesterday and made a new one - you might check the VG/LV name, or if you don't care about name changes either, the logical volume UUID. Or PARTUUID when not using LVM.

The deeper down you go the farther away you will be from the filesystem itself. There's also /dev/disk/by-path which you could use to identify a USB stick plugged into a certain USB port and not care which USB stick it is that was plugged in there. And sometimes that may be what you want.

But usually you just stick to the filesystem UUID.

0

If you can't find a specific reason, don't use an LV UUID. Filesystem UUIDs are better known. E.g. LV UUIDs can't be seen/used with /etc/fstab / mount, findmnt, lsblk. Obviously they're LVM-specific, and for whatever reason I haven't seen them included in a more general abstraction (i.e. PARTUUID).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.