I have a 4 TB hard disk that has 4k physical sector size (Advanced Format) and I attached it to two SATA host controllers (one internal and one in a USB enclosure). On the (older, about 2010) it comes up as 512B logical sector size, but reports its physical sectors are 4096 bytes. In the recent USB enclosure, it is reported as having 4096B logical and physical size:
# internal host controller sd 4:0:0:0: [sdd] 7814037168 512-byte logical blocks: (4.00 TB/3.63 TiB) sd 4:0:0:0: [sdd] 4096-byte physical blocks # USB enclosure sd 18:0:0:0: [sdd] 976754646 4096-byte logical blocks: (4.00 TB/3.63 TiB)
The "internal" controller shows behavior I had previously seen, which is usually called "512e" where the drive's firmware emulates 512 sector LBA addressing even though it does not physically write sectors that way. Operating systems (and admins) can ensure that partitions are aligned such that (small) write commands can be grouped so that the disk can overwrite full sectors instead of falling back to writing to part of a physical sector, where it needs to read the remainder of content first.
However, seeing "4k native" behavior on a drive (USB enclosure) was new to me and my initial thought was the enclosure is emulating 4096B addressing on top of the drive's emulated 512B emulation.
The only occurrences of this that I could find with a Web Search where USB storage facilities that registered with 4k logical sectors. I presume they emulate 4k over 512e so allow for MBR partition tables so that large drives can be used on legacy/embeeded devices (Smart TVs and what not) that only support MBR+FAT32 usb mass storage.
After contacting the manufacturer, they claimed the drive is actually operating in non-emulated (native) 4k mode, the USB SATA controller is also doing no emulation at all. This would require the drive's firmware to detect whether the host controller supports (desires?) addressing sector sizes of 4KB. I could not find anything about this in the public documentation of SATA standards. So I ask:
- Has anyone seen "4096-byte logical blocks" on their SATA controller?
- Do drives actually support enabling/disabling emulation on demand? If so,
- How does this determination work?
- Can you override it on the drive via a flag?
- Can you override it on the host controller via a driver/flag?