Hi there,
I recently tried restoring a 512GB ssd dd compressed image to a 256GB. The proxmox can boot up, but the lvm volumns can't be mounted.
Then I used gdisk to delete and create the lvm partition to the smaller size, now the proxmox can at least recongize the lv. However when I tried to resize the lv filesystem size it doesn't work, seems the empty lv space have been pre-allocated.
Probably I should shrink the partition and filesystem first, then do a dd (if dd method is still the way to go)
p.s. found this one should be helpful:
https://blog.sensecodons.com/2017/03/shrinking-disk-to-migrate-to-smaller-ssd.html
update: unfortunately lvm-thin cannot be shrinked. A new thin-pool has to be re-created.
update2: I successfully do a 512GB->256GB 'migration', it's not smooth, watch out the bump:
1. after dd the 512GB img to the 256GB SSD, use
gdisk
to delete the lvm partition and then re-create a smaller one, watch out keeping the same UUID of the partition.
2.
Code:
lvremove /dev/pve/data
lvcreate -L 179G -n data pve
# 179G is calculated from lsblk the remaining after deducting pve-swap and pve-root on nvme0n1p3
lvconvert --type thin-pool pve/data
pvresize /dev/nvme0n1p3
reboot
from here the proxmox should recongnize the lvm-thin but nothing there.
3. cp the backup (.zst) to the new ssd's /var/lib/vz/dump/ , remove the old vms, restore the zst backup.
Done!