In Linux management, hard Disk Management is a very important part. including arrays, partitions, logical volumes and other operations, before the operation of the hard disk, you need to fully understand the hard disk information. Common hard drive queries are available in the following ways:
1.DF View file system space usage;
linux-lszd-db:~ # DF
Filesystem 1k-blocks used Available use% mounted on
/dev/sda6 809262496 37615092 770825244 5%/
Udev 8076412 164 8076248 1%/dev
TMPFS 8076412 980 8075432 1%/DEV/SHM
/DEV/SDA4 167752 11776 155976 8%/boot/efi
linux-lszd-db:~ #
[[email protected] ~]# DF
File system 1k-block already used% mount point available
/dev/mapper/vg_gdyctdhis-logvol00
255880708 52738552 190144116 22%/
Tmpfs 16430728 328 16430400 1%/DEV/SHM
/dev/mapper/mpathap1 198337 82790 105307 45%/boot
/dev/mapper/vgdb2inst2-lvdb2app
154302476 10129308 136335064 7%/opt/db2
/dev/mapper/vgdbdata-dbdata01
619261704 34735152 553069888 6%/dbdata
[Email protected] ~]#
2.DF-LH is the most commonly used command,-H is printed out in an easy-to-understand manner, and the size of all hard links is calculated by-l;
linux-lszd-db:~ # DF-LH
Filesystem Size used Avail use% mounted on
/dev/sda6 772G 36G 736G 5%/
Udev 7.8G 164K 7.8G 1%/dev
Tmpfs 7.8G 980K 7.8G 1%/DEV/SHM
/DEV/SDA4 164M 12M 153M 8%/boot/efi
linux-lszd-db:~ #
3.FDISK-L lists all partitions, including non-mounted devices and USB devices:
linux-lszd-db:~ # Fdisk-l
Warning:gpt (GUID Partition Table) detected on '/DEV/SDA '! The util Fdisk doesn ' t support GPT. Use GNU Parted.
disk/dev/sda:897.0 GB, 896998047744 bytes
255 heads, Sectors/track, 109053 cylinders, total 1751949312 sectors
Units = sectors of 1 * MB = bytes
Sector size (logical/physical): bytes/4096 bytes
I/O size (minimum/optimal): 4096 bytes/4096 bytes
Disk IDENTIFIER:0X540841CB
Device Boot Start End Blocks Id System
/DEV/SDA1 1 1751949311 875974655+ ee GPT
Partition 1 does not start on physical sector boundary.
linux-lszd-db:~ #
4.cfdisk
linux-lszd-db:~ # Cfdisk
Cfdisk (Util-lin UX 2.19.1)
dis K Drive:/DEV/SDA
&N Bsp size:89699804774 4 bytes, 896.9 GB
&N Bsp heads:255 sectors per track:63 Cylin ders:109053
Name Flags part Type FS type [Label] Size (MB)
--------------------------------------------------------------------------------------------------------------- --------------------------------------------
SDA1 NC Primary GPT 896998.05 *
[Bootable] [Delete] [Help] [Maximize] [Print] [Quit] [Type] [Units] [Write]
Quit program without writing partition table
5.hdparm-i/dev/hda View hard drive model information, actual operation, in both SuSE and CentOS do not support this command;
6.smartctl can view the manufacturer, model, serial number, capacity, support smart, turn on No.