linux: How can I view all UUIDs for all available disks on my system?

  • My /etc/fstab contains this:

    # / was on /dev/sda1 during installation
    UUID=77d8da74-a690-481a-86d5-9beab5a8e842 /               ext4    errors=remount-ro 0       1

    There are several other disks on this system, and not all disks are being mounted to the correct location (For example, /dev/sda1 and /dev/sdb1 are sometimes reversed).

    How can I see the UUIDs for all disks on my system? Can I see the UUID for the third disk on this system?

    @setzamora answer is better. Please change accepted answer.

  • In /dev/disk/by-uuid there are symlinks mapping each drive's UUID to its entry in /dev (e.g. /dev/sda1)

    It's not readable when LVM partitions.

    LVM already uses long UUID-like identifiers (although presented differently) in its structure. I think the only reason for using filesystem UUIDs with LVM would be as an unified interface for some sort of automation, as LVM already does the mapping of LVs to human-friendly names for you.

    `ls -lha /dev/disk/by-uuid`

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM