[lkml]   [2010]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: ATA 4 KiB sector issues.
    > S-2. The proper solution.
    > Correct alignments for all partitions can't be achieved by the
    > firmware alone. The system utilities should be informed about the
    > alignment requirements and align partitions accordingly.
    > The above firmware workaround complicates the situation because the
    > two different configurations require different offsets to achieve
    > the correct alignments. ATA/ATAPI-8 specifies a way for a drive to
    > export the physical and logical sector sizes and the LBA offset
    > which is aligned to the physical sectors.
    > In Linux, these parameters are exported via the following sysfs
    > nodes.
    > physical sector size : /sys/block/sdX/queue/physical_block_size
    > logical sector size : /sys/block/sdX/queue/logical_block_size
    > alignment offset : /sys/block/sdX/alignment_offset
    > Let the physical sector size be PSS, logical sector size LSS and
    > alignment offset AOFF. The system software should place partitions
    > such that the starting LBAs of all partitions are aligned on
    > (n * PSS + AOFF) / LSS
    > For 4 KiB physical sector offset-by-one drives, PSS is 4096, LSS 512
    > and AOFF 3584 and with n of 7 the above becomes,
    > (7 * 4096 + 3584) / 512 == 63
    > making sector 63 an aligned LBA where the first partition can be
    > put, but without the offset-by-one mapping, AOFF is zero and LBA 63
    > is not aligned.
    > With the above new alignment requirement in place, it becomes
    > difficult to honor the legacy one - first partition on sector 63 and
    > all other partitions on cylinder boundary (255 * 63 sectors) - as
    > the two alignment requirements contradict each other. This might be
    > worked around by adjusting how LBA and CHS addresses are mapped but
    > the disk geometry parameters are hard coded everywhere and there is
    > no reliable way to communicate custom geometry parameters.

    I have practically no knowledge of Linux' block device drivers,
    but is this really a partitioning issue? I think the problem is
    with the filesystems when clustering multiple blocks without
    knowledge of the sector alignment and sector size of the underlying
    block device. Maybe it is a better solution to adapt the filesystem
    buffer routine which reads/writes data from/to the block device?

    Best regards

     \ /
      Last update: 2010-03-10 17:23    [W:0.033 / U:123.528 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site