Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#41818 - [lvm2] please consider using the default issue_discards = 1

Attached to Project: Arch Linux
Opened by need to rename username but can't, guess I'll create a new one then (m4cz3) - Thursday, 04 September 2014, 11:11 GMT
Last edited by freswa (frederik) - Friday, 03 April 2020, 17:10 GMT
Task Type Feature Request
Category Packages: Core
Status Assigned   Reopened
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No



maybe /etc/lvm.conf could have (by default) issue_discards = 1 seems safe because it says above:
# ... If set
# to 1, discards will only be issued if both the storage and kernel provide support.


Additional info:
* package version(s)
Name : lvm2
Version : 2.02.109-2
Description : Logical Volume Manager 2 utilities
Architecture : x86_64

* config and/or log files etc.

# This section allows you to configure which block devices should
# be used by the LVM system.
devices {
# Issue discards to a logical volumes's underlying physical volume(s) when
# the logical volume is no longer using the physical volumes' space (e.g.
# lvremove, lvreduce, etc). Discards inform the storage that a region is
# no longer in use. Storage that supports discards advertise the protocol
# specific way discards should be issued by the kernel (TRIM, UNMAP, or
# WRITE SAME with UNMAP bit set). Not all storage will support or benefit
# from discards but SSDs and thinly provisioned LUNs generally do. If set
# to 1, discards will only be issued if both the storage and kernel provide
# support.
# 1 enables; 0 disables.
issue_discards = 0

Steps to reproduce:
pacman -S lvm2
This task depends upon

Comment by Thomas B├Ąchler (brain0) - Thursday, 04 September 2014, 16:14 GMT
So, IIRC the history is that issue_discards used to be experimental and broken, resulting in data loss, since it deleted the wrong parts of the hard drive. We should ask upstream why it is disabled by default.
Comment by Konstantin Gizdov (kgizdov) - Friday, 01 April 2016, 11:54 GMT
Just noticed this. I would like to voice my opinion against this being implemented. Discards by default are bad for encrypted volumes. Also, it is generally a better option to use a scheduled systemd service to trim the drive, as on-the-go LVM discards can be bad for data recovery for example.
Comment by nl6720 (nl6720) - Friday, 03 April 2020, 17:10 GMT
  • Field changed: Percent Complete (100% → 0%)
This is still an issue.
issue_discards = 1 is useful on thin provisioned logical volumes (regardless of the underlying disk hardware).