unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: guix-devel@gnu.org
Subject: Re: fstrim and SSDs and cron; was: Re: cron-service
Date: Wed, 18 May 2016 11:50:46 +0300	[thread overview]
Message-ID: <20160518085046.GB13276@debian-netbook> (raw)
In-Reply-To: <20160518072118.6039bd22@scratchpost.org>

[-- Attachment #1: Type: text/plain, Size: 2472 bytes --]

On Wed, May 18, 2016 at 07:21:18AM +0200, Danny Milosavljevic wrote:
> > I had never thought of it, but maybe it’s a good idea.  How do other
> > distros handle it?
> 
> On <https://askubuntu.com/questions/18903/how-to-enable-trim> they say:
> >Ubuntu 14.10 onwards:
> >In Ubuntu 14.10 and 15.04, TRIMming happens automatically every week on all SSDs supported by fstrim.
> >$ tail -n1 /etc/cron.weekly/fstrim 
> >/sbin/fstrim --all || true
> 
> 
> 
> 
> >Automatic TRIM (Deprecated, Slow):
> > [fstab...]
> 
> >Encrypted Filesystems
> >The last step is not enough though. As long as LUKS is not aware that you want to use TRIM it will effectively block all TRIM operations coming from the LVM partition's file system, for security reasons. Add discard parameter to the cryptdevice options in /etc/crypttab to make LUKS accept the discard behavior of the LVM partition.
> >sda5_crypt UUID=e364d03f-[...]6cd7e none luks,discard
> 
> More info about the latter:
> 
> http://blog.neutrino.es/2013/howto-properly-activate-trim-for-your-ssd-on-linux-fstrim-lvm-and-dmcrypt/
> 
> Note that guix /gnu/store/8vg9124cgm8d36zsy9ldcw53b1vrfy2w-lvm2-2.02.109/etc/lvm/lvm.conf explicitly disables (!) "discard".
> 

I have an SSD in my netbook, and I've had it a bit more than 4 years
now. According to the smart data, it's been powered on for ~18,000
hours, and recently I saw the drive life percentage used counter tick
from 2 to 3%, somewhere around 90 full disk writes.

When changing data:
Read block A, Write block B.

With "dirty" block B:
Read block A, Scrub block B, Write block B.

Trim goes and scrubs all the now unused blocks so that they're ready for
use. In many cases (aka not my machine, which is cpu bound on
reads/writes) reading/writing to an SSD is limited by the SATA port's
speed and the HDD based protocol. By trimming regularly (for me
somewhere between weekly and monthly) you can save the bandwidth-limited
transactions to the SSD for actual writes if you trim ahead of time.

If we wanted to automatically trim for people without making mcron and
its service part of %base-packages or %desktop-services we could add it
as a hook before/after a `guix pull', but that seems too intrusive to
me.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-05-18  8:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-30 17:27 cron-service Danny Milosavljevic
2016-05-01 13:14 ` cron-service Ludovic Courtès
2016-05-17 17:28   ` fstrim and SSDs and cron; was: cron-service Danny Milosavljevic
2016-05-17 21:24     ` Ludovic Courtès
2016-05-18  1:56       ` Thompson, David
2016-05-18  5:09         ` Danny Milosavljevic
2016-05-18  5:21       ` Danny Milosavljevic
2016-05-18  8:50         ` Efraim Flashner [this message]
2016-06-23  8:18     ` mcron service Ludovic Courtès
2016-06-24  5:59       ` Danny Milosavljevic
2016-06-24 12:00         ` Ludovic Courtès
2016-06-24 14:18           ` Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160518085046.GB13276@debian-netbook \
    --to=efraim@flashner.co.il \
    --cc=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).