[linux-lvm] lvremove does not pass discards if volume is part of thin pool

Tomas Janousek tomi at nomi.cz
Fri Jan 22 17:18:29 UTC 2016

Hello all,

On Wed, Aug 19, 2015 at 01:40:08PM +0300, vaLentin chernoZemski wrote:
> I just tested my case with LVM2.2.02.128 with the latest kernel 4.1.6 and it
> still does not work.
> [...]
> Let me know if you need anything else that could help us debug this issue
> and fix it.

Has there been any progress here? I'm experiencing the same issue here with
kernel 4.4.0 and lvm:

lvm> version
  LVM version:     2.02.138(2) (2015-12-14)
  Library version: 1.02.114 (2015-12-14)
  Driver version:  4.34.0

Is there perhaps some way to force the discard manually? I thought that maybe
creating a new sparse file/loop device/physical volume and doing pvmove might
help, but what I got instead was a file that wasn't sparse at all, actually
taking more space than the original one. Is this expected?
(The only explanation I can think of is that pvmove doesn't care nor
understand the on-disk format of device mapper thin-pools so it has to copy
everything byte by byte. Is that it?)

Maybe creating a sufficiently large volume in the thin pool, doing a dd
if=/dev/zero of=/path/to/volume/tmp/blanks and then deleting
/path/to/volume/tmp/blanks would help, but could be quite slow. :-(

Tomáš Janoušek, a.k.a. Pivník, a.k.a. Liskni_si, http://work.lisk.in/

More information about the linux-lvm mailing list