OPNsense Forum

English Forums => Hardware and Performance => Topic started by: ar on April 16, 2022, 06:15:43 pm

Title: TRIM on DEC750
Post by: ar on April 16, 2022, 06:15:43 pm
I've gone through some SMART details and reviews and on a test device I've seen that TRIM is disabled on a DEC750.

Code: [Select]
root@OPNsense:/usr/ports/sysutils # tunefs -p /
tunefs: trim: (-t)                                         disabled

The device itself is of the model TS256GMTE652T2 NVMe and it should support trim.

The current written units are ~680GB after 60 days.

If I work with the web proxy feature, should TRIM be enabled and if so, what would be the correct way to do so?
Title: Re: TRIM on DEC750
Post by: franco on April 19, 2022, 08:42:35 am
The boot tries to figure out if the disk is capable, which is:

# camcontrol identify ada0 | grep TRIM

Replace ada0 with your device name to see what the disk claims.


Cheers,
Franco
Title: Re: TRIM on DEC750
Post by: ar on April 19, 2022, 02:58:23 pm
Thanks, I just tried to check it with the command you mentioned, but it does not accept any device name given and I'm not really sure what the device unit name would be or how to list them, here is what I tried:

Code: [Select]
> camcontrol devlist
# no output

> geom disk list
Geom name: nvd0
Providers:
1. Name: nvd0
   Mediasize: 256060514304 (238G)

> camcontrol identify nvme0
> camcontrol identify /dev/nvme0
> camcontrol identify nvd0
> camcontrol identify /dev/nvd0
# tried with the common ones listed in /dev, all end up with the same error
camcontrol: cam_lookup_pass: CAMGETPASSTHRU ioctl failed
cam_lookup_pass: No such file or directory
cam_lookup_pass: either the pass driver isn't in your kernel
cam_lookup_pass: or nvd0 doesn't exist

I did manually enabled it with the following commands during single user mode

Code: [Select]
fsck -y
tunefs -t enable /
reboot

and it seems to stick.

Strange that the device was delivered with it turned off. Same for noatime which was not set, but it is mentioned in the docs. Was wondering why the device gained about 10-20GB written per day in a small home office setup. After some debugging it turned out that the RRD data was mostly responsible for that.

What is the best way to go about this, contact Deciso support directly, not sure if they aware of that?
Title: Re: TRIM on DEC750
Post by: franco on April 19, 2022, 03:04:27 pm
That would explain it if it can't read the property. To be honest I'm not sure how the information about hardware capability is to be read from the disk in this case.


Cheers,
Franco
Title: Re: TRIM on DEC750
Post by: ar on April 19, 2022, 03:47:51 pm
Yeah same here. The manufacturer mentions trim support for the NVMe model number, I assumed it should work.

Coming from Debian myself, it's quite the jungle sometimes. hdparm is not available, sdparm -l -a /dev/nvme0 does not show anything worthwhile in that category.

Maybe trim -N -q /dev/nvd0 would return an actual exit code > 0 if the device does not support TRIM, but I'm at a loss.
Title: Re: TRIM on DEC750
Post by: franco on April 19, 2022, 04:02:02 pm
Let me see if I have a device here that shows the same issue, but I think suspect I never had a NVMe in a dev system to look at yet.


Cheers,
Franco
Title: Re: TRIM on DEC750
Post by: meyergru on April 19, 2022, 07:33:50 pm
My DEC750 was shipped with ZFS.

It did not have TRIM enabled either (as shown by "zpool get autotrim") - "tunefs" is only applicable to UFS.
I enabled TRIM via "zpool set autotrim=on zroot", started the trim manually by "zpool trim zroot".

You can check the trim status via "zpool status -t" for ZFS.
Title: Re: TRIM on DEC750
Post by: aptalca on May 09, 2022, 03:44:26 pm
Thanks for this post.

I just did a brand new install on an ssd with zfs and was trying to figure out whether trim was enabled.

According to the commands you provided, trim was enabled and I could run it manually, however autotrim was not enabled.

"zpool set autotrim=on zroot" took care of that.