Saturday, March 8, 2008

Find the UUID of a disk in Linux

Here are several ways to find the UUID of a disk. First, look in /dev/disk/by-uuid/: toro@moutere:~$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 2008-03-08 21:26 07D6-0813 -> ../../sda1
lrwxrwxrwx 1 root root 10 2008-03-08 21:26 2e150bf9-7a49-4bc2-9b05-d91a01ec3641 -> ../../sda3
lrwxrwxrwx 1 root root 10 2008-03-08 21:26 36e995f3-800e-4b43-9bad-d5d008fd56c7 -> ../../sda5
lrwxrwxrwx 1 root root 10 2008-03-08 21:26 64B8625DB8622E2C -> ../../sda2
lrwxrwxrwx 1 root root 10 2008-03-08 21:26 e33829c1-94cf-4907-b74a-b5bb9f6c9f65 -> ../../sda6
Second, use the vol_id command: toro@moutere:~$ sudo vol_id /dev/sda3
ID_FS_USAGE=filesystem
ID_FS_TYPE=ext3
ID_FS_VERSION=1.0
ID_FS_UUID=2e150bf9-7a49-4bc2-9b05-d91a01ec3641
ID_FS_UUID_ENC=2e150bf9-7a49-4bc2-9b05-d91a01ec3641
ID_FS_LABEL=Share
ID_FS_LABEL_ENC=Share

No comments:

Post a Comment