Re: lvremove does not pass discards if volume is part of thin pool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all again,

I will answer one of my questions myself as I just found the answer:

On Fri, Jan 22, 2016 at 06:18:29PM +0100, Tomas Janousek wrote:
> 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. :-(

This hack with dd if=/dev/zero works indeed, but there's a tool called
blkdiscard in util-linux which works much better. I just call it prior to
lvremove (or lxc-destroy in my case) and the space is freed.

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

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/




[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux