Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running lvm in my Xen domU, and I can increase the size of a logical volume on the fly, and inside the domU I can increase the size of the filesystem on the fly to the size of the domU's block device, but without restarting the domU I can't actually get the domU's block device's size to update when the size of the logical volume it's pointing at changes.

Anyone have a hint or a convincing workaround (one that makes sense on a box where there are multiple domUs?)

share|improve this question
Sorry, that's not very clear. I meant to say that I'm running LVM outside my domU and accessing a volume inside the domU via a phy: device. – rakslice Sep 16 '09 at 16:20
I recently found out that there used to be an xm subcommand "block-refresh", but it was removed a long time ago. I still don't know why it was removed. – rakslice Sep 16 '09 at 16:31
up vote 1 down vote accepted

I understand you are resizing an LV that is the block device of the DomU. I can't find any official answer to this but all my tests (Xen 3.2, Ubuntu Hardy) to make the guest recognize failed. My answer: Not possible.

Solution (copy and paste only with brain activated!):

  1. Dom0: sudo lvextend -L+10G /dev/vg/logical-volume
  2. Dom0: sudo xm shutdown -w the-domu
  3. Dom0: sudo xm create /etc/xen/the-domu.cfg
  4. DomU: sudo resize2fs /dev/xvda1
share|improve this answer

There's no real way that I know of, to rescan your disks in a domU without restarting the VM.

One solution that can be used, as you say you're using LVM in your domU's, is resizing the LV by attaching a new block device to the VM and resizing the Volume Group, instead of just resizing a current Physical Volume (PV).

Implementing that above scheme will allow you to attach new disks to the VM, "pvcreate" them and add them to the VG.

To avoid having many small attached disks, you can try adding a big block device that will also be able to cope with a "pvmove" on the VM. This will allow you to move data to the new block device, run a "vgreduce" and then detach to block device from the domU.

The downside, if you're also using LVM on your dom0, is a LVM->xvd->LVM chain. This will probably give you a small performance penalty, more complexity in managing and a non-trivial dom0 access to data in domU land (for backups, etc.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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