Linux query hard disk block device file system commands

1. fdisk -l

The fdisk command is used to manage disk partitions, you can use the fdisk -l command to query disk information; example:


[root@123root]# fdisk -l

Disk /dev/vda: 40 GiB, 42949672960 bytes, 83886080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x370213b7

Device     Boot Start      End  Sectors Size Id Type
/dev/vda1  *     2048 83886079 83884032  40G 83 Linux


Disk /dev/vdb: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

2. df -T

The df -T command can display the file type (Type), size (1K-blocks), mount point (Mounted on)
example:


[root@123 root]# df -T

Filesystem     Type     1K-blocks     Used Available Use% Mounted on
devtmpfs       devtmpfs   7933772     2048   7931724   1% /dev
tmpfs          tmpfs      7948088        0   7948088   0% /dev/shm
tmpfs          tmpfs      7948088      668   7947420   1% /run
tmpfs          tmpfs      7948088        0   7948088   0% /sys/fs/cgroup
/dev/vda1      ext4      41021664 24917404  13990776  65% /
tmpfs          tmpfs      7948088     1056   7947032   1% /tmp
/dev/vdb       ext3     205376184 89710948 105179476  47% /usr1
tmpfs          tmpfs      1589616        0   1589616   0% /run/user/0
tmpfs          tmpfs      1589616        0   1589616   0% /run/user/1000

3. blkid

blkid is used to view block device UUID, Label, mount, file system type and other information examples:

[root@123 root]# blkid

/dev/vda1: UUID="dd63185c-f54d-476f-9270-14ad8f9196c6" TYPE="ext4" PARTUUID="370213b7-01"
/dev/vdb: UUID="5cfe7cc7-a335-4fa2-ade9-69c1969f7815" TYPE="ext3"

[root@123 root]# blkid /dev/vdb  #查询指定分区/dev/vdb

/dev/vdb: UUID="5cfe7cc7-a335-4fa2-ade9-69c1969f7815" TYPE="ext3"

4. lsblk

lsblk displays in tree form by default, if you want to display in list form: execute lsblk -l.

[root@123 root]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    253:0    0   40G  0 disk
└─vda1 253:1    0   40G  0 part /
vdb    253:16   0  200G  0 disk /usr1

[root@123 root]# lsblk -l
NAME MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda  253:0    0   40G  0 disk
vda1 253:1    0   40G  0 part /
vdb  253:16   0  200G  0 disk /usr1

The meaning of each parameter:

name meaning
NAME block device name
MAY: MIN major and minor device numbers
RM Whether the device is a removable device, 0 is not a removable device
SIZE Capacity
RO Whether it is read-only, 0 means it is not read-only
TYPE Whether the block device is a disk or a partition on a disk
MOUNTPOINT The mount point where the device is mounted, empty means it is not mounted

Guess you like

Origin blog.csdn.net/weixin_42648692/article/details/129856823