gpart, to -a 4k or to -b 1M

Warren Block wblock at wonkity.com
Sat Nov 16 00:17:00 UTC 2013


On Fri, 15 Nov 2013, aurfalien wrote:

> Hi,
>
> Curious, for best practice in ensuring 4K alignment, should one do;
>
> gpart add ... -b 1M
>
> or
>
> gpart add ... -a 4k
>
> Thank in advance,

They do different things.  '-b 1M' starts the added partition at 1M 
but does not force it to be a multiple of 4K in size.

'-a 4k' forces the added partition to start at the next 4K-aligned 
block, and forces the size to be a multiple of 4K.

I recommend both for the first filesystem partition, and '-a 4k' for 
later ones.


More information about the freebsd-questions mailing list