I used to install Linux on HDD. It's easy. But now I have a SSD, and I want to install Fedora 17 on it.
What should I do to make Fedora 17 issue TRIM commands to the SSD?
|show 3 more comments|
This is pretty easy, now that TRIM can pass through LVM to the underlying device(s).
There were some problems in Fedora 18 with LUKS not propagating TRIM commands, but this was fixed in Fedora 19. On my system, TRIM commands propagate successfully. One just needs to make few changes in the configuration. First of all, we need to check if TRIM propagates for all partitions to the end device:
The last column shows if TRIM commands do propagate. We can see all is set, except the encrypted home (the last line). To get full TRIM support on LUKS-encrypted devices, we need to allow TRIM commands. Note that this can decrease encryption strengh. This is the Fedora 19 default crypttab file:
Optional LVM configuration
If you modify your LVM logical volumes often (e.g. shrinking, deleting), you want to set issue_discards to 1 in `/etc/lvm/lvm.conf. Then you need to do the next optional step described bellow.
Optional init RAM disk regeneration
If you have root partition encrypted by LUKS (not my case) or if you have your root partition on LVM and you want LVM trimming when shrinking or deleting (see above optional step), initial RAM disk needs to be regenerated using the following command:
You will need to reboot to make this change effective of course.
Now, to enable TRIM and take advantage of it, there are two options:
TRIM when deleting files
It is possible to configure ext4 to send TRIM commands while deleting data.
You can do this by adding
Do not put
TRIM from cron
This is the preferred option because it can be scheduled daily, weekly or during night if you do not turn off your laptop/server:
Try to run the script now, it should not print any error message. If you changed LUKS configuration, you might need restart before doing that.