1、查看磁盘uuid
root@hos:~# blkid
/dev/nvme0n1: UUID="fbb59c47-281c-421b-ac33-e764bb0af516" TYPE="ext4"
/dev/nvme1n1: UUID="b37da31a-e416-4611-9239-238d7cf94673" TYPE="ext4"
/dev/nvme2n1: UUID="55aaf211-6963-42af-acad-0577b1bf7174" TYPE="ext4"
/dev/nvme3n1: UUID="750abcf1-197c-4c9f-91d8-f72d27766536" TYPE="ext4"
/dev/nvme4n1: UUID="3f8847a7-8d8a-493e-875c-99b4aa4c6a0a" TYPE="ext4"
/dev/nvme5n1: UUID="b43811df-662e-40d8-9faa-86dff9b16960" TYPE="ext4"
/dev/sdb1: UUID="572C-81CF" TYPE="vfat" PARTUUID="1283f450-ddba-49eb-bb36-d7da3937c10c"
/dev/sdb2: UUID="799c5e47-635b-42d5-a132-e1d6fcf73627" TYPE="ext4" PARTUUID="9184a5b4-c6d9-44c1-9f67-c6e6b01b0417"
/dev/sda: UUID="aa8cec0d-734d-445a-abdf-5411e067a1f3" TYPE="ext4"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
root@hos:~# blkid /dev/nvme0n1 |awk '{printf $2}' |awk -F '\"' '{printf $2}'
fbb59c47-281c-421b-ac33-e764bb0af516root@hos:~#
2、查看所有磁盘
root@tidb3:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 223.6G 0 disk
├─sda1 8:1 1 512M 0 part /boot/efi
└─sda2 8:2 1 223.1G 0 part /
nvme0n1 259:0 0 1.8T 0 disk /nvme0
nvme1n1 259:1 0 1.8T 0 disk /nvme1
nvme2n1 259:2 0 1.8T 0 disk /nvme2
nvme3n1 259:3 0 1.8T 0 disk /nvme3
nvme4n1 259:4 0 1.8T 0 disk /nvme4
nvme5n1 259:5 0 1.8T 0 disk /nvme5
3、查看所有磁盘使用信息
root@tidb3:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 252G 0 252G 0% /dev
tmpfs 51G 1.5M 51G 1% /run
/dev/sda2 219G 4.5G 203G 3% /
tmpfs 252G 0 252G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 252G 0 252G 0% /sys/fs/cgroup
/dev/nvme2n1 1.8T 325M 1.7T 1% /nvme2
/dev/nvme3n1 1.8T 7.2G 1.7T 1% /nvme3
/dev/nvme0n1 1.8T 299M 1.7T 1% /nvme0
/dev/nvme5n1 1.8T 77M 1.7T 1% /nvme5
/dev/nvme4n1 1.8T 212M 1.7T 1% /nvme4
/dev/sda1 511M 6.1M 505M 2% /boot/efi
/dev/nvme1n1 1.8T 338M 1.7T 1% /nvme1
tmpfs 51G 0 51G 0% /run/user/1000
tmpfs 51G 0 51G 0% /run/user/0