Resizing online virtual machine XFS partitions

General support questions
Post Reply
lingling
Posts: 3
Joined: 2014/11/12 21:05:16

Resizing online virtual machine XFS partitions

Post by lingling » 2014/11/27 02:24:10

Basically, I'm under the impression that I should be able to resize a live virtual machine's root (XFS) partition.

Currently, the only way I've found to extend a root partition is involved powering it off.

The procedure, which I'll outline, still has its problems.

So first, I power OFF the vm. Then on the host machine I resize the underlying logical volume using lvextend. I then start up the vm, and use fdisk to create and destroy the root partition (there is no LVM inside the vm, just XFS). This gives me what seems like a more or less "correct" error of "Re-reading partition table failed error 16: device or resource busy". Fair enough. I then use xfs_growfs on the root partition and it seems to function fine. So then I use partprobe, which just tells me the kernel hasn't been informed and I should reboot in order to update the partition table. Ok, so I reboot and everything is kosher. As is, there is no visible advantage over using virt-resize or any other offline vm tool.

It eventually gets the job done, but it doesn't seem correct. I'm not exactly a pro at this. I'm just studying for the RHCSA, and this is something I've kind of hit a brick wall on.

Post Reply