I aim to gather all associated knowledge in this post.
- BIOS/UEFI
Enable Advanced Host Controller Interface (AHCI) for SATA
Enable SATA Gen 3 if your SSD is compatible
Does a default Debian install take care of necessary configurations required or recommended for an SSD?
- Overprovisioning: unallocated space at the end of the disk to improve performance and life expectancy. Some SSDs may already be overprovisioned by the manufacturer, and the unallocated space cannot be accessed or controlled by the user. Does the Debian install process detect manufacturer overprovisioning, and if not detected does it leave appropriate unallocated space (circa 7%) at the end of the disk?
Additional overprovisioning using Host Protected Area (HPA) can be set and viewed using hdparm, but this is deemed very dangerous so caution is advised.
- Write Cache: reduce disk writes by caching data into chunks before writing to disk. Is write cache automatically set if SSD detected?
View status:
Code: Select all
$ hdparm -W /dev/sda
/dev/sda:
write-caching = 1 (on)
Code: Select all
$ hdparm -W1 /dev/sda
/dev/sda:
setting drive write-caching to 1 (on)
write-caching = 1 (on)
Adjust Swappiness, to 0 if plenty of memory available, or circa 10 if a more modest amount of memory is available:
Code: Select all
sudo nano /etc/sysctl.conf
Code: Select all
# Reduce Swap wear on SSD
vm.swappiness=10
Apply new swappiness setting:
Code: Select all
sudo sysctl -p
Disable Access Time Logging:
Code: Select all
sudo nano /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda2 during installation
UUID=3ff45354-9769-4b6a-b861-bab7160da035 / ext4 noatime,errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=5317-83C5 /boot/efi vfat umask=0077 0 1
# swap was on /dev/sda3 during installation
UUID=78942381-33c1-44e8-8257-9b414d14d194 none swap sw 0 0
In this example noatime is added to the options for root (/).
(You should not set noatime for boot/efi or swap partitions)
Save and close: Ctrl+X, then S, then Return
- Enable Daily/Weekly TRIM: to ensure SSD speed remains fast over time: Is a daily/weekly (documentation varies on which is best for SSDs) TRIM automatically set if SSD detected?
To enable daily/weekly TRIM using CRON (if not already present):
Save the following script as fstrim in either the /etc/cron.weekly/ or /etc/cron.daily/ folder
Code: Select all
#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true
Thank you.