Resize disk

Inferno

Member
Mar 31, 2012
6
0
21
Hi

I'd like to resize the raw disk from 50GB to 20GB. (VM OS - Linux)
I shutdown the VM, then I resize zith command:
qemu-img resize diskimage.zzz -- -30G

Then I try to start the VM, it starts but only in grub command line, so there is something bad zith partation or so...

How can I do it correctly? Maybe I forgot something?

Thanks.
 
I think you must resize the filesystem inside your VM before resize the disk.

Now your VM continues with a filesystem with 50GB but the disk was shrink to 20GB, so I think you lose info/partitions.
 
I think you must resize the filesystem inside your VM before resize the disk.

Now your VM continues with a filesystem with 50GB but the disk was shrink to 20GB, so I think you lose info/partitions.
Right,
resize filesystem inside VM (boot an live-cd like partition magic or grml). Then resize the partition inside the VM and after that, you can shrink the "real" VM-disk.

To expand an disk vice versa.

Udo