[CentOS] Best way to extend pv partition for LVM

Mon Apr 4 09:49:02 UTC 2011
David Sommerseth <dazo at users.sourceforge.net>

On 04/04/11 11:11, John Hodrien wrote:
> On Sat, 2 Apr 2011, Jay Leafey wrote:
> 
>> You COULD use option #1, but it requires some additional resources and a
>> LOT of shuffling.
> 
> Why do you need to shuffle?
> 
> fdisk /dev/sda
> delete the PV partition
> create a new PV partition starting at the same sector but ending at the end of
> the now larger disk.
> write it out and reboot.  I forget whether the reboot is still necessary, but
> I think fdisk will warn you it is if you've got mounted filesystems on that
> disk.
> pvresize /dev/sda1

Reboot shouldn't be needed.  You might want to run partprobe though.

A fourth approach is to use pvmove, to move data off /dev/sda ... do the
fdisk stuff then pvcreate and add the PV into your VG again.  This however
requires that the existing PVs can hold all the data which was in the
/dev/sda device.


kind regards,

David Sommerseth