Get UUID of Hard Disks

The Universally Unique Identifier can be used to identify a device independent form its mount point or device name. This is more and more important as many devices today support hot-plugging or are external anyway. Therefore it makes sometimes sense to access a device (for example in fstab) not by device name but by the UUID.

There are several ways to get the UUID. The first one uses the /dev/ directory.

impact@backup:/dev$ ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 2009-10-03 15:57 39b951e9-0ccf-4703-b392-74dd94a7b8e4 -> ../../sdf1
lrwxrwxrwx 1 root root 10 2009-10-03 15:57 ade77487-4b11-4e9a-824c-9016df2e0fbd -> ../../sda2
lrwxrwxrwx 1 root root 10 2009-10-03 15:57 cd9ca16c-3496-4cf3-9ddf-33376d8d1817 -> ../../sda1
lrwxrwxrwx 1 root root  9 2009-10-03 15:57 d310b640-6380-4327-8d12-37c1b3ddcc2d -> ../../md0

Another way to get the uuid by usage of the tool blkid:

impact@backup:/dev$ blkid /dev/sda2
/dev/sda2: UUID="ade77487-4b11-4e9a-824c-9016df2e0fbd" TYPE="ext3"

 

Add Comment Register



Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>