Linux – How to enable SSD TRIM support on Fedora 17

fedoralinuxssd

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?

Best Answer

This is pretty easy, now that TRIM can pass through LVM to the underlying device(s).

  1. When you install, make sure your filesystems are all set to ext4. TRIM is not supported on ext3.

  2. After you install, login as root and edit /etc/fstab. In the fourth column (that usually reads defaults) add the keyword discard. Do this for both the / and /boot partitions, and any other partitions you created on the SSD.

    An example:

    /dev/mapper/vg_mymachine-lv_root /                       ext4    discard         1 1
    UUID=94b6d32d-ec21-4028-9a89-b1a19849c4ad /boot                   ext4    discard         1 2
    

    (If defaults is the only keyword there, it can be replaced with discard. If other keywords are there, append it with a comma, e.g. whatever,discard.)

    Nothing needs to be done for swap; all swap partitions automatically support TRIM.

  3. LVM support for discard is disabled by default. Enable it by editing /etc/lvm/lvm.conf and changing issue_discards = 0 to issue_discards = 1.

  4. Restart the computer.

Related Question