Aligning MBR for ZFS boot help

Cody Ritts cr at caltel.com
Mon Mar 11 21:31:50 UTC 2013


On 3/11/13 12:52 PM, Adam Nowacki wrote:
>>> I also don't think there is any merit in aligning to 1MiB. Most ZFS IOs
>>> will be aligned to sector size (ashift). Unless ZFS pool is created with
>>> higher ashift then the 63 sector offset is as good as any.
>>
>> Aligning to the Erase block:
>>
>> http://blog.nuclex-games.com/2009/12/aligning-an-ssd-on-linux/
>> Also I will be forcing ashift to 12 using the gnop trick.
>>
>> If you still feel that is not necessary, I would be interested in
>> knowing why?
>
> The mapping between sectors and physical flash pages/blocks is not fixed
> and will change on each write or internal garbage collect.
> http://www.devwhy.com/blog/2009/8/4/from-write-down-to-the-flash-chips.html
> seems to explain this nicely. Aligning to more than page size offers no
> benefit since this is the biggest continuous chunk of data that remains
> continuous all the way to physical flash.
>
> If your SSD has page size of 4KiB then align to that. This is sector 504
> on FreeBSD (due to the multiple of 63 issue). ZFS pool will have to be
> created with ashift=12.

hmmmm...  I see the point you are making, and there is so much that I 
dont know about zfs, SSDs and ATA.

There is a commenter on there who certainly seems to agree with you:
https://github.com/zfsonlinux/zfs/pull/924

But the vast majority of pages that claim aligning the partition 
boundaries to multiples of the erase block is really important.  (Not 
that more pages makes it correct)

But if you are right, and aligning to the erase block is pointless 
because the SSD doesn't care, then it should not hurt if I do add an 
offset, other than I will loose a few MB of space.

It is certainly a good point you make but I just don't have the time to 
learn everything I need to know to make an educated decision for myself. 
  So if I can satisfy the majority with no detriment, I will just do 
that so I can get this thing into production.

Thanks

Cody




More information about the freebsd-fs mailing list