[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [linux-lvm] Resizing underlying LVM partition after cloning to bigger disk

On 03/05/2011 03:13 AM, Scott Arthur wrote:
> I've been playing around on a test system with a similar partition
> table.
> Have successfully resized 2 to fill the disk extent. Partition 5
> however proves to be problematic.
> Using fdisk, I tried deleting 2 and 5 and recreating based on
> sectors, but couldn't recreate 5 on the same starting sector, it told
> me I was out of bounds.
> I then tried the same thing with fdisk but with cylinders instead and
> both partitions were recreated okay, but destroyed all my LVM stuff.
> I can happily resize 2 using parted but parted wont resize 5.

If the start of partition moves (even by 1 sector) LVM metadata will
not be recognised. So you must manipulate only with partition end.
Cylinders can round up the start of partition so this can easily happen.

fdisk in sector mode (fdisk -u) should allow that, if it is not possible,
I guess it is bug (be sure to use new fdisk from util-linux[-ng], there
was a lot of bugfixes in last years).
(and partition 5 is extended partition so you probably need to resize
"parent" partion before it as well.)

Anyway, from the LVM point of view you can do both - either move partition
end to enlarge disk (and inform LVM about it using pvresize afterward)
or simply add new partition to VG.
(The problems are usualy outside of LVM scope - like 2G partition limitation,
problems to change open partition size in kernel etc.)

Just avoid moving the start sector of PV - this will not work.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]