[筆記] 硬碟UUID的查詢方式

way 1:

ls -l /dev/disk

總計 0
drwxr-xr-x 2 root root 280 2008-09-29 11:32 by-id
drwxr-xr-x 2 root root 100 2008-09-29 11:32 by-label
drwxr-xr-x 2 root root 180 2008-09-29 11:32 by-path
drwxr-xr-x 2 root root 140 2008-09-29 11:32 by-uuid

可以看到有許多種方式


ls -l /dev/disk/by-uuid

總計 0
lrwxrwxrwx 1 root root 10 2008-09-29 19:30 04fd9aa8-1401-473b-bf90-4b85c1be07d2 -> ../../sda6
lrwxrwxrwx 1 root root 10 2008-09-29 11:32 2C88743C8874071C -> ../../sda3
lrwxrwxrwx 1 root root 10 2008-09-29 11:32 38A8FC69A8FC26D2 -> ../../sda1
lrwxrwxrwx 1 root root 10 2008-09-29 19:30 8ffb1f3b-fb47-41b1-968f-d4c85078da0d -> ../../sda5
lrwxrwxrwx 1 root root 10 2008-09-29 19:30 BA0EDE250EDDDB09 -> ../../sda2

竟然是用soft link達成的~真神奇!!


way 2:

blkid - command-line utility to locate/print block device attributes


sudo blkid

/dev/sda1: UUID="38A8FC69A8FC26D2" LABEL="System" TYPE="ntfs"
/dev/sda2: UUID="BA0EDE250EDDDB09" LABEL="Aitjcize's.Data" TYPE="ntfs"
/dev/sda3: UUID="2C88743C8874071C" LABEL="PRESARIO_RP" TYPE="ntfs"
/dev/sda5: UUID="8ffb1f3b-fb47-41b1-968f-d4c85078da0d" TYPE="ext3"
/dev/sda6: TYPE="swap" UUID="04fd9aa8-1401-473b-bf90-4b85c1be07d2"

留言

這個網誌中的熱門文章

成功安裝Vista & Ubuntu Linux 8.04 LTS 雙系統!!!