linux查看硬盘分区UUID的两种方法

时间 : 14-12-31 栏目 : LINUX, shell 作者 : 虫哥 评论 : 0 点击 : 1,857 次

LINUX中,UUID代表着某个计算机中某个分区的唯一标识,其中一个作用就是用于linux引导启动,文件/boot/grub/grub.cfg以及 /etc/fstab 文件中都会用到 UUID,那么怎么知道相应设备的 UUID 呢?其中两方法如下:

1. sudo blkid


/dev/sda1: UUID="4FB299D01A8F056F" TYPE="ntfs"
/dev/sda2: UUID="00361f91-eef1-420a-bb9e-59b4e33be38b" TYPE="ext2"
/dev/sda3: UUID="50aae619-cb98-46d8-bef9-360bc2dd484e" TYPE="ext2"
/dev/sda5: UUID="7a36cc09-6ab1-485d-8870-138f42932b2d" TYPE="ext2"
/dev/sda6: UUID="bff46453-7a3f-464d-9fe7-afde29bb40e2" TYPE="ext2"
/dev/sda7: UUID="75c6546c-2e00-4cf2-a43b-2fbc9bdbfcc5" TYPE="ext2"
/dev/sda8: UUID="d0af2d5b-b169-47ae-9a95-36524d7ae384" TYPE="ext2"
/dev/sda9: UUID="59734adf-cf06-4ca9-97df-c408a9064dc1" TYPE="ext2"
/dev/sda10: UUID="13791ab1-a9c0-4e65-80a2-fdb8aa08265e" TYPE="ext2"
/dev/sdb1: UUID="EED88BF7D88BBBF9" TYPE="ntfs"
/dev/sdb5: UUID="266406F26406C491" TYPE="ntfs"
/dev/sdb6: UUID="7E380E12380DCA5B" TYPE="ntfs"
/dev/sdb7: UUID="7762976d-79c1-475f-b62c-faa668994cb3" TYPE="ext4"
/dev/sdb8: UUID="fab51b56-c6f7-4897-b688-15995558e581" TYPE="ext4"
/dev/sdb10: UUID="d4f60283-2364-40c2-a5a9-def8f970c552" TYPE="ext4"

2. ls -l /dev/disk/by-uuid


lrwxrwxrwx 1 root root 10 12月 31 08:54 00361f91-eef1-420a-bb9e-59b4e33be38b -> ../../sda2
lrwxrwxrwx 1 root root 11 12月 31 08:54 13791ab1-a9c0-4e65-80a2-fdb8aa08265e -> ../../sda10
lrwxrwxrwx 1 root root 10 12月 31 08:54 266406F26406C491 -> ../../sdb5
lrwxrwxrwx 1 root root 10 12月 31 08:54 4FB299D01A8F056F -> ../../sda1
lrwxrwxrwx 1 root root 10 12月 31 08:54 50aae619-cb98-46d8-bef9-360bc2dd484e -> ../../sda3
lrwxrwxrwx 1 root root 10 12月 31 08:54 59734adf-cf06-4ca9-97df-c408a9064dc1 -> ../../sda9
lrwxrwxrwx 1 root root 10 12月 31 08:54 75c6546c-2e00-4cf2-a43b-2fbc9bdbfcc5 -> ../../sda7
lrwxrwxrwx 1 root root 10 12月 31 08:54 7762976d-79c1-475f-b62c-faa668994cb3 -> ../../sdb7
lrwxrwxrwx 1 root root 10 12月 31 08:54 7a36cc09-6ab1-485d-8870-138f42932b2d -> ../../sda5
lrwxrwxrwx 1 root root 10 12月 31 08:54 7E380E12380DCA5B -> ../../sdb6
lrwxrwxrwx 1 root root 10 12月 31 08:54 bff46453-7a3f-464d-9fe7-afde29bb40e2 -> ../../sda6
lrwxrwxrwx 1 root root 10 12月 31 08:54 d0af2d5b-b169-47ae-9a95-36524d7ae384 -> ../../sda8
lrwxrwxrwx 1 root root 11 12月 31 08:54 d4f60283-2364-40c2-a5a9-def8f970c552 -> ../../sdb10
lrwxrwxrwx 1 root root 10 12月 31 08:54 EED88BF7D88BBBF9 -> ../../sdb1
lrwxrwxrwx 1 root root 10 12月 31 08:54 fab51b56-c6f7-4897-b688-15995558e581 -> ../../sdb8

本文标签 , , ,

除非注明,文章均为( 虫哥 )原创,转载请保留链接: http://www.recho.net/104

linux查看硬盘分区UUID的两种方法:等您坐沙发呢!

发表评论


-----===== 博主信息 =====-----

相关文章

为您推荐

7