I have an issue here (the purple screenshot is from when I am booted in an ubuntu live iso) and I am unable to fix it but as you can see the device /dev/sda is 414G (the dark black is in proxmox terminal before converting the qcow2 image to raw for resize), but I want to get rid of the unallocated ~142G (shown in the gparted screenshot) and take it down to around 260-270G. It's a qcow2 image and whenever I convert it to raw and resize, the data becomes unreadable.
-proxmox terminal screenshot (host)-
-ubuntu live iso terminal (guest)-
-gparted ubuntu live iso (guest)-
So far my steps are the following:
Before doing any of these I resized the lvm with lvresize etc... you can see from the screenshots
1.
2.
If this step of resizing actually worked I would reduce it to around 272G or so with "qemu-img resize vm-101-disk-0.raw --shrink 272G" and proceed to the next step below, but it doesn't and when I try to check the raw image with parted,
like so
it says "Error: end of file while reading /var/lib/vz/images/101/vm-101-disk-0.raw" -this works fine before the resize occurs
(If the 2nd step worked I would do this next)
I did try the 3rd step and when I boot into a live iso and try to check the partitions while having the qcow2 image mounted, it shows no partitions, further reinforcing my theory that something gets corrupted after resizing.
If someone could please help me I would appreciate it, I need to make space to add a new VM and I can't unless I can manage to reclaim the unallocated space within this qcow2 image successfully.
-proxmox terminal screenshot (host)-
-ubuntu live iso terminal (guest)-
-gparted ubuntu live iso (guest)-
So far my steps are the following:
Before doing any of these I resized the lvm with lvresize etc... you can see from the screenshots
1.
Code:
qemu-img convert -p vm-101-disk-0.qcow2 vm-101-disk-0.raw
Code:
qemu-img resize --shrink vm-101-disk-0.raw -- -1G
like so
Code:
parted -m vm-101-disk-0.raw print | tail -n +3 | awk -F ":" '{print $(NF-2)}'
it says "Error: end of file while reading /var/lib/vz/images/101/vm-101-disk-0.raw" -this works fine before the resize occurs
(If the 2nd step worked I would do this next)
Code:
qemu-img convert -p -O qcow2 vm-101-disk-0.raw vm-101-disk-0.qcow2
If someone could please help me I would appreciate it, I need to make space to add a new VM and I can't unless I can manage to reclaim the unallocated space within this qcow2 image successfully.
Last edited: