Shrink RAW disk

Esben Viborg

Member
Oct 12, 2017
22
0
6
40
Hi

When i had to increase a disk in one of my VMs i accidentally hit '0' twice, so instead of increasing the disk with 40gb, I increased it with 400gb :S

Is it possible to shrink a RAW in size?
 
Hi,
it is possible although comes with some risks! If you already increased the file system and/or added new partitions on the disk you might loose data.
Only if you know what you are doing you can reduce the size with qemu-img. See the section for resize in the `man qemu-img` man page.