OPNsense Forum

Archive => 20.1 Legacy Series => Topic started by: Dopamin3 on February 04, 2020, 03:27:38 am

Title: ahcich0 CAM status: Command timeout after first reboot on 20.1
Post by: Dopamin3 on February 04, 2020, 03:27:38 am
System specs: Mini-Box M350/picPSU 80w, ASRock J3455B-ITX (Celeron J3455 1.5GHz), 6GB DDR3, 60GB SATA SSD, Intel PRO/1000 PT Dual Port NIC

Using Windows 10, I downloaded the latest VGA installer (OPNsense-20.1-OpenSSL-vga-amd64.img.bz2), extracted it, and then use Rufus in DD mode to write the image to a flash drive. I booted the Asrock PC to the flash drive to the live environment, and then installed OPNsense with no issue. After rebooting it came up fine and I began configuring a few port forwards and VLAN interfaces. Everything was going great.

Then after another reboot once it gets to the script carp_maintenance a ton of timeouts with SEND_FPDMA_QUEUED DATA SET MANAGEMENT come up: https://i.imgur.com/jsVR78W.jpg

I tried researching this a little bit and saw to change SATA mode in BIOS from AHCI to ATA, unfortunately this BIOS only lists AHCI mode. I've tried to disable S.M.A.R.T. in the BIOS but it still does this. The built in Realtek NIC is disabled. I also saw where adding the lines hint.ahci.0.msi="0" and ="1" into /boot/device.hints would fix it, but I'm not comfortable enough to try it or know if that would fix it anyway.

Any suggestions on this? I also wiped the SSD, ran the installer in UEFI mode, rebooted and ran the setup wizard. No additional interface config, vlans, firewall rules, services, etc... Rebooted and now it displays the same errors, but further down after it does Launching the init system...done. and Initializing..........done. Can't get to the web interface :(
Title: Re: ahcich0 CAM status: Command timeout after first reboot on 20.1
Post by: Reeshar on December 05, 2020, 08:13:18 pm
I've just been encountering exactly this problem with OPNsense 20.7. Long boot times with ahcich0/CAM timeouts. And I've found the source: The problem lies in the SSD's ability to handle the TRIM command.

I guess most quality SSDs support trim but this is a cheap Chinese SSD so probably doesn't. And during all those timeouts CAM is trying to issue a TRIM command which isn't recognised by the SSD.

You can check this for yourselves by doing this:

1) Boot your machine and select "2 - single-user mode" at the boot options splash screen

2) After booting into single-user mode press return to get a shell prompt. You shouldn't have to enter username/password or you're not in single-user mode.

3) issue the following command:

# tunefs -t disable /dev/gpt/rootfs

(where /dev/gpt/rootfs is the filesystem listed in /etc/fstab)

then

# reboot

4) Enjoy an error-free rapid boot!

Unfortunately the disable setting doesn't stick permanently. After that first multi-user reboot TRIM is reset - you can see TRIM being re-enabled by tunefs during the boot process but this only seems to have effect on the next reboot. So the question is now how to disable TRIM permanently.

Any suggestions?  :)
Title: Re: ahcich0 CAM status: Command timeout after first reboot on 20.1
Post by: herraa1 on December 12, 2020, 12:01:03 am
Hi,

I faced exactly the same problem on OpnSense 20.7.6 with FreeBSD 12.1-RELEASE-p11-HBSD.

Looking at the init scripts I found some interesting information in /usr/local/etc/rc. Simply by adding "# notrim" (without the quotes) at the end of the entry for /dev/gpt/rootfs in /etc/fstab you will disable trim during boot.

That solved the problem for me.

Thanks.
 
Title: Re: ahcich0 CAM status: Command timeout after first reboot on 20.1
Post by: misken on March 06, 2021, 10:40:32 am
Hi everyone,

I had a similar issue using an AWOW AK34 mini PC with Celeron N3450 (https://www.amazon.de/dp/B07X92KDXP/ref=cm_sw_em_r_mt_dp_MF8D3FC6ZAFMRJY2KS4Z ).

Adding "# notrim" to the first line in /etc/fstab also did the trick for me! Thanks herraa1! I did quite some googling and tested a lot of hint.ahci... options but none worked.
Be aware that even if you change that line in /etc/fstab after a clean install of opnsense within the first boot cycle, trim will be enabled after that one, so you need to reboot once again.