How to extend multipath mpath disk in Linux ?
In this post, we will see how to extend multipath mpath disk in Linux.
Lets see how to do this step by step.
1. Check out the current mount point.
ngelinux01--> df -h /var/HP/NGEL/logs Filesystem Size Used Avail Use% Mounted on /dev/mapper/NGELAppVG_1-NGEL07lv 7.9G 984M 7.0G 13% /var/HP/NGEL/logs
2. Check out the VG and PV size.
ngelinux01--> vgdisplay NGELAppVG_1 --- Volume group --- VG Name NGELAppVG_1 System ID Format lvm2 VG Size 63.98 GiB Alloc PE / Size 14873 / 58.10 GiB Free PE / Size 1507 / 5.89 GiB ngelinux01--> pvs PV VG Fmt Attr PSize PFree /dev/mapper/mpathk appsvg lvm2 a--u 11.98g 6.98g /dev/mapper/mpathl NGELAppVG_1 lvm2 a--u 63.98g 5.89g /dev/sda2 rootvg lvm2 a--u 223.03g 143.91g
Now ask your storage team to increase the size of the disk connected to the multipath device at their end.
3. Check the multipath devices
ngelinux01--> multipath -ll mpathl (360002ac00000000000000c260000c71a) dm-3 3PARdata,VV size=64G features='0' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active |- 1:0:0:1 sdc 8:32 active ready running `- 2:0:0:1 sdk 8:160 active ready running
4. Rescan the disks on server.
ngelinux01--> echo 1 > /sys/block/sdc/device/rescan ngelinux01--> echo 1 > /sys/block/sdk/device/rescan
5. Resize the map path
ngelinux01--> multipathd resize map mpathl ok
6. Resize the physical volume.
ngelinux01--> pvresize /dev/mapper/mpathl Physical volume "/dev/mapper/mpathl" changed 1 physical volume(s) resized / 0 physical volume(s) not resized
7. Check out new VG size.
ngelinux01--> vgdisplay NGELAppVG_1 --- Volume group --- VG Name NGELAppVG_1 System ID Format lvm2 VG Size 79.98 GiB Alloc PE / Size 14873 / 58.10 GiB Free PE / Size 5603 / 21.89 GiB
8. Increase the space on LV.
ngelinux01--> lvdisplay /dev/mapper/NGELAppVG_1-NGEL07lv --- Logical volume --- LV Path /dev/NGELAppVG_1/NGEL07lv ngelinux01--> lvextend -L +10G NGELAppVG_1/NGEL07lv Size of logical volume NGELAppVG_1/NGEL07lv changed from 8.00 GiB (2048 extents) to 18.00 GiB (4608 extents). Logical volume NGEL07lv successfully resized. ngelinux01--> resize2fs -p /dev/mapper/NGELAppVG_1-NGEL07lv resize2fs 1.41.12 (17-May-2010) Filesystem at /dev/mapper/NGELAppVG_1-NGEL07lv is mounted on /var/HP/NGEL/logs; on-line resizing required old desc_blocks = 1, new_desc_blocks = 2 Performing an on-line resize of /dev/mapper/NGELAppVG_1-NGEL07lv to 4718592 (4k) blocks. The filesystem on /dev/mapper/NGELAppVG_1-NGEL07lv is now 4718592 blocks long. ngelinux01--> df -h /var/HP/NGEL/logs Filesystem Size Used Avail Use% Mounted on /dev/mapper/NGELAppVG_1-NGEL07lv 18G 1009M 17G 6% /var/HP/NGEL/logs
Here we have seen how to scan new increased size and increase our PV, multipath, VG and thereby LV size.
Hope this will be useful for you as well.