1. 程式人生 > 其它 >centos 多路徑下掛載磁碟目錄

centos 多路徑下掛載磁碟目錄

環境:

OS:Centos 7

1.新增磁碟
虛擬機器新增磁碟裝置,介面型別選擇SATA

2.多路徑檢視磁碟裝置
[root@localhost data]# multipath -ll
mpatha (VMware_Virtual_SATA_Hard_Drive_00000000000000000001) dm-0 ATA ,VMware Virtual S
size=5.0G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
`- 3:0:0:0 sdb 8:16 active ready running


[root@localhost data]# lsblk


NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 300M 0 part /boot
├─sda2 8:2 0 2G 0 part [SWAP]
└─sda3 8:3 0 37.7G 0 part /
sdb 8:16 0 5G 0 disk
└─mpatha 253:0 0 5G 0 mpath /data
sr0 11:0 1 1024M 0 rom
sr1 11:1 1 1024M 0 rom


[root@localhost data]# fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000e86af

Device Boot Start End Blocks Id System


/dev/sda1 * 2048 616447 307200 83 Linux
/dev/sda2 616448 4812799 2098176 82 Linux swap / Solaris
/dev/sda3 4812800 83886079 39536640 83 Linux

Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/mpatha: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

3.格式化
mkfs.xfs /dev/mapper/mpatha

4.掛載
mount /dev/mapper/mpatha /data