LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Presenting logical volume from host to KVM guest. Partition within guest? (https://www.linuxquestions.org/questions/linux-server-73/presenting-logical-volume-from-host-to-kvm-guest-partition-within-guest-4175549052/)

batfastad 07-27-2015 09:27 AM

Presenting logical volume from host to KVM guest. Partition within guest?
 
Hi everyone

I've just been looking at rebuilding a small KVM host I've had running for a couple of years.

Just checked and there's a mail server guest (large database) where I have presented a logical volume to it. But inside that guest I'm not using LVM but have created a single partition with a regular file system.

Would it not be better to add the host's LV as a PV within the guest?
Then I can expand the LV at the host level, do a vgextend, lvextend and a resize2fs. Instead of worrying about having to resize a partition.

That wouldn't cause any issues at the host level would it?
The guest storing LVM metadata within a host's LV?

Cheers, B

smallpond 07-27-2015 11:25 AM

It wouldn't hurt, but there is not a big advantage.

You can put a filesystem on the unpartitioned PV in the guest. When you expand the LVM on the host, reboot the guest or run blockdev to update the size, then expand the filesystem.

batfastad 07-27-2015 03:53 PM

Quote:

Originally Posted by smallpond (Post 5396866)
You can put a filesystem on the unpartitioned PV in the guest. When you expand the LVM on the host, reboot the guest or run blockdev to update the size, then expand the filesystem.

Woah, an FS on an unpartitioned PV in the guest? So no VG/LV in the guest?

In a normal LVM scenario I never bother partitioning PVs first because I always end up having to reboot the VM. I understand the risk of not partitioning is that if you took the disk to a machine that didn't understand LVM then it might try and "initialize" it automatically and start partitioning/nuking data. But I can't think of any time where that's been even a vague consideration so I prefer to just increase the size of the disk in VMware then increase the VG, LV, FS.


All times are GMT -5. The time now is 04:31 AM.