[linux-lvm] migrating a thick LV to a thin LV

Paul B. Henson henson at acm.org
Wed Mar 12 00:01:55 UTC 2014


I'm looking at converting a system to using thin provisioning, and have a
handful of existing fixed size LV's I want to migrate to the thinpool.
Ideally, after the migration they would also be thinly provisioned, only
taking up the amount of space they are actually using, not their existing
size. All of them have ext4 filesystems on them.

One option would be to use resize2fs to shrink the filesystems down to their
bare minimum, resize the existing LV to that, dd it onto a thin LV of the
original size, and then run resize2fs again to bring the filesystem back to
full capacity without any blocks wasted.

However, I was wondering if I just dd'd the existing LV onto a thin LV of
the same size, and then ran fstrim, would that release the unused space? I
see that thin pools support passing down discards to the underlying device,
but it's not clear whether they also process them internally, freeing up
space in the thinpool that is no longer in use by the thin LV.

Any thoughts?

Thanks.





More information about the linux-lvm mailing list