古詩詞大全網 - 成語大全 - 如何查看linux服務器上有幾塊磁盤?

如何查看linux服務器上有幾塊磁盤?

有多種方式查看linux服務器上有幾塊磁盤

方法1:

[root@localhost xly]# lsblk

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

sr0 11:0 1 1024M 0 rom

sda 8:0 0 40G 0 disk

├─sda1 8:1 0 300M 0 part /boot

├─sda2 8:2 0 17.8G 0 part /

└─sda3 8:3 0 2G 0 part [SWAP]

sdb 8:16 0 20G 0 disk /opt

可知系統有sda和sdb兩塊磁盤

方法2:

[root@localhost xly]# fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes

255 heads, 63 sectors/track, 5221 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: 0x00041bdd

Device Boot Start End Blocks Id System

/dev/sda1 * 1 39 307200 83 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 39 2358 18631680 83 Linux

/dev/sda3 2358 2611 2031616 82 Linux swap / Solaris

Disk /dev/sdb: 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: 0x00000000