Per Tom Yan suggestion I'm forwarding bug from bugzilla to this ML: 
https://bugzilla.kernel.org/show_bug.cgi?id=102271

=== Dainius Masiliūnas wrote: ===

When using an Advanced Format drive connected through a SCSI-to-ATA Translation 
device, the physical 
block size reported by the kernel (in 
/sys/class/block/sdc/queue/physical_block_size) is 512 bytes. 
Whereas hdparm -I and smartctl -a do correctly show the physical block size as 
4096 bytes.

In my case, the drive in question is a HGST HTS541075A9E680 hard drive, 
connected to my PC through a 
USB3 HDD enclosure (USB ID 05e3:0731).

While trying to find more information about this issue, I came across someone 
else's blog post about 
the same issue I'm having, which includes some in-depth analysis:
http://nunix.fr/index.php/linux/7-astuces/65-too-hard-to-be-above-2tb

It seems that the kernel uses less reliable means to get details about such 
devices than hdparm 
does.

I'm using the kernel that's shipped in openSUSE 13.2.

=== Tom Yan replied: ===

It is probably because of this:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/storage/scsiglue.c?h=v4.4#n217

SCSI READ CAPACITY (10) will not return "Logical blocks per physical block 
exponent" like READ 
CAPACITY (16) does:

[tom@localhost ~]$ sudo sg_readcap /dev/sdc
Read Capacity results:
   Last logical block address=468862127 (0x1bf244af), Number of blocks=468862128
   Logical block length=512 bytes
Hence:
   Device size: 240057409536 bytes, 228936.6 MiB, 240.06 GB

[tom@localhost ~]$ sudo sg_readcap -16 /dev/sdc
Read Capacity results:
   Protection: prot_en=0, p_type=0, p_i_exponent=0
   Logical block provisioning: lbpme=0, lbprz=0
   Last logical block address=468862127 (0x1bf244af), Number of logical 
blocks=468862128
   Logical block length=512 bytes
   Logical blocks per physical block exponent=3 [so physical block length=4096 
bytes]
   Lowest aligned logical block address=0
Hence:
   Device size: 240057409536 bytes, 228936.6 MiB, 240.06 GB

-- 
Pali Rohár
[email protected]

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to