Thursday, February 28, 2008

Resizing qemu image

Qemu uses its own type of file which is qcow that stands for Qemu Copy On Write. Sometimes after you have setup the image, you suddenly find that you need more space. Below are the proven steps on how you can add more space to your image.

  1. Convert qemu image to raw
    • # qemu-img convert -f qcow imagename -O raw imagename.raw
  2. Extend the image size using dd (In this example, to the size of 10G)
    • # dd bs=1 if=/dev/zero of=/path/to/imagename.raw seek=10G count=1 conv=notrunc
  3. Convert back to qemu image
    • # qemu-img convert -f raw imagename.raw -O qcow imagename
  4. Partition the extra disk space you have created using parted
That's all folk

1 comment:

  1. AnonymousJune 25, 2011

    after qemu-img convert -f raw imagename.raw -O qcow image.qvc

    image size srink to 9GB

    ReplyDelete