3

I have a Samsung PRO Series SSD. Linux deactivates Trim for this SSD because it deletes the wrong data when asynchronous Trim is used (firmware bug).

Is it possible to activate synchronous Trim for it without activating asynchronous Trim, too?

My laptop in which I use this SSD only runs 1 operating system: Ubuntu 16.04. It's a LTS system so it only runs LTS kernels. The currently kernel is 4.4.0-57-generic.

Regarding firmware updates: A lot of users report that the firmware update failed for them. Furthermore, Samsung only offers its update software for Windows for the SSD I have. Its Linux version only supports certain business SSDs, the Windows version only certain consumer SSDs. Unfortunately, I don't have business SSD (and no Windows installation which I'm frankly rather glad about, most of the time). There seems to be a way to do the update anyways but it's rather hacky. To top it all off, I don't even know whether the firmware update fixes the problem.

  • On another note, is there no firmware update available to fix this issue? – phk Dec 29 '16 at 22:31
  • I know that there is a firmware update but I wasn't able to figure out whether it solves the problem. However, quite a lot of people report problems when updating the firmware of that SSD which is why I haven't tried that, yet. I have a different hard drive available for my laptop should the one I currently use fail. I'll create an image of my SSD, tomorrow. Then, I can test whether the firmware upgrade fixes the problem. However, I should probably think about whether that's a good plan when I'm less tired because afaik, I don't have warranty on that SSD, any more and it wasn't cheap. – UTF-8 Dec 30 '16 at 0:03
  • Okay, costs half as much as I paid for it when it was first available where I live. I wouldn't buy the same SSD again, though. Won't buy Samsung hardware any more. Samsung is already the number one on my hardware manufacturers blacklist: For displays, smartphones, laptops, and motherboards. Add SSDs to it and there isn't much more I'm willing to try. – UTF-8 Dec 30 '16 at 0:21
1

I found the solution.

I tried fstrim with explicit statements of the partitions as a weekly cronjob shortly after I posted the answer but didn't know whether it was safe. Furthermore, I didn't know whether someone would have a better answer. Therefore, I didn't post it as an answer myself.

I just looked at the contents of the folder /etc/cron.weekly where I placed a file containing the command because I wanted to execute it manually after filling my entire disk with data today and having deleted a lot of it a few minutes ago. I didn't remember the command, so I just went where I put it. However, after executing ll I found 2 files with names leading me to believe that it was my script.

The other file wasn't put there by me so it's almost certainly delivered with Ubuntu. It's called fstrim and these are its contents:

#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true

After deleting my own script, I executed the script which came with Ubuntu because its clearly better. It felt like it took about a minute to execute which is what I'd expect from it trimming 36 GB. When I executed it a second time, it returned immediately, indicating that it did actually trim the first time.

I already sha256summed all the files in my home folder before trimming the first time, sha256summed all of them after the first trim, and found no unexpected changes (well, obviously, the contents of ~/.cache and ~/.mozilla changed as I used Firefox in the meantime) when comparing the files containing the sha256sums via Meld. I therefore concluded that it's probably safe.

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.