I am using pvmove
to migrate LVM extents from one PV to another. It works like it should, however, the physical volumes are actually thin provisioned disks from two separate storage arrays. Both disks are 20G (5119 LVM extents), but the source disk had only 5GB of stored data on the storage array. After pvmove
is finished, the destination disk has 20GB used on the second storage array, eliminating the benefit of thin provisioning.
Can pvmove
be instructed to only copy the extents that have ever had data written to them? Does LVM even have that info, or is it just a side effect of the storage array allocating space on demand?
Some high end storage arrays are clever enough to see that the block is empty, and just acknowledge the io to the system without actually filling up the thin pool. Your array does not seem to be concerned.
You have 2 options to workaround your issue :
1/ use the
fstrim
command to give back unused blocks to the storage array (kind of post processing, when you launch the command)2/ mount your filesystems with the
-o discard
option (live processing). As soon as you delete a file (big enough), the block is given back to the array.