# HDD 4K/512 sector size messed up over SATA/USB



## varda (Jul 17, 2014)

Hello Gentlemen.

I have 4K sector size 4TB HDD which reported and identified differently when attached to SATA  port (512 bytes) and over some USB cradle (4096 bytes). Thus logical structure written over SATA not recognized when HDD connected over USB. So I've a question. Is this problem causes by USB cradle or is it possible to switch sector size to the same value over both connection variants?

I hope that reports provided below are enough self explanatory. This is all the same single HDD.


```
ada1: <ST4000DM000-1F2168 CC52> ATA-8 SATA 3.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada1: 3815447MB (7814037168 512 byte sectors: 16H 63S/T 16383C)

sector size           logical 512, physical 4096, offset 0
Host Protected Area (HPA)      yes      no      7814037168/7814037168
```


```
da0: <Prolific USB-SATA Bridge CC52> Fixed Direct Access SCSI-0 device
da0: 400.000MB/s transfers
da0: 3815447MB (976754646 4096 byte sectors: 255H 63S/T 60800C)

sector size           logical 512, physical 4096, offset 0
Host Protected Area (HPA)      yes      no      7814037168/1
```


```
FreeBSD noname.local 10.0-STABLE FreeBSD 10.0-STABLE #0: Fri Jul 11 18:55:17 EDT 2014     root@noname.local:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------



## varda (Jul 18, 2014)

So I've made some research and found that there is 512 bytes sector emulation on SATA controller (512e) and there is no such feature in action over USB cradle/enclosure and thus entire 4K sectors LBA exposed.

Is it possible to switch off 512e on SATA?


----------



## mav@ (Jul 25, 2014)

This emulation is usually done by the HDD itself, not by the controller. It is probably an oddity of your USB cradle, that it converts the drive from 512e to 4Kn format. If you wish, you can do the same in software for the SATA case using the gnop GEOM class.


----------

