Update Breaks fstrim Functionality

I had been using version Rockstor-3.8-14.iso without any further updates until the USB drive hosting the system disk failed. I did a fresh install of Rockstor-3.9.1.iso and applied all Testing Updates up to December 18, 2018. The current version visible in the GUI is 3.9.1-16. Other than replacing the USB drive all the hardware is unchanged. The drives, pools and shares imported fine and read/write/browse access to shares on both physical drives has been tested and confirmed okay.

On the original setup I applied the steps for setting up fstrim as a weekly cron task as given in Trim functionality on SSDs. It worked great. After the upgrade, I repeated the exact steps again, but the testrun now fails with the message: the discard operation is not supported

The physical disks are

  • HGST_HMS5C4040ALE640 - 4TB HDD
  • SAMSUNG_SSD_PM810_2.5__128GB - 128GB SSD
  • SanDisk_Ultra_Fit - 16GB USB drive exclusively for the system.

I have confirmed by using hdparm that the SSD supports Trim. I’ve scoured the web for clues and came up empty. The fact that the earlier version ran correctly on the same hardware signals that some revision between those two versions breaks fstrim. Can anybody offer any help or suggestions?

@Walt Hello again.

Yes this is strange. Your most likely running a newer kernel as 3.8-14 was well old. Other than that I don’t see what we could have changed that may interfere with this. However @herbert’s instructions pertain to the / and /home sub volumes (mount points) and unless you have your install on the ssd then you are trying to trim on the SanDisk_Ultra_Fit which likely doesn’t support trim. But the Samsung SSD likely does. You could change the script to reference the mount point of the Samsung instead, which is likely /mnt2/

Just a thought and hope that helps.

LOL! When all else fails read the man page! I just tried

fstrim -a -v

and it worked. According to the man page the -a option trims all mounted filesystems on devices that support trimming and ignores the rest – which is what I thought @herbert’s command strings were doing.

Your reply helped me sort that one out, many thanks!