当前位置:C++技术网 > 资讯 > Linux信息:3 查看挂载的硬盘信息的方法

Linux信息:3 查看挂载的硬盘信息的方法

更新时间:2016-12-21 22:19:06浏览次数:1+次

    因为Linux磁盘管理都是动态挂载的,所以理解起来比Windows会稍微麻烦点。我们可以挂载多个硬盘,那么挂载的情况如何,我们可以通过命令lsblk来查看下,查看结果如下:

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
vda    252:0    0   20G  0 disk
`-vda1 252:1    0   20G  0 part /
vdb    252:16   0  100G  0 disk
`-vdb1 252:17   0  100G  0 part
vdc    252:32   0    2G  0 disk [SWAP]

    一共有三个盘,第一个20GB,第二个100GB,第三个2G(交换盘,类似于Windows的页文件)。

    如果要进一步查看各个盘的详细信息,可以使用fdisk -l,查看结果如下:

[root@VM_66_199_centos ~]# fdisk -l
注:vda信息(磁头数、扇区数、磁道数,柱面数等)
Disk /dev/vda: 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: 0x0006fee1

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *           1        2611    20970496   83  Linux
Note: sector size is 4096 (not 512)

注:vdb信息
Disk /dev/vdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 1631 cylinders
Units = cylinders of 16065 * 4096 = 65802240 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xf0f541a6

   Device Boot      Start         End      Blocks   Id  System
/dev/vdb1               1       13054   838849788   83  Linux

注:vdc信息
Disk /dev/vdc: 2147 MB, 2147483648 bytes
16 heads, 63 sectors/track, 4161 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

    这些信息也就是磁盘的详细信息了。