Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

CAM errors with SSD - Delays during start up.

Delmir

Newbie
Joined
Jun 10, 2020
Messages
2
Hi,

I see the following errors during system start up o a brand new install:

ahcich0: is 00000000 cs 00000000 ss 00000400 rs 00000400 tfd 40 serr 00000000 cmd 0000ca17
(ada0:ahcich0:0:0:0): SEND_FPDMA_QUEUED DATA SET MANAGEMENT. ACB: 64 01 00 00 00 40 00 00 00 00 00 00
(ada0:ahcich0:0:0:0): CAM status: Command timeout
(ada0:ahcich0:0:0:0): Error 5, Retries exhausted

ada0 is an SSD (cheap: Silicon Power) and it's the boot device which is connected straight on the motherboard's SATA port (Dell T20). The other drives are connected via an HBA (LSI 9211-8i).

While the system waits for those CAM commands to timeout, the NAS becomes non-responsive. Everything goes back to normal after 2 or 3 minutes and remains good until next reboot.

smartctl shows "Log not supported" for this SSD. Is this common? Please see dmesg and smartctl outpus attached.

Is this a sign of a bad/unsupported device? Should it be reported as a bug to FreeNAS or FreeBSD? Any clues would be greatly appreciated.
 

Attachments

HoneyBadger

Mushroom! Mushroom!
Joined
Feb 6, 2014
Messages
2,902
My hunch based on the reference to DATA_SET_MANAGEMENT is that either the device or FreeBSD don't properly support TRIM (maybe queued TRIM?)

If you have no other SSDs (and don't plan to add any more) I'd suggest disabling TRIM and see if that resolves the errors.
 

Delmir

Newbie
Joined
Jun 10, 2020
Messages
2
Okay. Would anyone please advise if this is the correct way to turn off TRIM?

"vfs.zfs.trim.enabled=0" was added to /boot/loader.conf and after rebooting I no longer get those CAM errors!!!

root@freenas[~]# sysctl vfs.zfs.trim
vfs.zfs.trim.enabled: 0
vfs.zfs.trim.max_interval: 1
vfs.zfs.trim.timeout: 30
vfs.zfs.trim.txg_delay: 32
root@freenas[~]#

More questions:

What would be the implications of not using TRIM? Is there a way to trim manually once a while? If so, how?

Why doesn't TUNEFS work? Is it because the filesystems is ZFS instead of UFS?

root@freenas[~]# tunefs -t disable /dev/ada0p2
tunefs: /dev/ada0p2: could not read superblock to fill out disk
root@freenas[~]# tunefs -p /dev/ada0
tunefs: /dev/ada0: could not read superblock to fill out disk
root@freenas[~]# tunefs -p /dev/ada0p2
tunefs: /dev/ada0p2: could not read superblock to fill out disk
root@freenas[~]#

root@freenas[~]# gpart show
=> 40 500118112 ada0 GPT (238G)
40 1024 1 freebsd-boot (512K)
1064 33554432 3 freebsd-swap (16G)
33555496 466550784 2 freebsd-zfs (222G)
500106280 11872 - free - (5.8M)

=>
 

HoneyBadger

Mushroom! Mushroom!
Joined
Feb 6, 2014
Messages
2,902
That is the right way to disable TRIM; glad to hear that's mitigated the issue.

What would be the implications of not using TRIM? Is there a way to trim manually once a while? If so, how?
SSDs without TRIM will basically reduce performance over time due to having to erase dirty cells at write time, rather than being able to do that during their idle cycles. Internal garbage collection on the drive itself can help with this though.

As far as running TRIM manually, I wouldn't. Given the reaction of the drive/controller to TRIM requests (throwing errors) I'd be worried about data safety if it decides to barf and zero out the wrong cells.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
2,040
Note, you should set "vfs.zfs.trim.enabled=0" as a loader tunable, and not edit the file directly.
 

Patrick M. Hausen

Dedicated Sage
Joined
Nov 25, 2013
Messages
2,196
@Delmir
Code:
TUNEFS(8)               FreeBSD System Manager's Manual              TUNEFS(8)

NAME
     tunefs - tune up an existing UFS file system
[...]

;)
 

frozenduck

Neophyte
Joined
Jul 5, 2020
Messages
4
Sorry for the very Newbie question. I have a similar problem in that TRIM is causing my new SSD (boot pool) to be flagged as degraded. I think that I need to add vfs.zfs.trim.enabled=0 to the sysctl.conf but it doesn't write out in the Shell. How do I actually change tunables?
 

Patrick M. Hausen

Dedicated Sage
Joined
Nov 25, 2013
Messages
2,196
System -> Tunables in the UI. Probably type "loader" for this one.
 

Patrick M. Hausen

Dedicated Sage
Joined
Nov 25, 2013
Messages
2,196

Patrick M. Hausen

Dedicated Sage
Joined
Nov 25, 2013
Messages
2,196
No luck with either "loader" or "sysctl" types ... Thanks anyway. Will keep tinkering.
What precisely did you enter? Care to share a screenshot? BTW loader is correct, see @Samuel Tai's post above.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
2,040
Note loader tunables only take effect on the next reboot. Under System->Tunables, click the Add button, and fill out the ensuing dialog like this:

1593954431804.png

Click Save, and reboot.
 

frozenduck

Neophyte
Joined
Jul 5, 2020
Messages
4
Thanks. The example helped and it worked after the 3rd save and reboot. Now "sysctl vfs.zfs.trim" returns as enabled=0, but the disk is still flagged as degraded. Scrubbed a couple of times and it doesn't seem to have changed status, so I guess that maybe the disk is actually degraded, or just incompatible with FreeNAS. Although at less than a month in the machine from new, I am a little surprised. It still seems to boot fine, so I am not sure what the problem is. Thanks again for the help.
 
Top