I have 2 disks from an old VM I'd like to backup just in case. The first disk is a 1TB disk and has 2 partitions of 500GB. The second disk is a 30GB disk with a partition taking all the space.
First thing I did was to sdelete the 3 partitions, then boot on gparted iso and shrunk every partition to real used size +1GB. Now the first disk is a 1TB disk file, with 2 contiguous 100GB partitions and 300GB of unallocated space. The second disk is 30GB with 1 partition of 3GB and 27GB of unallocated space.
I would like to shrink these disks. I'm testing with the 30GB disk, converting it from vmdk to qcow2 kept it as a 30G disk but it occupies 5G now (ls -lsh). Then I still wanted to shrink the virtual disk, so I tried "qemu-img resize file.qcow2 10G" and even converting it to raw and resizing it, but when booting to gparted the filesystem appeared corrupted. I thought cropping unallocated space shouldn't be an issue...
Is it possible to shrink these disks without ultimately having to create a smaller disk and dd from the first to the other?
First thing I did was to sdelete the 3 partitions, then boot on gparted iso and shrunk every partition to real used size +1GB. Now the first disk is a 1TB disk file, with 2 contiguous 100GB partitions and 300GB of unallocated space. The second disk is 30GB with 1 partition of 3GB and 27GB of unallocated space.
I would like to shrink these disks. I'm testing with the 30GB disk, converting it from vmdk to qcow2 kept it as a 30G disk but it occupies 5G now (ls -lsh). Then I still wanted to shrink the virtual disk, so I tried "qemu-img resize file.qcow2 10G" and even converting it to raw and resizing it, but when booting to gparted the filesystem appeared corrupted. I thought cropping unallocated space shouldn't be an issue...
Is it possible to shrink these disks without ultimately having to create a smaller disk and dd from the first to the other?
Last edited: