Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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.

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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