[CentOS] Proper partition/LVM growth after RAID migration

Wed Oct 18 08:40:24 UTC 2006
William L. Maltby <CentOS4Bill at triad.rr.com>

On Tue, 2006-10-17 at 20:29 -0500, Jay Leafey wrote:
> I just finished playing this "game", though with a SAN volume.  It took a couple of steps to take advantage of the extra space. 
> First, the SAN manager extended the volume from 100G to 200G.  I idled everything referencing the drive by disabling the volume 
> group ( vgchange --available n vgname ).  I then ran fdisk against the volume, noting the starting cylinder of the only partition on 
> the drive.  I deleted the partition, recreated it using the same starting cylinder and let fdisk figure out the last usable cylinder 
> on the drive, reset the partition type to LVM, and wrote the partition table.  At this point I had to reboot to get the system to 
> re-read the partition table.

It used to be possible to get the partition table re-read with

    sfdisk -R /dev/XXX

Still can do?

>   Once it came back up I used pvresize to extend the physical volume to use the additional space in the 
> partition.  After that, vgdisplay showed the additional space as available for allocation.  This was complicated by the fact that it 
> was actually a two-node cluster (RHCS and GFS) so I had to reboot both nodes before running pvresize.
> I was originally just going take the easy way out by creating a second partition/physical volume to use the additional space, but it 
> seemed inelegant.  I'm unlikely to ever extend this LUN more than once, but you just never know!

AHEM! Inelegant? In the eye of the beholder! I *prefer* multiple
partitions because of the flexibility it gives. I keep vg sizes closer
to the anticipated max and then allocate more temporarily or permanently
as needed. This is useful for snapshot volumes too as you can "cross
snapshot" by putting the snapshot on a different physical unit.

Moreover, with some forethought, performance gains can be had by getting
different portions of a volume group onto different physical units (hda,
hdb,...) or even on the same physical units (put swap smack-dab in the
middle of busy logical volumes to reduce head movement if you don't have
a better physical unit to put it on).

Anyway, I like multiple partitions. The problem is in not overdoing it.