Bug#717313: lvm2: Enable issue_discards = 1 automatically on non-rotational (SSD) disks?
Laurent Bigonville
bigon at debian.org
Sun Aug 6 10:43:29 UTC 2017
Le 06/08/17 à 10:50, Bastian Blank a écrit :
> On Sun, Aug 06, 2017 at 09:16:55AM +0200, Petter Reinholdtsen wrote:
>> A while back, I created a deb named ssd-setup to automatically set up Debian for
>> a SSD disk. Until I understand more about the LVM issue, I automatically
>> enable issue_discards=1 in
>> <URL: https://anonscm.debian.org/cgit/collab-maint/ssd-setup.git >. But
>> is this a bad idea or simply useless?
> In general it is a bad idea.
>
> Let's take a look again at the current text in lvm.conf regarding this
> option:
> | Issue discards to PVs that are no longer used by an LV. Discards are
> | sent to an LV's underlying physical volumes when the LV is no longer
> | using the physical volumes' space, e.g. lvremove, lvreduce. Discards
> | inform the storage that a region is no longer used.
>
> So this only triggers if you do operations that change the LV itself.
> It however does _not_ effect the use of discards during the normal
> operation of a filesystem.
>
> However it comes with a large drawback, not counting the bugs in the
> discard handling itself: Even with the automatic backups of the lvm
> metadata, it is impossible to recover from the wrongly removed LV. This
> is the reason why this feature is off by default.
The discards commands will also be issued when shrinking or moving a LV
to an other PV, if something is going wrong during these operations, the
data will be lost.
So it's not only when explicitly removing an LV.
More information about the pkg-lvm-maintainers
mailing list