Re: fdisk does not allow overwrite default/suggested value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Istvan,

> https://linux-blog.anracom.com/2018/12/03/linux-ssd-partition-alignment-problems-with-external-usb-to-sata-controllers-i/

First of all, the ATA protocol can only express logical and physical
block sizes. So the optimal I/O size is always 0 when a disk is
connected via a "native" ATA controller.

USB storage, however, is a SCSI protocol. In that configuration it is up
to the USB bridge device to translate properties reported by the
attached ATA device to the relevant fields in the SCSI protocol. And
this is where several devices get it wrong (despite a fairly
comprehensive document describing how each field should be translated).

The SCSI block storage protocol permits reporting an optimal I/O
size. Since there is no corresponding ATA parameter, it means that the
value in your case inevitably comes from the USB bridge firmware. There
is nothing to base this value on from the ATA device itself, so the
bridge firmware authors either made it up or forgot to zero the field.

As a result of reports similar to the one above, I added an additional
heuristic to the SCSI disk driver code a while ago. The kernel will now
reject a device-reported optimal transfer size if it is not a multiple
of the physical block size. So in the buggy USB-SATA bridge case above
the optimal transfer size should be reported to user space as 0 and
therefore fdisk should align on a 4096-byte (physical block size)
boundary.

Note that this is somewhat orthogonal to your request about being able
to override the reported values in fdisk. I just thought some of the
text in the links you posted warranted clarification.

The question is why your kernel does not have the patch adding this
additional heuristic?

-- 
Martin K. Petersen	Oracle Linux Engineering



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux