[ale] Xen Image

Kenneth Price neth.price at gmail.com
Wed Oct 29 11:47:16 EDT 2008

2008/10/29 Brandon Colbert <colbert.brandon at gmail.com>

> The image that contain the guest? yes para-virtualized. No LVM. There is
> plenty of space.
> I wonder if I can can create a larger image file, and then dd the other
> guest.img to the new image file.
Yes you can, but then you must resize the partitions and filesystems.  If
you simply want to add space to the existing image you can do the
following.  This is not a copy/paste guide, but should give you a general
idea of the process.

Add, for example, 2Gb:
#>  dd if=/dev/zero count=2 bs=1G >> /var/lib/xen/images/xenguest.img
OR this should work too:
#>  dd if=/var/lib/xen/images/oldimage.img
of=/var/lib/xen/images/xenguest.img bs=1024 (where xenguest.img is an
existing, larger image)

Mount the image:
#>  xm block-attach 0 'file:/var/lib/xen/images/xenguest.img' xvda w

Show the partitions and verify filesystem integrity:
#>  fdisk –lu /dev/xvda
#>  e2fsck –f /dev/xvda2 (assuming dev/xvda2 is your filesystem partition)

Using the program "parted", follow the instructions for resizing the
partitions/filesystem (type help and look at "resize"):
#> parted /dec/xvda

Verify the filesystem integrity and resize the filesystem:
#>  e2fsck –f /dev/xvda2
#>  resize2fs /dev/xvda2

Detach the device/image:
#>  xm block-list 0 (Find the device ID)
#>  xm block-detach 0 "DEVICE_ID_HERE" –f

The end.  :-)

Hope this helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20081029/c94d6a5d/attachment.html 

More information about the Ale mailing list