incorrect capacity detection of a new USB stick

Eli4ph

Cadet
Joined
Dec 25, 2019
Messages
3
This is my first FreeNAS build and I am trying to install the latest stable release, i.e., FreeNAS 11.2-U7. Though the problem happens during the installation, I think it is a problem related to storage—the kernel incorrectly detects the capacity of the USB stick for booting.

I bought two new USB sticks of the same model—one as the boot device, the other as the mirror.

During the installation, the following error message is reported.

Code:
gpart: Invalid argument
Could not do anything with da2, skipping
Disk is too small to install FreeNAS
The FreeNAS installation on da2 has failed. Press enter to continue..


And dmesg gives the following error message.

Code:
ugen0.8: <16G SLC CHIPFANCIER> at usbus0
umass2 on uhub7
umass2: <16G SLC CHIPFANCIER, class 0/0, rev 3.00/0.01, addr 7> on usbus0
umass2:  SCSI over Bulk-Only; quirks = 0x8100
umass2:9:2: Attached to scbus9
da2 at umass-sim2 bus 2 scbus9 target 0 lun 0
da2: <16G SLC CHIPFANCIER 1.00> Removable Direct Access SPC-4 SCSI device
da2: Serial Number 4149330872
da2: 400.000MB/s transfers
da2: 15253MB (31238389 512 byte sectors)
da2: quirks=0x2<NO_6_BYTE>
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f3 00 00 01 00 
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 b6 00 00 04 00 
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f3 00 00 01 00 
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00 
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00 
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00 
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00 
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00 
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error

With another USB stick, the installation proceeds without an error. But the two USB sticks are new and both of them works on my PC and Mac. So there seems to be a compatibility issue between FreeNAS 11.2-U7 and the two USB sticks.

Since FreeNAS is derived from FreeBSD, I played with FreeBSD 11.2 and 12.1. Surprisingly, I found that the problematic USB stick works with FreeBSD 12.1 and fails with FreeBSD 11.2.

I compare the events reported by dmesg after inserting the problematic USB stick. I find FreeNAS/FreeBSD 11.2 incorrectly detect the capacity of the USB stick. On FreeNAS/FreeBSD 11.2, the problematic USB stick is reported to have 31238389 512-byte sectors. However, on FreeBSD 12.1, Windows 7 and macOS, the same USB stick is reported to have 31205621 512-byte sectors. FreeNAS/FreeBSD 11.2 detects 0.1% more capacity than actual for the problematic USB stick.

If I still want to use the problematic USB stick as the boot device, is there a solution? Is the problem caused by the firmware of the USB stick or the umass driver of FreeBSD 11.2?

Code:
ugen0.8: <16G SLC CHIPFANCIER> at usbus0
umass2 on uhub7
umass2: <16G SLC CHIPFANCIER, class 0/0, rev 3.00/0.01, addr 7> on usbus0
umass2:  SCSI over Bulk-Only; quirks = 0x8100
umass2:9:2: Attached to scbus9
da2 at umass-sim2 bus 2 scbus9 target 0 lun 0
da2: <16G SLC CHIPFANCIER 1.00> Removable Direct Access SPC-4 SCSI device
da2: Serial Number 4149330872
da2: 400.000MB/s transfers
da2: 15253MB (31238389 512 byte sectors)
da2: quirks=0x2<NO_6_BYTE>
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f3 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 b6 00 00 04 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f3 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f3 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 b6 00 00 04 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f3 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error
(da2:umass-sim2:2:0:0): READ(10). CDB: 28 00 01 dc a8 f4 00 00 01 00
(da2:umass-sim2:2:0:0): CAM status: SCSI Status Error
(da2:umass-sim2:2:0:0): SCSI status: Check Condition
(da2:umass-sim2:2:0:0): SCSI sense: ILLEGAL REQUEST asc:21,0 (Logical block address out of range)
(da2:umass-sim2:2:0:0): Error 22, Unretryable error

Code:
ugen0.8: <16G SLC CHIPFANCIER> at usbus0
umass2 on uhub7
umass2: <16G SLC CHIPFANCIER, class 0/0, rev 3.00/0.01, addr 7> on usbus0
umass2:  SCSI over Bulk-Only; quirks = 0x8100
umass2:8:2: Attached to scbus8
da2 at umass-sim2 bus 2 scbus8 target 0 lun 0
da2: <16G SLC CHIPFANCIER 1.00> Removable Direct Access SPC-4 SCSI device
da2: Serial Number 4149330872
da2: 400.000MB/s transfers
da2: 15237MB (31205621 512 byte sectors)
da2: quirks=0x12<NO_6_BYTE,NO_RC16>
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
If the two USB sticks are from the same company and one works while the other doesn't work, I would be looking at the USB stick as the source of the problem. It could be a flaw in that individual stick or a difference in the firmware version that was coded on the stick during manufacturing. Even the same brand / model will often have differences from one production run to the next.

Speaking of brand and model, what kind of hardware are we dealing with here? This is the guide to give you some idea of what is useful to know when posting a problem:

It looks like you gathered a good bit of information on the problem and it definitely looks to be a change in the driver from one version of FreeBSD to the next, but I would still think it is the USB stick since one works and the other doesn't.
 

Eli4ph

Cadet
Joined
Dec 25, 2019
Messages
3
Sorry for the confusion. By "another USB stick" I mean a third USB stick from other brand using a different NAND controller.

Finally I found this is a upstream bug in FreeBSD.

But this bug is actually due to the buggy firmware from the NAND controller provider, i.e., Innostor. The buggy firmware incorrectly responses SCSI command READ CAPACITY (16) while correctly responses READ CAPACITY (16). This is the rationale behind the 'NO_RC16' quirk.

Since it is fixed in stable11 branch of FreeBSD, I am wondering if there is an user-friendly way to get FreeNAS benefit from this bugfix? (If it is too complicated, I think it is better to use other USB stick temporarily and wait for the release having this bugfix.
 

Eli4ph

Cadet
Joined
Dec 25, 2019
Messages
3
Sorry for the typo.

Correct - READ CAPACITY 10
Wrong - READ CAPACITY 16
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
Sorry for the confusion. By "another USB stick" I mean a third USB stick from other brand using a different NAND controller.

Finally I found this is a upstream bug in FreeBSD.

But this bug is actually due to the buggy firmware from the NAND controller provider, i.e., Innostor. The buggy firmware incorrectly responses SCSI command READ CAPACITY (16) while correctly responses READ CAPACITY (16). This is the rationale behind the 'NO_RC16' quirk.

Since it is fixed in stable11 branch of FreeBSD, I am wondering if there is an user-friendly way to get FreeNAS benefit from this bugfix? (If it is too complicated, I think it is better to use other USB stick temporarily and wait for the release having this bugfix.
Sounds like you did some good research here. Would you submit a ticket into the iXsystems bug tracker?
 
Top