1、查看有幾塊硬盤(pán) 命令: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
很明顯,有一個(gè)sda1的scsi硬盤(pán)分區(qū),還有一個(gè)lvs的卷,由于我裝系統(tǒng)時(shí)比較懶,讓CentOS幫我自動(dòng)分的區(qū),最后就搞成這樣了。 這里可以很顯示的看出各硬盤(pán)的分區(qū)、掛載情況,還能看到分區(qū)的空間使用情況。
2、查看硬盤(pán)分區(qū) 命令:fdisk -l 可以查看每個(gè)分區(qū)的詳細(xì)情況
[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默認(rèn)是查看所有的硬盤(pán),如果只想查看sda盤(pán)的分區(qū)情況,可以使用命令:[root@localhost scsi]# fdisk -l /dev/sda,這樣就不會(huì)列出VolGroup-lv卷的信息了。
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
4、查看磁盤(pán)IO狀態(tài)
iostat -d -x -k 1 10
5、查看某個(gè)目錄占用空間的大小
du -sh /root
這個(gè)命令應(yīng)該是非常有用哦!
|