Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Mar 2010 13:01:09 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: ATA 4K sector issues
Message-ID:  <86y6hpj0u2.fsf@ds4.des.no>
In-Reply-To: <201003172023.o2HKNNbj069321@apollo.backplane.com> (Matthew Dillon's message of "Wed, 17 Mar 2010 13:23:23 -0700 (PDT)")
References:  <alpine.BSF.2.00.1003171114280.74067@mignon.ki.iif.hu> <86tysf58a2.fsf@ds4.des.no> <alpine.BSF.2.00.1003171652260.74067@mignon.ki.iif.hu> <f8e3d83f1003171034m5e75eae4r5e8b31d88d361d3b@mail.gmail.com> <367b2c981003171112n785ea9d4q21d00b533819ca67@mail.gmail.com> <f8e3d83f1003171117k20d553b7y7ce4c3c8ed2f5c96@mail.gmail.com> <201003172023.o2HKNNbj069321@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Dillon <dillon@apollo.backplane.com> writes:
> We experimented a bit with aligning fdisk (dos slices) by changing the
> sector offset to 2 but I came to the conclusion that it was better to
> do the alignment in disklabel / gpt / whatever higher-level
> partitioner floats your boat and not mess with anything the BIOS uses
> to boot the machine

Not sure what you mean by "changing the sector offset to 2", but the
BIOS doesn't care where partitions start or end.  It just obeys the
partition table.

> My recommendation is to use a 1MB physical base alignment.  That's
> what I adjusted DragonFly's disklabel64 to do.  It's definitely best
> to have the partitioner deal with it instead of having to mess around
> manually because the partitioner can calculate the actual physical
> alignment by querying the kernel's disk subsystem regardless of the
> topology.

The disk system doesn't necessarily know.  Disks have been known to lie
about their physical sector size.  The best strategy is to consistently
use a large alignment "just in case".  Using a 4k or 8k or even 1M
alignment has no negative impact on 512b disks (other than that it
wastes a very small amount of disk space), but for a 4k disk or an SSD,
it can make the difference between "dog slow" and "lightning fast".

> * A variety of media already uses much larger physical block sizes.
>   MLC flash uses 128K and SLC uses 64K blocks.  See the note below
>   on why this matters even though SSDs do write combining.

Some SSDs do RAID0 internally and therefore have larger block sizes.
ISTR the OCZ Vertex is made up of four SATA SSDs with a microcontroller
in front.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86y6hpj0u2.fsf>