Have done it twice, with slightly smaller (50-100mb?) NVME's & had no problem. Usually just the end will get truncated, which shouldn't really contain anything, assuming you started with an empty NVME for the original PVE install & hardly use the PVE OS disk for storage - as is my use case.
I find using an NMVE only to about 30 % of its capacity, greatly improves its longevity (as in years). This I believe is most cost-effective.
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!