Bug#717313: lvm2: Enable issue_discards = 1 automatically on non-rotational (SSD) disks?

Martin Pitt martin.pitt at ubuntu.com
Fri Dec 13 10:04:13 UTC 2013


tag 717313 patch
thanks

Petter Reinholdtsen [2013-07-19 10:43 +0200]:
> According to several recipes on how to set up Linux on a SSD disk, LVM
> need to be reconfigured to issue discard (aka TRIM) instructions to the
> underlying storage device.  This is done by modifying /etc/lvm/lvm.conf
> and setting issue_discards = 1 in the devices section.
> 
> Why not set the option automatically when the underlying device is not
> rotational?

The documentation says that the option has no effect if the kernel or
the drive don't support it, so I don't see why we shouldn't just
enable this by default?

I attach the Ubuntu debdiff for reference, although it's fairly
trivial.

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
diff -Nru lvm2-2.02.98/debian/changelog lvm2-2.02.98/debian/changelog
--- lvm2-2.02.98/debian/changelog	2013-09-16 11:48:04.000000000 +0200
+++ lvm2-2.02.98/debian/changelog	2013-12-13 10:52:23.000000000 +0100
@@ -1,3 +1,13 @@
+lvm2 (2.02.98-6ubuntu2) trusty; urgency=medium
+
+  * Add enable-issue-discards.patch: Enable "issue_discards" option by default
+    to trim SSDs when changing PVs. This option has no effect if the kernel or
+    the drive does not support trimming, so it's safe to enable by default.
+    [https://blueprints.launchpad.net/ubuntu/+spec/core-1311-ssd-trimming]
+    (Closes: #717313)
+
+ -- Martin Pitt <martin.pitt at ubuntu.com>  Fri, 13 Dec 2013 10:51:54 +0100
+
 lvm2 (2.02.98-6ubuntu1) saucy; urgency=low
 
   * Merge from Debian unstable, remaining changes:
diff -Nru lvm2-2.02.98/debian/patches/enable-issue-discards.patch lvm2-2.02.98/debian/patches/enable-issue-discards.patch
--- lvm2-2.02.98/debian/patches/enable-issue-discards.patch	1970-01-01 01:00:00.000000000 +0100
+++ lvm2-2.02.98/debian/patches/enable-issue-discards.patch	2013-12-13 10:51:47.000000000 +0100
@@ -0,0 +1,20 @@
+Description: Enable "issue_discards" option by default
+ to trim SSDs when changing PVs. This option has no effect if the kernel or the
+ drive does not support trimming, so it's safe to enable by default.
+ See also https://blueprints.launchpad.net/ubuntu/+spec/core-1311-ssd-trimming
+Author: Martin Pitt <martin.pitt at ubuntu.com>
+Bug-Debian: http://bugs.debian.org/717313
+
+Index: lvm2-2.02.98/doc/example.conf.in
+===================================================================
+--- lvm2-2.02.98.orig/doc/example.conf.in	2013-12-13 10:43:03.000000000 +0100
++++ lvm2-2.02.98/doc/example.conf.in	2013-12-13 10:49:09.471664140 +0100
+@@ -196,7 +196,7 @@
+     # to 1, discards will only be issued if both the storage and kernel provide
+     # support.
+     # 1 enables; 0 disables.
+-    issue_discards = 0
++    issue_discards = 1
+ }
+ 
+ # This section allows you to configure the way in which LVM selects
diff -Nru lvm2-2.02.98/debian/patches/series lvm2-2.02.98/debian/patches/series
--- lvm2-2.02.98/debian/patches/series	2013-09-16 11:22:10.000000000 +0200
+++ lvm2-2.02.98/debian/patches/series	2013-12-13 10:48:28.000000000 +0100
@@ -8,3 +8,4 @@
 dm-event-api.patch
 monitoring-default-off.patch
 missing-dmeventd.patch
+enable-issue-discards.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-lvm-maintainers/attachments/20131213/97156455/attachment.sig>


More information about the pkg-lvm-maintainers mailing list