查看Linux服务器硬盘使用情况
1、查看有几块硬盘命令:df -lh# df -lhFilesystem SizeUsed Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
6.5G692M5.5G12% /
tmpfs 764M 0764M 0% /dev/shm
/dev/sda1 485M 30M430M 7% /boot
很明显,有一个sda1的scsi硬盘分区,还有一个lvs的卷,由于我装系统时比较懒,让CentOS帮我自动分的区,最后就搞成这样了。这里可以很显示的看出各硬盘的分区、挂载情况,还能看到分区的空间使用情况。
2、查看硬盘分区命令:fdisk -l可以查看每个分区的详细情况
# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003bc52
Device Boot Start End Blocks IdSystem
/dev/sda1 * 1 64 512000 83Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 1306 9972736 8eLinux LVM
Disk /dev/mapper/VolGroup-lv_root: 6987 MB, 6987710464 bytes
255 heads, 63 sectors/track, 849 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/mapper/VolGroup-lv_swap: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
fdisk -l默认是查看所有的硬盘,如果只想查看sda盘的分区情况,可以使用命令:# fdisk -l /dev/sda,这样就不会列出VolGroup-lv卷的信息了。
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
4、查看磁盘IO状态
iostat -d -x -k 1 10
5、查看某个目录占用空间的大小
du -sh /root这个命令应该是非常有用哦!
页:
[1]