TRIM status on SSD attached to LSI HBA

Status
Not open for further replies.

RegularJoe

Patron
Joined
Aug 19, 2013
Messages
330
Hi Guys,

The command to look at trim via the SATA bus is camcontrol identify ada0 | egrep TRIM\|Feature

For ZFS: sysctl vfs.zfs.trim
Code:
vfs.zfs.trim.enabled: 1
vfs.zfs.trim.max_interval: 1
vfs.zfs.trim.timeout: 30
vfs.zfs.trim.txg_delay: 32


What is the one for SCSI/SAS drives, i.e. da1-15

Thanks,
Joe
 
Last edited by a moderator:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
This mixes a couple of different things. The camcontrol command determines whether the drive supports TRIM. This should work for any drive, regardless of connection type. It does not say whether that feature is being used by a filesystem, just whether the drive supports it.

sysctl vfs.zfs.trim shows whether ZFS is set to use TRIM on drives that support it.
 

RegularJoe

Patron
Joined
Aug 19, 2013
Messages
330
Were you able to figure out which command to use?

Well Trim is enabled on the ZFS Pool, but that does not necessaraly mean the SCSI UnMap / TRIM is enabled or working on the LSI SAS HBA. So far no answers. :-(

I did identify an issue with a cable or a port on the backplane, the problem stayed on that port, i.e. all my SSD's can do 390-402MB/s but on one of the ports it is only running at 219-315MB/s

That command is :
diskinfo -t da4

So I figured out the kernel is doing ATA_TRIM on my SSD's that are on the LSI SAS HBA with this command:
sysctl -a | grep ATA_TRIM

but I also see a complaint with the BSD guys that delete operations taking a long time on 10.0 as if TRIM was slow or buggy in 2014...

sysctl -a | grep zio.trim.

There seems to be a LOT of potential tuning with ZFS and the Kernel regarding TRIM, sounds like a good FAQ or article for noobs. LOL

Thanks,
Joe
 
Last edited by a moderator:

RegularJoe

Patron
Joined
Aug 19, 2013
Messages
330
This mixes a couple of different things. The camcontrol command determines whether the drive supports TRIM. This should work for any drive, regardless of connection type. It does not say whether that feature is being used by a filesystem, just whether the drive supports it.

sysctl vfs.zfs.trim shows whether ZFS is set to use TRIM on drives that support it.

camcontrol might be for ATA drives, i.e. ones on the SATA bus or enabled in the BIOS, on this HBA I have the BIOS turned off to speed up the boot process. I just flashed UEFI into the HBA so I will see if the camcontrol works now. The next thing I will try is turning the BIOS back on to see if camcontrol can show TRIM status.
 

RegularJoe

Patron
Joined
Aug 19, 2013
Messages
330
This mixes a couple of different things. The camcontrol command determines whether the drive supports TRIM. This should work for any drive, regardless of connection type. It does not say whether that feature is being used by a filesystem, just whether the drive supports it.

sysctl vfs.zfs.trim shows whether ZFS is set to use TRIM on drives that support it.

Once UEFI was pushed to the HBA and a reboot I can now see the status of the drive

Code:
camcontrol identify da4 | egrep TRIM\|Feature
Data Set Management (DSM/TRIM) yes
 
Last edited by a moderator:

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
SCSI UnMap / TRIM is enabled or working on the LSI SAS HBA
What? That has nothing to do with it.

FreeNAS supports Unmap for iSCSI. That means empty blocks on the block storage device can be treated as empty blocks by ZFS.

FreeNAS also supports TRIM/Unmap for SSDs (and similar devices), which allows the SSD to treat empty LBAs as being empty.
Once UEFI was pushed to the HBA and a reboot I can now see the status of the drive
That makes no sense to me. Either you missed something the first time around or LSI's firmware people need a crash course in not cramming important features in with secondary stuff (which is something Microsoft should take as well and stop mixing Quiet Hours and Notification sync with Cortana).
 

RegularJoe

Patron
Joined
Aug 19, 2013
Messages
330
Ok, I looked at this some more, one host has all SAS 146 gig drives and the other has 4 SATA SSD's and 12 SAS 72 gig drives. I must have tried to query the identify da1 that was SAS where I should have run identify da2 on the SATA disk.

If you try to ATA identify a SAS drive it reports back an error
camcontrol identify da1
camcontrol: ATA ATAPI_IDENTIFY via pass_16 failed
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Ok, I looked at this some more, one host has all SAS 146 gig drives and the other has 4 SATA SSD's and 12 SAS 72 gig drives. I must have tried to query the identify da1 that was SAS where I should have run identify da2 on the SATA disk.

If you try to ATA identify a SAS drive it reports back an error
camcontrol identify da1
camcontrol: ATA ATAPI_IDENTIFY via pass_16 failed
Of course it does, comcontrol identify issues an ATAPI command, which naturally doesn't work with SCSI devices.

You should try camcontrol inquiry, which issues a SCSI inquiry command.

Camcontrol manpage: https://www.freebsd.org/cgi/man.cgi?query=camcontrol&sektion=8
 
Status
Not open for further replies.
Top