How to get a Xen domU to notice a change in the block size of one of its phy devices

blockdomuxen

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?)

Best Answer

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