Re: Shrinking LVM partition at beginning

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

 



Dne 9.4.2016 v 12:12 Nick Urbanik napsal(a):
Dear Folks,

I want to shrink an LVM partition and expand a preceding, non-LVM
partition.  The LVM partition contains three logical volumes.  I
shrank the larger, middle home volume at the volume's end successfully
with a command something like this:

sudo lvresize --verbose --resizefs -L -40G /dev/fedora/home

and then used pvmove to move all the pysical extents towards the end
of the disk, using some commands something like this:

sudo pvmove --alloc anywhere /dev/sda6:24387-34626 /dev/sda6:34627-44866

until all the extents are towards the end of the disk, and there are
10240 unused at the beginning of the volume.

So: can anyone suggest how I can shrink the volume group by that 10240
physical extents, so that I can shrink the partition, and expand the
previous partition?

Hi

Unsupported - requires very good understanding about lvm2 metadata format
and very good precision in all calculations if you would do it by hand...

Basically you need to recreate PV header at different position,
and recompute all 'PV' extents in use.

IMHO easiest&safest for a normal user is to just 'copy' disk elsewhere, reformat with new layout and copy data back (yeah - takes some time,
but with significantly less probability of data loose...)

lvm2 is not meant to be used with other volume manager (like partitions)
so do not expect it will support such sort of operations...

Regards

Zdenek

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/



[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux