2

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?

Powertieke
  • 377
  • 2
  • 8

1 Answers1

2

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.

Christian
  • 4,703
  • 2
  • 24
  • 27
  • 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