Thursday, February 2, 2012

Resizing Online Multipath Disk in Linux

Here is the steps to Resize an Online Multipath Disk which is using Linux native device mapper as multipath solution.

1. Resize your physical disk in SAN. SAN Admins will do this. 
2. Use the following command to find the paths to the LUN:
# multipath -l
3. Now, Resize your paths. For SCSI devices, use the following command:
# echo 1 > /sys/block//device/rescan
4. Resize your multipath device by running the multipathd resize command:
# multipathd -k'resize map mpath0'
5. Resize the  File System (Assuming LVM is NOT used)
# resize2fs /dev/mapper/mpath0
If LVM is used, you need to do the following:
Check your Disk Changes detected under LVM:
#pvs or pvdisplay 
To check the VG Size is Increased:
#vgs or vgdisplay
Now Extend the LV: 
#lvextend -L +G
Finally Extend the File System