Expand the file system on a PowerPath pseudo-device

Mar 30, 2020

The following steps have been tested on RHEL 6 wihout having a partition on the LUN.

1. Expand the LUN on the storage array

The OS should automatically detect the changes.

Mar 25 03:10:06 localhost kernel: sd 1:0:1:4: Capacity data has changed
Mar 25 03:10:27 localhost kernel: sd 4:0:1:4: Capacity data has changed
Mar 25 03:10:27 localhost kernel: sd 1:0:0:4: Capacity data has changed
Mar 25 03:19:08 localhost kernel: sd 4:0:0:4: Capacity data has changed

2. Find out the native paths for the LUN

# powermt display dev=emcpowerh

3. Scan the native paths

# echo 1 > /sys/block/sdu/device/rescan
# echo 1 > /sys/block/sdt/device/rescan
# echo 1 > /sys/block/sdk/device/rescan
# echo 1 > /sys/block/sdj/device/rescan
Mar 25 03:19:08 localhost kernel: sd 4:0:1:4: [sdu] 209715200 512-byte logical blocks: (107 GB/100 GiB)
Mar 25 03:19:08 localhost kernel: sdu: detected capacity change from 53687091200 to 107374182400
Mar 25 03:19:11 localhost kernel: sd 1:0:1:4: [sdt] 209715200 512-byte logical blocks: (107 GB/100 GiB)
Mar 25 03:19:11 localhost kernel: sdt: detected capacity change from 53687091200 to 107374182400
Mar 25 03:19:15 localhost kernel: sd 1:0:0:4: [sdk] 209715200 512-byte logical blocks: (107 GB/100 GiB)
Mar 25 03:19:15 localhost kernel: sdk: detected capacity change from 53687091200 to 107374182400
Mar 25 03:19:18 localhost kernel: sd 4:0:0:4: [sdj] 209715200 512-byte logical blocks: (107 GB/100 GiB)
Mar 25 03:19:18 localhost kernel: sdj: detected capacity change from 53687091200 to 107374182400

4. Save PowerPath configuration

# powermt config
# powermt save

5. Check the new size

Make sure the underlying devices and emcpower device are both updated with new size.

# fdisk -cul /dev/{sd{u,t,k,j},emcpowerh} | grep dev
# grep emcpowerh /proc/partitions

6. Resize PV and check new size

# pvresize /dev/emcpowerh
# pvdisplay /dev/emcpowerh

7. Extend LV from 50 GB to 100 GB

Here we’ll be using all available space.

# lvextend -l +100%FREE /dev/<vg>/<lv>
# lvdisplay /dev/<vg>/<lv>

8. Resize the file system

# resize2fs /dev/<vg>/<lv>                  # for the ext2, ext3, or ext4 file system
# xfs_growfs /dev/<vg>/<lv>                 # for the XFS file system
linuxlinuxpowerpathlvm

How to extend GFS2 file system

Migrating DigitalOcean droplet to ESX or KVM

comments powered by Disqus