Linux 查看文件系统、磁盘

centos
centos 下查看硬盘的信息

[root@vCentos ~]# fdisk -l

Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x00073f45

Device Boot Start End Blocks Id System
/dev/xvda1 * 1 2611 20970496 83 Linux

Disk /dev/xvdb: 21.5 GB, 21474836480 bytes
255 heads, 56 sectors/track, 2937 cylinders
Units = cylinders of 14280 * 512 = 7311360 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd6661d3d

Device Boot Start End Blocks Id System
/dev/xvdb1 1 2937 20970152 83 Linux
[root@vCentos ~]#

可以看到有两个硬盘Disk /dev/xvda: 21.5 GB, 21474836480 bytes

Disk /dev/xvdb: 21.5 GB, 21474836480 bytes

 

使用如下命令可以查看分区信息
[root@vCentos ~]# file -s /dev/xvdb1
/dev/xvdb1: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)
[root@vCentos ~]#

也可以使用df命令
[root@vCentos ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 20G 1.6G 18G 9% /
tmpfs 245M 0 245M 0% /dev/shm
/dev/xvdb1 20G 278M 19G 2% /data
[root@vCentos ~]# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/xvda1 ext4 20641404 1628252 17964628 9% /
tmpfs tmpfs 250336 0 250336 0% /dev/shm
/dev/xvdb1 ext4 20641060 284144 19308412 2% /data
[root@vCentos ~]#

Leave a Comment