Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2012 04:41:32 -0800
From:      "Ronald F. Guilmette" <rfg@tristatelogic.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Advanced Format Drive ?
Message-ID:  <21828.1352983292@tristatelogic.com>
In-Reply-To: <alpine.BSF.2.00.1211142250370.58597@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help

In message <alpine.BSF.2.00.1211142250370.58597@wonkity.com>, 
Warren Block <wblock@wonkity.com> wrote:

>On Wed, 14 Nov 2012, Ronald F. Guilmette wrote:
>
>> I'm looking at the examples section of the gpart(8) man page.  May I
>> assume that if I just want to merely ``try out'' GPT... you know...
>> taking it out on the road for a first time test run... that I can
>> just do the first five (5) commands listed under EXAMPLES and then
>> that will be enough to go ahead and try installing FreeBSD into the
>> created freebsd-ufs partition?
>>
>> Even assuming that the answer is yes, I have still more questions...
>> Where are these magic numbers coming from??  I am specifically talking
>> about the number "34" in the "-b 34" option and also the number "162"
>> in the "-b 162" option.  Tha man page just tosses those into the example
>> command lines without saying a word about them.  And you can probably
>> guess what it is that is especially troubling to me about them... neither
>> one of them is divisible by 8 (i.e. 4KB/512B).  So would the examples
>> in the current gpart(8) man page produce an Epic Fail when and if they
>> were used with a modern "Advanced Format" drive?
>
>-b is the beginning block of a partition.  34 is a magic value, the size 
>of a standard GPT partition table.

It probably wouldn't have hurt anything to mention that in the gpart man
page.

And what about 162?  Is that magic too?  If so, how?  I seriously do not
know.

>A good overall reference on GPT is 
>the Wikipedia page: http://en.wikipedia.org/wiki/GUID_Partition_Table
>
>Remember that the man page is a reference, not a tutorial.

Actually, it is clearly both.

We all know that man pages are primarily supposed to be (minimal?) reference
documents, but you cannot claim with a straight face that any man page that
contains an EXAMPLES section is not also serving as a rudimentary tutorial.

Personally, I find the minimalist tutorials that are often found within
EXAMPLES sections of man page quite helpful, gpart(8) included.  But in
this specific case the pulling of number, apparently out of thin air (at
least from the point of view of the uninitiated) rather significantly
degrades the educational value.

>I wanted 
>more specific notes that followed best practices, and that was the 
>source for this article:
>http://www.wonkity.com/~wblock/docs/html/disksetup.html

It is very helpful (and very appreciated!) that you were kind enough to
create that document, which is clearly more unambiguously a tutorial.
But really, the gpart(8) man page got me about 97% of the way there,
even without me having to consult external references.  If it just
had not been for those mystery numbers...

>In general, you create a "partition scheme" first.  This can be MBR, 
>GPT, or others.  (But use GPT.)

Yea.  I got that part.

>Rather than combine the bootcode with the partition table, GPT just uses 
>a small partition for it.  Since the standard GPT allows for up to 128 
>partitions, there's no reason not to use them.

Got it.  Thanks.

>Next come other partitions for UFS or ZFS filesystems or swap.

Right.

>That's it, really.  The rest is details the man page can explain, like 
>additional options for alignment.  (The creation of the first UFS 
>partition in the article does not use -a because older versions of gpart 
>did unexpected things when -a and -b were combined.  The alignment 
>produced is correct.)

Questions:

In your tutorial document, you say:

     "Create a boot partition to hold the loader, size of 512K."

How big is that thing (gpart boot loader), actually?  Half a megabyte
seems rather a bit large-ish, certainly relative to ye olde MBR loader,
which I gather was limited to... what?  32KB (minus a little for the
partition table) ?

Also, when creating the partition to hold the GPT boot loader, shouldn't
that "gpart add" operation include a "-b 4k" option, you know, on a
modern "Advanced Format" disk?  If not, why not?

You also go on to say:

     "Create partition for /. It should start at the 1M boundary for proper
     sector alignment on 4K sector drives."

Come again?  Sorry, but you just lost me entirely.  In order to get "proper
sector alignment" on one of these newer Advanced Format (4k) drives, why
on earth should it be necessary to begin a partition at some alignment
which is greater than the obvious minimum, i.e. 4KB ?



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