View Full Version : [other] Xen: Modify disk image size after creation?
Jekshadow
December 21st, 2009, 05:09 AM
I am running a Xen server, and I had created a VM for rendering large scenes, but now I realize that I need some more disk space in the instance. Is there any way to increase the size of a disk image once it is created. I formatted the image as qcow2.
xOrphenochx
December 21st, 2009, 08:58 AM
I am running a Xen server, and I had created a VM for rendering large scenes, but now I realize that I need some more disk space in the instance. Is there any way to increase the size of a disk image once it is created. I formatted the image as qcow2.
I had this same question awhile back after I was plagued with the winsxs folder on one of my test servers. Simple answer was no. What I ended up doing was using LVM to manage my VM's disks. It's a little bit more work, but more managable
geekshlby
December 21st, 2009, 08:56 PM
1. Create a backup
2. Convert the disk image from qcow2 to raw.
qemu-img convert -f qcow2 -O raw diskqcow2.img diskraw.img
3. Create a file containing all zeros.
dd if=/dev/zero of=zeros.img bs=1024 count=1000000 will create create an approximate 1GB file
4. Concatenate your new "disk" to your newly converted raw disk from step 1.
cat zeros.img >> raw.img Remember >> and not >
5. Resize the partition.
6. Resize the filesystem.
Jekshadow
December 23rd, 2009, 04:02 AM
1. Create a backup
2. Convert the disk image from qcow2 to raw.
qemu-img convert -f qcow2 -O raw diskqcow2.img diskraw.img
3. Create a file containing all zeros.
dd if=/dev/zero of=zeros.img bs=1024 count=1000000 will create create an approximate 1GB file
4. Concatenate your new "disk" to your newly converted raw disk from step 1.
cat zeros.img >> raw.img Remember >> and not >
5. Resize the partition.
6. Resize the filesystem.
This will really help, thanks.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.