OPNsense Forum

Archive => 16.7 Legacy Series => Topic started by: Sundial on July 08, 2016, 03:51:41 am

Title: [SOLVED] TRIM support?
Post by: Sundial on July 08, 2016, 03:51:41 am
I've read in several posts here that TRIM should be enabled by default.  I just clean installed 16.7.r1 and TRIM was not enabled by default.  I do have an SSD installed so it should be supported.  I was able to manually enable it in single user mode.
Title: Re: TRIM support?
Post by: franco on July 08, 2016, 08:51:18 am
It's a tricky endeavour. Some people say TRIM should not be enabled on disks that don't support it/advertise it, but it's all very magical and so we do the following:

Attempt to read the disk's capabilities, enable TRIM if it's advertised.

The part of "attempt to read" will likely fail in your case, so it would be interesting to know why.

The code does the following:

https://github.com/opnsense/core/blob/master/src/etc/rc#L25-L46

Maybe this is due to trying to match a disk as "/\/dev\/([a-z]+[0-9]+)/", it could be that the new installer doing root fs labeling will break this. I'll take a closer look, thanks!
Title: Re: TRIM support?
Post by: Sundial on July 08, 2016, 02:00:35 pm
Thanks.  It's not a huge deal since I can enable it manually, but the more stuff it does automatically, the better!
Title: Re: TRIM support?
Post by: franco on July 08, 2016, 05:55:28 pm
We'll be able to fix this in 16.7.x too as the enable is done during boot time. I'm filing a ticket, because at this point I don't know how to translate labels from /dev/ufs and /dev/gpt to device names which the camcontrol utility expects.

https://github.com/opnsense/core/issues/1055
Title: Re: TRIM support?
Post by: Sundial on July 09, 2016, 06:03:36 am
Thanks!  Sounds great.
Title: Re: TRIM support?
Post by: franco on July 11, 2016, 11:38:08 pm
Ok, I got this. Fixed in RC2.