RH: Resizing LUN using multipath
Sometimes it is needed to resize ( let’s say increase ) the size of a LUN on Linux.
It is possible to do it all online ( but not without risc :-/ )
What you need to do is the follwoing :
# multipath -ll
360a980006467662d435a687a52734550 dm-13 NETAPP,LUN
[size=75G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=16][active]
\_ 1:0:0:5 sdf 8:80 [active][ready]
\_ 1:0:1:5 sdl 8:176 [active][ready]
\_ 2:0:0:5 sdr 65:16 [active][ready]
\_ 2:0:1:5 sdx 65:112 [active][ready]
\_ round-robin 0 [prio=2][enabled]
\_ 2:0:2:5 sdad 65:208 [active][ready]
\_ 2:0:3:5 sdaj 66:48 [active][ready]
For all devices attached to the specified LUN
# for DEVICES in `multipath -ll 360a980006467662d435a687a52734550 | grep “_ [0-9]” | awk ‘{print $3}’`
do
blockdev –rereadpt /dev/${DEVICES}
done
Now start multipathd in interactive mode
# multipathd -k
multipathd> list multipaths
name sysfs uuid
360a980006467662d435a687a52734550 dm-13 360a980006467662d435a687a52734550
multipathd> resize multipath dm-13
ok
Now resize the LVM Physical Volume
# pvresize /dev/dm-13>
Physical volume “/dev/dm-13>” changed
1 physical volume(s) resized / 0 physical volume(s) not resized
Now you can see the increased size with vgs and resize the Logical Volume.
Don’t forget to do a resize2fs after resizing the Logical Volume
Leave a comment