6

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?

8

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.

  • It's also mentioned in the docs: This is useful for SSD devices [...] but it is off by default until sufficient testing has been done – Savvas Radevic Oct 1 '12 at 19:38
  • 2
    @medigeek - Correct, until a lot of testing. The "problem" with Ubuntu if we can call it that, is that it is a more end user distro than others, so it has to try to help as many users as possible without creating problems for them, server or desktop. Activating this feature could be good to some like me, but bad to others as a friend once told me about a corrupt RAID that happened to him. My thinking is that, with the passing of Linux kernel versions and the advances of Ubuntu and open source drivers, we will be able to see this feature in automatic mode depending on the hardware. – Luis Alvarado Oct 1 '12 at 21:07
3

I came across information that says it is VERY IMPORTANT TO DISABLE DISCARD MOUNT OPTION on SSD's (-o nodiscard) under Linux. Here's the quote and link:

Link:

https://www.intel.com/content/dam/support/us/en/documents/ssdc/data-center-ssds/Intel_Linux_NVMe_Guide_330602-002.pdf

Quote from page 6:

"Filesystem Recommendations

IMPORTANT: Do not discard blocks in filesystem usage.

Be sure to turn off the discard option when making your Linux filesystem. You want to allow the SSD manage blocks and its activity between the NVM (non-volatile memory) and host with more advanced and consistent approaches in the SSD Controller.

Core Filesystems:

• ext4 – the default extended option is not to discard blocks at filesystem make time, retain this, and do not add the “discard” extended option as some information will tell you to do.

• xfs – with mkfs.xfs, add the –K option so that you do not discard blocks.

If you are going to use a software RAID, it is recommended to use a chunk size of 128k as starting point, depending on the workload you are going to run. You must always test your workload."

As you can see, the manufacturer itself, Intel, makes the point SO STRONGLY that they repeat it FIVE times in the text, FOUR explicitly and one through logic that professionals understand. This is VERY EMPHATIC of the manufacturer. Also, this SSD is no slouch: it is the $1,200 Intel SSD's from a few years ago.

  • 2
    Welcome to AskUbuntu. You can put a > in front of a paragraph to make it a quote box. – qwr Aug 29 '18 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.