In most modern Linuxes, if you look in /etc/fstab you will see something like:

UUID=27fb9d06-8122-4a53-9930-97bd9fa57221 /usr ext4 defaults 1 1

This is not very helpful if you’re trying to figure out where your /usr directory is mounted… So how can you convert the UUID of a drive partition to the good old familiar /dev device name?

One way to do it is to use the findfs command – type “findfs ” then copy and paste the “UUID=…” part from fstab:

$ findfs UUID=ec31bc4a-093b-45ca-ac2d-8eb14885964d
$ _

Another way to find out which device a UUID refers to is to ls - /dev/disk/by-uuid/

And the reverse problem – how to find out the UUID of a device is accomplished by the blkid command:

$ blkid /dev/sda1
/dev/sda1: UUID="45f2c200-bd5f-4436-b523-2beef9f628c7" SEC_TYPE="ext2" TYPE="ext3"
$ _
Tagged with:

2 Responses to How to convert uuid to dev

  1. ench0 says:

    On some distros you may also type:
    $ sudo vol_id /dev/hdb5
    to get the UUID of a partition…

  2. Peter Zahn says:

    Thank you, helped me a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *

Set your Twitter account name in your settings to use the TwitterBar Section.