linux查看硬盘分区UUID

UUID是什么?可以大致理解为分区的表述符。

命令:

1、blkid

#blkid
/dev/block/253:1: UUID="0559cb97-8399-4656-a928-2d2211064424" TYPE="ext4" 
/dev/vdb: LABEL="gpt" UUID="a7338f0c-2e18-4ffb-a31b-199934d70118" TYPE="ext4" 
/dev/vdc: LABEL="gpt" UUID="58206cb6-c35c-456c-a5ad-210fc7f20aec" TYPE="ext4" 

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

#ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Jul 13 10:48 0559cb97-8399-4656-a928-2d2211064424 -> ../../vda1
lrwxrwxrwx 1 root root  9 Jul 16 12:38 58206cb6-c35c-456c-a5ad-210fc7f20aec -> ../../vdc
lrwxrwxrwx 1 root root  9 Jul 13 15:13 a7338f0c-2e18-4ffb-a31b-199934d70118 -> ../../vdb

3、ls -l /dev/disk/by-id/

#ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Jul 13 15:13 virtio-p7r9da36d6xdtu7kpai6 -> ../../vdb
lrwxrwxrwx 1 root root  9 Jul 13 10:48 virtio-p7ri9s9fnkobcodn3ihx -> ../../vda
lrwxrwxrwx 1 root root 10 Jul 13 10:48 virtio-p7ri9s9fnkobcodn3ihx-part1 -> ../../vda1
lrwxrwxrwx 1 root root  9 Jul 16 12:38 virtio-p7rj41xp8gtoi37y0072 -> ../../vdc

/dev/disk目录下有几个目录,如:by-id、by-label、by-uuid。

 by-id     :硬盘分区的永久性符号链接)
 by-label   :按卷标识别的硬盘分区,常用于挂载)
 by-path   :硬盘分区的节点链接
by-uuid   :按UUID识别的硬盘分区,常用于挂载

你可能感兴趣的:(linux,磁盘分区)