[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <4B97C6A5.4010209@tvk.rwth-aachen.de>
Date: Wed, 10 Mar 2010 17:19:49 +0100
From: Damian Lukowski <damian@....rwth-aachen.de>
To: "linux-ide@...r.kernel.org" <linux-ide@...r.kernel.org>
Cc: Jeff Garzik <jeff@...zik.org>, Matthew Wilcox <matthew@....cx>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
James Bottomley <James.Bottomley@...e.de>,
Tejun Heo <tj@...nel.org>, lkml <linux-kernel@...r.kernel.org>,
Daniel Taylor <Daniel.Taylor@....com>,
Mark Lord <kernel@...savvy.com>, tytso@....edu,
"H. Peter Anvin" <hpa@...or.com>, hirofumi@...l.parknet.co.jp,
Andrew Morton <akpm@...ux-foundation.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>, irtiger@...il.com,
aschnell@...e.de, knikanth@...e.de, jdelvare@...e.de
Subject: Re: 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.
Hello,
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
Damian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists