1、查看有几块硬盘 命令:df -lh [root@localhost ~]# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
6.5G 692M 5.5G 12% /
tmpfs 764M 0 764M 0% /dev/shm
/dev/sda1 485M 30M 430M 7% /boot
很明显,有一个sda1的scsi硬盘分区,还有一个lvs的卷,由于我装系统时比较懒,让CentOS帮我自动分的区,最后就搞成这样了。 这里可以很显示的看出各硬盘的分区、挂载情况,还能看到分区的空间使用情况。
2、查看硬盘分区 命令:fdisk -l 可以查看每个分区的详细情况
[root@localhost scsi]# 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 Id System
/dev/sda1 * 1 64 512000 83 linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 1306 9972736 8e Linux 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盘的分区情况,可以使用命令:[root@localhost scsi]# 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
这个命令应该是非常有用哦!
|