Moving a LVM Partition from Proxmox to VMWare, lvdisplay mapped size changed, why?
Solution 1:
Previously, the LV was created using a thin or sparse volume, which only allocates the blocks that have been written to, so the volume only occupies that much space in the volume group. When you write the 20 GB image back to the LV, then you have written 100% of the blocks (even the blocks that were all zeroes) so now the entire 20GB must be allocated in the volume group.
I think you can use dd_rescue -a
to put the file back into a logical volume without writing the full 20GB. The -a flag is for writing a sparse file where blocks that are all zeroes are skipped and not written to disk. You will want the -b
block size flag to match the "PE Size" shown by vgdisplay
(eg -b 4M
) so something like
dd_rescue -a -b 4M vm-000-disk-1-flat.vmdk of=/dev/pve/vm-101-disk-1
The GNU ddrescue
program uses the -S
flag instead for sparse mode.