1、使用blkid命令
[root@VPC3-CS-TEST ~]# blkid
/dev/vda1: LABEL="/" UUID="0aa3affc-3964-4faa-a79f-71714fa914eb" TYPE="ext4"
/dev/vdb1: UUID="edda0f53-2688-4edb-99ff-ed4df8d8a4b1" TYPE="ext4"
[root@VPC3-CS-TEST ~]# man blkid
DESCRIPTION
The blkid program is the command-line interface to working with the libblkid(3) library. It can determine the type of content (e.g.
filesystem or swap) that a block device holds, and also the attributes (tokens, NAME=value pairs) from the content metadata (e.g. LABEL
or UUID fields).
It is recommended to use lsblk(8) command to get information about block devices, or lsblk --fs to get an overview of filesystems, or
findmnt(8) to search in already mounted filesystems.
2、使用tune2fs命令
[root@VPC3-CS-TEST ~]# tune2fs -l /dev/vda1 |grep 'UUID'
Filesystem UUID: 0aa3affc-3964-4faa-a79f-71714fa914eb
[root@VPC3-CS-TEST ~]# man tune2fs
DESCRIPTION
tune2fs allows the system administrator to adjust various tunable filesystem parameters on Linux ext2, ext3, or ext4 filesystems. The
current values of these options can be displayed by using the -l option to tune2fs(8) program, or by using the dumpe2fs(8) program.
The device specifier can either be a filename (i.e., /dev/sda1), or a LABEL or UUID specifier: "LABEL=volume-name" or "UUID=uuid".
3、使用dumpe2fs命令
[root@VPC3-CS-TEST ~]# dumpe2fs /dev/vda1 |grep 'UUID'
dumpe2fs 1.42.9 (28-Dec-2013)
Filesystem UUID: 0aa3affc-3964-4faa-a79f-71714fa914eb
4、使用/dev/disk/by-uuid目录
[root@VPC3-CS-TEST ~]# ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Mar 1 11:02 0aa3affc-3964-4faa-a79f-71714fa914eb -> ../../vda1
lrwxrwxrwx 1 root root 10 Mar 1 11:02 edda0f53-2688-4edb-99ff-ed4df8d8a4b1 -> ../../vdb1