wiki:jazz/10-11-17

Version 1 (modified by jazz, 14 years ago) (diff)

--

2010-11-17

  • 如何查詢 Disk UUID - [參考] 使用UUID掛載磁碟分割
    • 查詢 /dev/disk/by-uuid/ 目錄內容 - [缺點] 剛格式化完,縱使重跑 udev 也不會跑出新的裝置。
      jazz@drbl:~$ ls -l /dev/disk/by-uuid/
      總計 0
      lrwxrwxrwx 1 root root 10 2010-11-12 10:16 8f309621-1141-44eb-8bd9-892cc6663a60 -> ../../sda1
      lrwxrwxrwx 1 root root 10 2010-11-12 10:16 b08cf2c1-4ce0-4e08-a7d2-609e66e028e3 -> ../../sda5
      
      • 使用 blkid
        jazz@drbl:~$ sudo blkid 
        /dev/sda1: UUID="8f309621-1141-44eb-8bd9-892cc6663a60" TYPE="reiserfs" 
        /dev/sda5: TYPE="swap" UUID="b08cf2c1-4ce0-4e08-a7d2-609e66e028e3" 
        /dev/sdb1: UUID="9cd0865c-931f-40fb-a5f8-c3e6096b41b1" SEC_TYPE="ext2" TYPE="ext3" 
        
      • 使用 vol_id
        jazz@drbl:~$ sudo vol_id /dev/sdb1
        ID_FS_USAGE=filesystem
        ID_FS_TYPE=ext3
        ID_FS_VERSION=1.0
        ID_FS_UUID=9cd0865c-931f-40fb-a5f8-c3e6096b41b1
        ID_FS_UUID_ENC=9cd0865c-931f-40fb-a5f8-c3e6096b41b1
        ID_FS_LABEL=
        ID_FS_LABEL_ENC=
        ID_FS_LABEL_SAFE=