Shrink Multipath Block Device

From LUG
Revision as of 14:55, 3 January 2018 by Dawes001 (talk | contribs) (Created page with "Before you start - be advised that currently it is '''not''' possible to shrink an XFS filesystem. You will have to add a new device, copy t...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Before you start - be advised that currently it is not possible to shrink an XFS filesystem. You will have to add a new device, copy the files onto it, then remove the larger one.

However, it is possible to shrink an LVM PV formatted device, or an ext4 filesystem. Please see the LVM shrinking page for methods for how to do this.

Long story short - this will only ever happen if your block devices are being transmitted over a SAN. Once you've cleaned up the last blocks on a device as depicted in the above link, then allow the block device to be reduced at the originator. Rescan the devices as per the instructions for growing:

# echo 1 > /sys/class/scsi_device/X\:X\:X\:X/device/rescan

Resize the path in multipathd with:

# multipathd -k"resize multipath san4_Data"

Once that's done, multipath should now report the new size:

# multipath -ll san4_Data

san4_Data (360002ac00000000000000dfa00004ca6) dm-3 3PARdata,VV             
size=250G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
  |- 0:0:1:2 sdb 8:16  active ready running
  `- 1:0:1:2 sdg 8:96  active ready running