GPT and disk alignment
Robert Simmons
rsimmons0 at gmail.com
Wed Jun 8 05:29:44 UTC 2011
On Wed, Jun 8, 2011 at 12:29 AM, Mark Felder <feld at feld.me> wrote:
> On Tue, 07 Jun 2011 22:27:24 -0500, Robert Simmons <rsimmons0 at gmail.com>
> wrote:
>> Do all HDDs that have 4KB per LBA present themselves to the OS as
>> having 512 bytes per LBA?
>
> No
Ok, but can I assume that all HDDs of this type expand each of the 4K
sectors so that physically they take up the same space as eight 512
byte LBAs? AFAIK, the new 4K LBA has a smaller ECC area than the sum
of 8 ECC areas in 512 byte LBAs, so if the data area was _not_
expanded slightly, you would never really be aligned except every x
LBAs as the shifting approaches an LBA boundary, right?
For any HDDs, do I need to worry about cylinder boundaries at all?
Has the reported "disk geometry" become divorced from the physical
reality in modern disks? If I do still need to worry about cylinder
boundaries, should I basically ignore every reported geometry (BIOS,
OS) and use what is written on the sticker on the drive?
>> What about SSDs that have 1024 bytes per LBA?
>
> Not sure, but I do know that not all flash media have the same bytes per LBA
> internally. Some are 1K, some 4K, some even 8K. GPT is definitely the way to
> go if you want to make sure you're aligned.
Ok, is there some way to tell gpart(8) what the LBA size is, or do I
have to calculate the offset of each partition manually? In Linux it
would be "fdisk -b 1024" for the example of SSDs or "fdisk -b 4096"
for 4K HDDs.
Can I just ignore the idea of "cylinder boundaries" completely when
dealing with SSDs and flash memory?
More information about the freebsd-fs
mailing list