Bug#717313: lvm2: Enable issue_discards = 1 automatically on non-rotational (SSD) disks?
Zdenek Kabelac
zdenek.kabelac at gmail.com
Fri Feb 12 10:39:18 UTC 2016
On Sun, 20 Dec 2015 12:50:55 -0800 Matt Taggart <taggart at debian.org> wrote:
> I agree that "issue_discards = 1" should become the default in lvm on
> Debian.
>
> There is a case where you might not want TRIM/discards, there are security
> implications to enabling it with dm-crypt. In the commit message which
> added this support, the author states:
>
> Note that discard will be never enabled by default because
> of security consequences, it is up to administrator
> to enable it for encrypted devices.
>
Please CLOSE this BZ as not BUG - it's really a feature.
Using 'issue_discards=1' makes any lvremove operation 'irreversible' on
SSD - so using 'vgcfgretore' cannot then fix the mistake of admin when
he removes LV and he would like to get it back - since restoring TRIMED space
is just pointless.
So 'default' being 0 is carefully chosen!
If admin does know what he is doing he may switch it to 1 - but that's mostly
usable only if the provided storage is kind of 'provisioned' one.
On typical OS - if you release LV space in your VG and your next command
allocates this space for a new LV - then this LV is supposed to be
discarded!.
The initial BZ comment is misleading - as any new LV user - which typically is
the filesystem - runs blkdiscard on such LV (as might be checked by looking
at 'strace' of e.g. mkfs.ext4)
Also there is no shortage of SSD performance nor SSD lifespan as the firmware
in SSD is smarter and does the load balancing across whole device (so its
relocating blocks that are used too often...)
Regards
Zdenek
More information about the pkg-lvm-maintainers
mailing list