Viewing server hard disk information is one of the daily tasks of system administrators. This article will introduce the commands commonly used in work to view Linux hard disk information.
Lshw command
The lshw command can provide a lot of information about system hardware, while using the - C disk option allows you to view related information such as description, (device) logical name, size, etc
[ root@10 ~]# lshw -C disk
*-disk
description: ATA Disk
product: SAMSUNG MZ7WD480
vendor: Western Digital
physical id: 0.0.0
bus info: scsi@0 : 0.0.0
logical name: /dev/sda
version: 103Q
serial: S2G1NYAG305472
size: 447GiB (480GB)
capabilities: gpt-1.00 partitioned partitioned:gpt
configuration: ansiversion=5 guid=e32f30e4-5b72-4318-8181-aa60e0eef84a logicalsectorsize=512 sectorsize=512
Lsblk command
The lsblk command can list all block devices in a tree, and it collects information about the hard disk by referencing the udev database and sysfs file system
[ root@10 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda4 8:4 0 430.5G 0 part /
├─sda2 8:2 0 1000M 0 part /boot
├─sda3 8:3 0 15.7G 0 part [SWAP]
└─sda1 8:1 0 1M 0 part
- Linux, Linux 查看硬盘
- 0 Users Found This Useful