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

Bug#690977: partman-auto: Add a way to add "discard" option to filesystems



Hey all,

Petter Reinholdtsen [2013-08-12 13:04 +0200]:
> Hi.  Instead of adding discard as a mount option in fstab, perhaps it
> is better to add a cron job calling fstrim regularly?

Colin King did some rather extensive benchmarks, and we found that on
desktops/servers this is indeed the preferrable default.
https://blueprints.launchpad.net/ubuntu/+spec/core-1311-ssd-trimming
(I also have the detailled spreadsheets and percentage numbers if
anyone is interested)

>    * Set up cryptsetup to pass TRIM commands to the physical disk
>      (adding discard to /etc/crypttab)

That's "allow-discards" for the record. It's off by default as the
cryptsetup authors consider it a potential information leak. I. e. on
the physical drive you can map the "used/free" blocks and from their
patterns infer the file system type and from their ratio infer how
full the file system is. IMHO that's a very small price to pay for
keeping your SSD usable in the first place (and yes, I consider
reducing write performance from 250 MB/s to 5 MBs/ "useless", each
bigger I/O operation completely hangs the computer). If you are
worried about that kind of data leak, you would use a
hardware-encrypted hard drive anyway, and no cryptsetup.

>    * Set up LVM to pass on TRIM commands to the underlying device (in
>      this case a cryptsetup partition) by changing issue_discards from 0
>      to 1 in /etc/lvm/lvm.conf.

That's orthogonal to discard/fstrim, but should be done anyway. That's
http://bugs.debian.org/717313 .

>    * Set relatime as a file system option for ext3 and ext4 file systems.

Agreed (good installer default on rotational drives, too!)

>    * Run fstrim on every ext3 and ext4 file system every night (from
>      cron.daily).

I just filed http://bugs.debian.org/732054 with a proposed cron job,
review/comments appreciated!

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

Attachment: signature.asc
Description: Digital signature


Reply to: