up vote 2 down vote favorite
2
share [g+] share [fb]

Is it possible to increase the size of an existing virtual server image (centos 5 guest on centos 5 host - Xen)? I just installed a new guest, and found out that I did not assign enough storage to the guest at install time.

I know I can add virtual storage by mounting to the virtual system, but I would really like to keep the system as simple as possible (one mounted device - one image file per system).

So, is it possible to increase the storage of an image in an existing system, or am I going to have to start over again?

link|improve this question

75% accept rate
feedback

1 Answer

up vote 2 down vote accepted

here is a nice step-by-step guide. but one addition to it:

instead of using

dd if=/dev/zero of=/xen/client8xen.img bs=1M seek=10000 count=5000

you can also use

dd if=/dev/zero bs=1M count=5000 >> /xen/client8xen.img

to add the extra space without finding the exact end of your image.

link|improve this answer
Don't you have to reformat the image than? Because the filesystem of the VM does not know about the new size? It seems like dd a smaller drive to a bigger drive which also does not increase the partion size. But I guess you could use something like gparted afterwards so resize the partion. – SideShowCoder Feb 11 '10 at 10:16
you don't have to reformat the drive. the tutorial uses pvresize. – Christian Feb 11 '10 at 10:41
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.