Solved USB to SATA/IDE no longer sees drive partitions/slices

I use an USB to SATA/IDE adapter to temporarily mount hard drives and recently have run into an issue with FreeBSD 10.3-STABLE where devd no longer creates/lists the drive partitions/slices when I plug in a drive (ie /dev/da0s1), just /dev/da0. I can take the same drive, put it in a computer, and it boots right up without any issues.

fdisk reports "fdisk: could not detect sector size".

I installed sysutils/disktype and it shows the correct information for /dev/da0.

Is there a new sysctl knob that needs to be set? Something else I'm missing?
 
Please stop using fdisk(8). Use gpart(8). It does all that the others do and more. It knows multiple formats.

As for what happens, some USB disk adapters have firmware bugs. For some, it's an off-by-one error in the disk size, so the disk partition table is in the wrong place unless it was created while the disk was attached to the adapter. For others, it's a limit in how large of a disk can be used.

So I would suggest creating the partition tables with the drive attached to the machine directly. Then move it to USB adapter and see if it still works.
 
I use an USB to SATA/IDE adapter to temporarily mount hard drives and recently have run into an issue with FreeBSD 10.3-STABLE where devd no longer creates/lists the drive partitions/slices when I plug in a drive (ie /dev/da0s1), just /dev/da0.
The way this is written suggests it used to work correctly? And from one day to the next it doesn't anymore? Have you considered the adapter being faulty? Have you tried a different disk? Have you tried the adapter on a different machine (A Windows machine perhaps)?

I can take the same drive, put it in a computer, and it boots right up without any issues.
At least that shows there's nothing wrong with the drive itself.
 
Neither fdisk or gpart work. SirDice is correct, at some point this used to work and stopped. I tried using it on a Windows system over the weekend with no luck there either. I'm working on getting another adapter to determine if it's a faulty adapter.
 
It used to work correctly with that drive? Or is it a new drive? Some of those USB adapters have bugs that start to kick in with 1TB drives, or even smaller.
 
wblock@ seems to have found the issue I am experiencing. Several drives under 1TB in size seem to work just fine, its the >1TB drives that are giving me issues. Thanks.
 
Last edited by a moderator:
1TB is 31 bits of 512 byte sectors/blocks, so the root cause could be a USB adapter that has been done on the cheap and only has a 32 bit address latch, combined with a classic signed/unsigned bug. If the guts of the adapter date back to the 100s of GB era, someone designing it on the cheap might have produced such a thing. The actual ATA addressing should be unsigned 48 bit, but clamping the upper 16 bits to 0 potentially let them get away with a much cheaper set of components, particularly since MBR is limited to 32 bit block addresses anyway and the mass Windows market refused to make the OS jump from 32 to 64 for far too long.

Don't be surprised if no-name / ultra cheap adapters sold today are actually a flawed design from many years ago.
 
Back
Top