2008/10/29 Brandon Colbert <span dir="ltr"><<a href="mailto:colbert.brandon@gmail.com">colbert.brandon@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The image that contain the guest? yes para-virtualized. No LVM. There is plenty of space.<br><br>I wonder if I can can create a larger image file, and then dd the other guest.img to the new image file. <br><div><div></div>
<div class="Wj3C7c"><br></div></div></blockquote></div><br>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.<br>
<br>Add, for example, 2Gb:<br>#> dd if=/dev/zero count=2 bs=1G >> /var/lib/xen/images/xenguest.img<br>OR this should work too:<br>#> 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)<br>
<br>Mount the image:<br>#> xm block-attach 0 'file:/var/lib/xen/images/xenguest.img' xvda w<br><br>Show the partitions and verify filesystem integrity:<br>#> fdisk –lu /dev/xvda<br>#> e2fsck –f /dev/xvda2 (assuming dev/xvda2 is your filesystem partition)<br>
<br>Using the program "parted", follow the instructions for resizing the partitions/filesystem (type help and look at "resize"):<br>#> parted /dec/xvda<br><br>Verify the filesystem integrity and resize the filesystem:<br>
#> e2fsck –f /dev/xvda2<br>#> resize2fs /dev/xvda2<br><br>Detach the device/image:<br>#> xm block-list 0 (Find the device ID)<br>#> xm block-detach 0 "DEVICE_ID_HERE" –f<br><br>The end. :-)<br><br>Hope this helps,<br>
Ken<br><br>