1
22.1 Legacy Series / NCQ_TRIM_BROKEN boot error with 22.1 - FreeBSD 13 kernel issue
« on: February 24, 2022, 12:48:50 pm »
Hi all,
Sorry to make my first post on here a "HEEEELP!" post. Love OPNSense, haven't had hardly any issues with any upgrades in the post, but have an annoying one here I'm not able to fix. I know the cause, but everything I've tried hasn't worked. Maybe someone a bit more familiar with FreeBSD kernel issues can steer me right, I'm at the bottom of the barrel now
.
So after upgrade from 21.7.8 to 22.1, during boot I'm getting:
"quirks-0x2(NCQ_TRIM_BROKEN)"
Having googled around, easy spot as to what the issue is. It's a wildcard pattern match error in the FreeBSD kernel. Whilst the threads below say its been rolled in as a fix as of FreeBSD v11.1, obviously 22.1 OPNSense is using the FreeBSD 13 kernel, and it still seems to be an issue.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210686
https://svnweb.freebsd.org/base?view=revision&revision=304443
And info on the drive I'm using, confirming that its the drive model that's the issue:
=== START OF INFORMATION SECTION ===
Model Family: Crucial/Micron Client SSDs
Device Model: Micron_M500_MTFDDAK120MAV
Serial Number: 1346095A39C0
LU WWN Device Id: 5 00a075 1095a39c0
Firmware Version: MU03
User Capacity: 120,034,123,776 bytes [120 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
TRIM Command: Available, deterministic, zeroed
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2, ATA8-ACS T13/1699-D revision 6
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Thu Feb 24 09:39:36 2022 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
There is a work around in that thread of adding these to boot/loader.conf:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210686#c9
kern.cam.ada.0.quirks="0x0" (no 4k block support)
(or)
kern.cam.ada.0.quirks="0x1" (with 4k block support)
I've done this by hand modifying loader.conf and by adding a tunable through the GUI (System->Settings->Tunables). Sadly neither works with either 0x0 or 0x1. 0x2 is trim, and 0x3 is trim with 4k, but seems no need to test those here if nothing works. Soon as its hits that line during boot, it just stalls. Occasionally it will move on a line or two and then just halt.
For now I'm loading with the 21.7.8 kernel as kernel.old instead and as soon as I do, all fine, but does mean I'm stuck in limbo until I either fix this, or swap out the SSD and rebuild on another. I may have to at this point but I'd rather not.
There are two long term fixes for this shown in that thread.
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=171939
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=173807
I'm no FreeBSD expert and chances are someone here can do in minutes what would take me hours
. Any help or pointers would be much appreciated. Thanks.
Sorry to make my first post on here a "HEEEELP!" post. Love OPNSense, haven't had hardly any issues with any upgrades in the post, but have an annoying one here I'm not able to fix. I know the cause, but everything I've tried hasn't worked. Maybe someone a bit more familiar with FreeBSD kernel issues can steer me right, I'm at the bottom of the barrel now
.So after upgrade from 21.7.8 to 22.1, during boot I'm getting:
"quirks-0x2(NCQ_TRIM_BROKEN)"
Having googled around, easy spot as to what the issue is. It's a wildcard pattern match error in the FreeBSD kernel. Whilst the threads below say its been rolled in as a fix as of FreeBSD v11.1, obviously 22.1 OPNSense is using the FreeBSD 13 kernel, and it still seems to be an issue.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210686
https://svnweb.freebsd.org/base?view=revision&revision=304443
And info on the drive I'm using, confirming that its the drive model that's the issue:
=== START OF INFORMATION SECTION ===
Model Family: Crucial/Micron Client SSDs
Device Model: Micron_M500_MTFDDAK120MAV
Serial Number: 1346095A39C0
LU WWN Device Id: 5 00a075 1095a39c0
Firmware Version: MU03
User Capacity: 120,034,123,776 bytes [120 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
TRIM Command: Available, deterministic, zeroed
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2, ATA8-ACS T13/1699-D revision 6
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Thu Feb 24 09:39:36 2022 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
There is a work around in that thread of adding these to boot/loader.conf:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210686#c9
kern.cam.ada.0.quirks="0x0" (no 4k block support)
(or)
kern.cam.ada.0.quirks="0x1" (with 4k block support)
I've done this by hand modifying loader.conf and by adding a tunable through the GUI (System->Settings->Tunables). Sadly neither works with either 0x0 or 0x1. 0x2 is trim, and 0x3 is trim with 4k, but seems no need to test those here if nothing works. Soon as its hits that line during boot, it just stalls. Occasionally it will move on a line or two and then just halt.
For now I'm loading with the 21.7.8 kernel as kernel.old instead and as soon as I do, all fine, but does mean I'm stuck in limbo until I either fix this, or swap out the SSD and rebuild on another. I may have to at this point but I'd rather not.
There are two long term fixes for this shown in that thread.
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=171939
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=173807
I'm no FreeBSD expert and chances are someone here can do in minutes what would take me hours
. Any help or pointers would be much appreciated. Thanks.

