Howto resize Xen disk images

This is pretty easy. First of all you have to shutdown the affected domain, the change to the right place in your filesystem, create an empty file (here 1GB), append it to the existing disk image and finaly resize the filesystem:

cd /home/xen/domains/foo
dd if=/dev/zero of=Tmpfile bs=1024 count=1000000
cat Tmpfile >> disk.img
resize2fs -f disk.img

Done. You can now startup your domain.

Verwandte Artikel

  • No Related Post
Leave a comment

6 Comments.

  1. you may even shorten that. And you don’t need that much diskspace.

    cd /home/xen/domains/foo
    dd if=/dev/zero bs=1024 count=1000000 >> disk.img
    resize2fs -f disk.img

  2. Futter für Google?

  3. self nomination for useless-use-of-cat-award and (of course) google

  4. I think to “cat” a file on original img can avoid resize the original smaller accidently.

  5. @ lemming,
    was meinst du mit Google Futter? Hat doch mit VHCS garnichjt mehr zu tun.

  6. Wo liest Du hier etwas über VHCS?