How to extend GFS(2) file system when multipathing is used and in case it is possible to grow physical volume on SAN side?
Environment
- Red Hat Enterprise Linux 5, 6, 7 with Resilient Storage Add-on
Issue
- How to extend/grow GFS(2) filesystem that is located on multipath device?
- Are there any special steps needed when extending GFS(2) on multipath device by extending drive containing PV with GFS(2) LV?
Resolution
Procedure for extending the GFS(2) when the underlying storage resize is supported by storage vendor is below.
As example we will be growing GFS2 filesystem mounted on /gfs2/mountpoint by 20GB.
Filesystem is on LV gfs2_lv from VG cluster_vg on multipath device /dev/mapper/mpathX using 4 paths to storage.
-
Increase the size of LUN containing the PV. This process is storage vendor dependent and for detailed instruction how to increase LUN size check with storage vendor documentation. After increasing the size of LUN it is expected to see message like below in the
dmesgoutput.kernel: sd X:X:X:X: Warning! Received an indication that the LUN assignments on this target have changed. The Linux SCSI layer does not automatically remap LUN assignments. -
On every node in cluster it is necessary to detect the changed size of LUN from storage as described below so every node has same information.
2.1. Check out from which paths the multipath devices consists on node using commands
multipath -lloutput.mpathX (360000000000000000000000000000001) dm-1 HP,HSV200 [size=50G][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=100][active] \_ 1:0:0:1 sdU 8:32 [active][ready] \_ 2:0:0:1 sdV 8:160 [active][ready] \_ round-robin 0 [prio=20][enabled] \_ 1:0:1:1 sdX 8:96 [active][ready] \_ 2:0:1:1 sdZ 8:224 [active][ready]2.2. Rescan each of the paths of
mpathXdevice.# echo 1 > /sys/block/sdU/device/rescan # echo 1 > /sys/block/sdV/device/rescan # echo 1 > /sys/block/sdX/device/rescan # echo 1 > /sys/block/sdZ/device/rescan2.3 Resize the multipath device
mpathX.# multipathd -k"resize map mpathX" -
On one node only continue with following commands.
3.1 Resize physical volume (PV) on multipath device
mpathX.# pvresize /dev/mapper/mpathX3.2. Extend logical volume (LV) with GFS(2) filesystem.
# lvextend -L+20G cluster_vg/gfs2_lv3.3.A (for GFS2 filesystem) Grow the filesystem using command
# gfs2_grow /gfs2/mountpoint3.3.B (for GFS filesystem) Grow the filesystem using command
# gfs_grow /gfs/mountpoint
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.