![]() |
Accommodating Dynamic LUN Growth
Ok, so, we occasionally have need to increase the size of a mount point so that a given application doesn't run out of space. Now, I know that I can use LVM to do growth by striping or concatenating the underlying LUNs, but, this isn't always the best solution. In some cases, we would prefer to grow the LUN on the array and upsize the partition/PV/LVM/filesystem on the Linux host. There's a number of commands that can be used to re-read a partition table: blockdev, sfdisk, partprobe, etc.
Unfortunately, of the commands I've found, `blockdev` seem to really be the only one that will cause the kernel to notice a change in the *size* of the /dev/sdX device. Without the size-change being noticed by Linux, I can't modify partitions/PVs/LVs/filesystems to use the new space. Unfortunately, it seems that I can only run `blockdev` if I've offlined the upper data structures that live on the /dev/sdX device (i.e., unmount filesystems and make any LVs containing the /dev/sdX offline). I mean, it still saves me a reboot, but I'm *really* looking for a way to get the kernel to notice the size change *without* having to take the filesystem (etc.) offline to do it. Anyone know a better way to accommodate this kind of online device-size modification? |
You have to unmount the filesystem(s) and offline the volume group.
Quote:
Quote:
Quote:
Quote:
Quote:
|
Quote:
|
Possible online method
Found other sources that indicate you might be able to do it online with this. I've not actually used these steps, so YMMV.
* Increase LUN size * Use "multipath -ll" to find the /dev/sd* devices for your LUN * Rescan each /dev/sd* device with: echo 1 > /sys/block/sdX/device/rescan * Possibly replace the paths multipathd -k "del path sdX" multipathd -k "add path sdX" loop - making sure to keep a working path at all times * Update device-mapper's internal tables multipathd -k"resize map <multipath_device>" <multipath_device> can be "mpath14" or a dm WWID Older versions of multipath require manual table reloads, ala: dmsetup table; dmsetup suspend; dmsetup reload; dmsetup resume * Use "multipath -ll" to make sure the sizes are updated * pvresize, lvextend, resize2fs |
Quote:
|
Unfortunately, none of the below actually causes the system to issue the necessary ioctl's to cause the system to become aware of a change in the device geometry (in this case, the size of the underlying LUN). The only thing I've found that issues the requisite ioctl's is `blockdev`. Unfortunately, if there's any active data structures on top of the grown device (LVM objects, filesystems, etc.) the requisite `blockdev` command fails with a "Device Busy" error. So, what I want, if it exists in Linux/RHEL, is a method of invoking the necessary ioctl's without having to offline the higher-up data structures.
None of the below do that. All of the below rely on something like `blockdev` having already caused the changed device geometry to have been discovered. Quote:
|
Quote:
There may be reasons for preferring to grow the underlying storage extent (e.g., you may have array optimizations that happen better if you're talking to a contiguous device rather than cobbling extents together via a host-based, software volume management solution like LVM(2); if you're in a virtualized environment, your virtual infrastructure people may want to limit the number of VMDKs associated with a given VM; etc.). As such, adding PV(s) to your VG(s) so you can grow your LV(s) won't be your "best" solution. |
As for performance, your SAN can of course be optimized around either approach -- i.e. relying on contiguous blocks vs. expecting to divvy out fixed LUNs that may or may not be contiguous.
But, yes, I see your point about interdepartmental policies and politics. The devil is always in the details. All that said, I don't have a clever solution (short of rebooting) to your original question. |
Quote:
Quote:
Quote:
|
| All times are GMT -5. The time now is 02:39 AM. |