On Mon, 20 Apr 2015 10:33:13 +0100 Darac Marjal <mailingl...@darac.org.uk> wrote:
> On Mon, Apr 20, 2015 at 09:26:54AM +0200, Petter Adsen wrote: > > Is it possible to have two VGs on the same PV? > > I don't believe so. The VG is the mapping layer in the LVM stack. It > maps the LVs to the PVs. If you were to share a PV between VGs, then > you'd need some way to tell the VGs which parts of the PV they can use > (letting them battle it out and potentially over-commit the PV is not > really a good idea). The easiest idea is to split the underlying > device into multiple PVs (e.g. use partitions). I see, thank you for the explanation. > > If so, how can I make a VG with lots of free space smaller? I'm > > suspecting that the answer to my first question is "no", since this > > doesn't seem possible from the man pages. > > A quick bit of searching suggests the incantation would be: > * Boot from a rescue/live disc > * Activate your VG > * (You say you've got unallocated space in your VG, so resizing > filesystems/LVs won't be covered) > * "lvm pvs" should, at this point, indicate some PFree, which is how > much you can shrink the PV > * Run "lvm pvresize /dev/whatever --setphysicalvolumesize 50G" > (Where /dev/whatever is the PV device and 50G is the new size to > resize to) > * Finally, resize the PV's partition appropriately. > > At this point, you will have a smaller PV and less unallocated space > in your VG. You can now create another partition, PV that and add it > to a second VG. I figured I would have to do that. It's not really a problem right now, I was mostly wondering if it was possible without messing with partitioning. But now I know how to do it if it crops up in the future, and that's a good thing :) Petter -- "I'm ionized" "Are you sure?" "I'm positive."
pgpzQA6xgPWs8.pgp
Description: OpenPGP digital signature