Expanding xen disk file image
May 10, 2009, 2:10 pm
Filed under: Linux
Filed under: Linux
If you run out of diskspace on a xen virtual machine (guest), it’s quite easy to expand the image file. I stole this receipt from here, just to make sure that I have a copy in case his/her website goes offline:
1. Stop the virtual server that is using the loop filesystem
2. Add some extra space to your loop filesystem file
# dd if=/dev/zero bs=1024k count=1024 >> loop_image_file
This adds 1GB to the end of a file called loop_image_file (make sure to use the append output redirector >> not a single >, otherwise you’ll have an empty 1GB file!)
3. Force a check on the resized/increased filesystem
# e2fsck -f loop_image_file
4. Resize the filesystem within the loop filesystem file
# resize2fs loop_image_file
5. Start the virtual server again
1 Comment
