SSD

From YobiWiki
Revision as of 23:32, 22 March 2014 by <bdi>PhilippeTeuwen</bdi> (talk | contribs) (Created page with "==Resources== * http://www.linuxjournal.com/content/solid-state-drives-get-one-already ==TRIM== ===LUKS=== In /etc/crypttab, add the "discard" keyword for devices on SSDs: #T...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Resources

TRIM

LUKS

In /etc/crypttab, add the "discard" keyword for devices on SSDs:

#TargetName Device           KeyFile  Options
sda1_crypt  UUID=...         none     luks,discard 

LVM

In /etc/lvm/lvm.conf, add a line issue_discards = 1 in devices section:

devices {
        ...
        issue_discards = 1
        ..
}

initramfs

sudo update-initramfs -u -k all
shutdown -r now

Testing

On ext4 fs:

fstrim <mountpoint>

Should return silently if no error

Enabling

Automatically by the fs: add "discard" in options in /etc/fstab
Manually or via cron: run fstrim <mountpoint>

Partitioning

Make sure partitions are on a 512k boundary.
fdisk and LVM handle it properly.

Tuning

  • Add option "noatime" in /etc/fstab to avoid writes on SDD
  • Avoid swap on SSD
  • Avoid filling SSD, keep <80% for proper garbage collection and wear leveling
  • No RAID (as they have no TRIM support)
  • Bios: AHCI mode, not IDE emulation (slower, no TRIM)

Health

sudo smartctl -a /dev/<device>

"Media_Wearout_Indicator" => count down from 100 as the drive approaches the Flash wear limit