I'm setting up a Xen virtual machine server and I'm wondering which of these three options of disk setup is recommended. I'll be using a Linux host with Linux guests.

As I can see it I can do any of the following:

  1. Give the domU's a partition of the physical disk, then setup an LVM in the domU inside the partition.
  2. Give the domU's a Logical Volume to use as a virtual disk, then (a) setup partitions or (b) setup LVM inside.
  3. Give the domU's multiple Logical Volumes that are used directly.

Number 1 has the advantage that you get LVM in the domU, but you lose the flexibility of LVM in the dom0. However, 2a & 3 give the flexibility of LVM to dom0, but take it away from the domUs.

The most flexible situation appears to be to give the domUs a Logical Volume, as their entire disk, then to create a LVM setup in the LV (option 2b). Would the LVM in LVM cause problems with performance, or something else that I'm not anticipating?

What setup do you use, and why?


"easiest to manage" is very relative - you just as well use file-based disk images and it would be ... simple - at least for a few guests.

Still, i would say option 2 is fine, though using LVM in the domU is completely optional. Of course, if you plan on expanding the LVs for the domUs later, having them use LVM will make things easier.

That i know of, there are no performance issues with having LVM in the domUs (it's not LVM inside LVM, its LVm inside Xen...)

  • I just created an LV in the dom0, then presented it as a full disk to the domU. I installed Linux in the domU, and create a LVM setup on the virtual disk. Therefore, I have a VG inside an LV (or IOW, LVM inside LVM). – Swoogan Sep 21 '09 at 21:15

I go with option 2a in most cases and create just two partitions in the DomU (/ and /var). In some cases I use a third partition either directly (/opt or /home) or I set that one up as PV within the DomU.

It depends on what your DomU has to do and how flexible you want your file-system.

Resizing the last partition is no big deal. Resizing other partitions is tricky.

Option 1 will require a reboot of you Dom0 if that disk is in use and you want a new partition. And it is not very flexible.

Option 3: I use that one as an ad-hoc-addon to solution 2. So my permanent system/application resides on the first LV/Disk create with Option 2a/b and additional space is created (and removed) using a LV that is passed as additional disk into the DomU.


The variants of 2 are best for complex machines (that sort of mimics traditional physical machines with multiple roles).

However, one of the big advantages with virtual machines is that you no longer need to have multi-role machines. Instead, you can have several very simple machines with exactly one role each.

If you go to the extreme, the answer is none of the above. If you want to be extreme, you create a master image and then each VM gets a read/write snapshot of that master as its root partition. With this design, plus a little creative scripting using a dhcp server and cfengine/puppet, you can create and start a virtual machine in under 15 seconds.


i have use fully Virtualization guest on LVM and paraVirtualization on .xm and .img managing all guest and taking backup all the best way to that is LVM as JCINACIO say


I ended up going with 2(b). It seems to be the most flexible and I don't notice any performance penalty. I can resize partitions in both the host and the guest, and I can easily do backups.




  • there's no Dom0 support on FreeBSD
  • there are a couple of the annoying bugs in OpenSolaris. however they're not critical so if you don't care, try using it.

same, the 2b option. you just export the lvm from the DomGuest in the DomU as a new partion and then its mounted as a new partition. if you use a /var or something just for your data then ure saved. almost :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.