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 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 אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted