Am Dienstag, 29. Dezember 2009 14:07 schrieb Laurent Coustet: > Hi, > > I just wrote a small python script that helps resizing a QCow2 image > without rewriting it. > > I'm sure that's not the correct way to do it, but it seems to work well. > > Beware this script DO NOT SUPPORT SHRINKING !! It do not check any error > case, so; use at your own risks !
You need to really resize the L1 table and not just extend the l1_size in the qcow2 header. And don't use the script with snapshots. VM state is saved after the end of the virtual disk, so if you extend the disk it might overlap the VM state (you would need to move the VM state to make it safe with snapshots). The right way would be a patch to qemu rather than an external python script anyway. Doing it correctly would probably even be easier this way because things like a function for growing the L1 table already exist. Kevin