Open filakhtov opened 6 years ago
Another extremely important bit about TRIM support that is missing here - every block layer must be aware of it. This means if LVM partitions are used then LVM stack has to issue discards and it can be enabled by adding the following into /etc/lvm/lvm.conf
:
devices {
...
issue_discards = 1
...
}
If LUKS encrypted partitions are used it is necessary to add discard
option into crypttab
or custom systemd-cryptsetup@
service if one is used.
Depending on the configuration, initrd/initramfs has to also be aware of these options.
Hello,
I have stumbled upon SSD configuration wiki while Googling some SSD optimization tricks and discovered that information here should be improved to avoid misinformation and possible issues for those who follow it.
I would not recommend doing
sudo tune2fs -O ^has_journal $SSD_DRIVE
, because disabling Journalling increases chances of data corruption during power loss. Sure that will reduce writes, but it has associated risks disabling it that aren't outlined in the Wiki. Some info from superuser.com.sudo tune2fs -o discard $SSD_DRIVE
is also not recommended nowadays, because with continuous TRIM commands you will lose performance. Alternative and recommended approach is to periodically runfstrim
fromutil-linux
using Cron, Anacron or SystemD timers. See here for background.Changing scheduler to deadline via
echo deadline > /sys/block/sdX/queue/scheduler
should also be tested first, specifically because newest Kernels have improvements in this area, i.e.:cfq-iosched.txt from Kernel documentation. People also sometimes recommend noop scheduler, see here.
Cheers, Garry