root@ubuntu:/home/ubuntu# sg_readcap --16 /dev/sdd
READ CAPACITY (16) not supported
This means when your USB docking translate the capacity from the drive's ATA IDENTIFY DEVICE data (seen in hdparm -I
/ smartctl -i
), it can at most report a size up to 32-bit (i.e. 0xffffffff, 4294967295) in terms of number of logical sectors. This is an inherit limitation of SCSI READ CAPACITY (10):
Logical Sector Size | Maximum capacity supported (TiB / TB)
512 | ~2.0 / ~2.2
4096 | ~16.0 / ~17.6
Since your drive is an AF 512e drive that has totally 5860533168 / 0x15d50a3b0 512-byte logical sectors, which requires 33 bits to represent, only a SATA/USB bridge that supports SCSI READ CAPACITY (16) can handle it properly. When the size is truncated to 32-bit, it turns from:
101011101010100001010001110110000 (5860533168)
to
01011101010100001010001110110000 (1565565872)
The Linux kernel, or probably all OSes, will basically never issue ATA IDENTIFY DEVICE command "directly" (i.e. encapsulated in a SCSI ATA PASS-THROUGH command) to USB drives, but SCSI READ CAPACITY commands (which you issued manually with sg_readcap
), to get the capacity of them.
Only when the drives are actually SATA drive connected with a SATA/USB bridge, the command will be handled by the SCSI-ATA Translation Layer implemented in the bridge, which will then issue ATA IDENTIFY DEVICE command to the SATA drive to get the information it needs to form the response data for the READ CAPACITY command.
But utilities like hdparm
and smartctl
are (almost) exclusively for ATA drives, so they pretty much do everything with ATA PASS-THROUGH. (Also because they are userspace utilities, it is expected you, the user, will only use them on the appropriate type of devices.) That's why you end up getting different capacity in different places.
Best Answer
I have seen this happening if there's an issue with providing enough power. As per the standard, USB 3 is supposed to handle 900mA, but I have found hardware that skimps on this - Providing the data rate, but not being able to drive power-hundry devices such as hard-drives (For example, if connecting a harddrive to my tablet, I need to use a USB hub as a power injector).
The fact that your drive spins down during, or shortly after activity makes it sound like it is barely getting what it needs. To see if this is the case, Try to connect it via a USB hub that has its own powersupply. If you do this, the USB hub will supply the power instead of your computer.
EDIT: I'm not sure about the 2007 model of Mac Mini, but that sounds very early for USB3 to me. Does it have a USB3 port, or are you running the drive on USB2? If the latter, then that might be the issue, and the USB hub trick is your best bet. While USB3 is backwards compatible, some USB3 devices need more current than a USB2 system can provide, as USB2 is limited to (if my memory serves me right) 400mA.