Ubuntu – Why isn’t discard automatic for SSDs


I was surprised to find that the discard option still isn't added automatically to my fstab, even though I have an SSD. Thus I have to follow these instructions to add it.

Why doesn't the installer do this automatically? Is there some hidden drawback to using discard? Are there issues reliably detecting SSDs?

Best Answer

My answer here mentions the why, but for the specific reasons to not enable it by default, comes down to several important factors that affect different hardware, hardware configurations and software configurations but they basically boil down to:

  • What file system to use? (Not all filesystems support TRIM. In fact, only a small group of filesystems support TRIM including ext4 and btrfs)

  • What SSD to use? (Some are not good with TRIM. Some don't need TRIM)

  • Will RAID be used? (There are several RAID issues when using TRIM)

  • What performance impact will it have? (Negative, Positive. This varies depending on SSD, hardware, RAID configuration...)

So I guess with all of this doubts, the option for one to test it out ourselves is left with the manual approach and to see if there is an actual benefit. I can say that the benefit in an Intel 520 with and without Trim is very little, at least in my case. But still, with all of this performance issues, enabling automatic TRIM even will all of the hype about it would still be a bad idea because for some users it will be good, but for others it could be very bad.