[parted-devel] [PATCH 6/6] libparted: fix optimal IO alignment

Phillip Susi psusi at ubuntu.com
Thu Dec 20 16:35:02 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/19/2012 7:58 PM, Brian C. Lane wrote:
> I am naturally reluctant to change things without a specific
> problem. If I'm reading the bug correctly this was mostly to clean
> up some corner cases, it was already using 1MiB most of the time.

Can you provide any more detail on those corner cases?

> I really don't know anything about what the kernel returns when.
> Isn't it usually up to the admin to setup special cases like RAID?

No, md and lvm automatically return correct values.  The only time an
admin might need to change things is for bare hard drives, which the
kernel just returns zeros for because it can't be sure about what the
optimal alignment is on them.  Ideally if you know the drive uses 512b
or 4k sectors, or has a 512k erase block for flash, you would want to
use those values.

> In my experience with hardware (generally, not any specific
> device) there is always someone who gets it wrong. So unless the
> kernel takes this into account we should keep some sanity checking
> in parted.

The kernel just returns zeros for drives exactly for this reason, in
which case going with 1 MiB default is a good best guess.  Hopefully
in the future this situation will improve and the hardware can report
appropriate values that the kernel can then pass up the stack.

For instance, some drives use 4k physical sectors with a -1 sector
offset so that sector 63 ends up aligned so that older operating
systems won't have a problem.  If the kernel can reliably detect this
from the drive then it can pass that information up the stack, and lvm
at least will make sure to align logical volumes so that they start at
sector 63 + some multiple of 4k.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQ0z42AAoJEJrBOlT6nu75xNMH/0ZeNPQxHbJQ2xhzOvXoJMnK
5Cqv02lBoM6oLuFvaNWmTByO98q7ZdSKGfZv2pCFqXbTfdMxYEEGt6H1BCUsJac2
CkUf+4Y1W10cnz9mHrHIsKMFdXsVPpD5fpgaaAiKTzqukZzzbR7mqeiGFQEZq2Lo
qMSKXdUlo2/H2aYwqLNNMhnHPbuVFi+PeUbzmtsbMiH6drbkqOVPBxmWKrTL5RVc
BTFQGf6rXoLCE51NoR5xj6YyWiisIHqkQQ62lC5dmpBTg+HHfRbLXY2znCvkXhuJ
09YxqFdWpAZxVj3AtDCHpRbC1TROpkRzVM0dYmc7GX3pUfEtaCLTlV6/H2sh1EE=
=BlGP
-----END PGP SIGNATURE-----



More information about the parted-devel mailing list