Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jun 2011 01:32:03 -0400
From:      Robert Simmons <rsimmons0@gmail.com>
To:        questions@freebsd.org
Subject:   Re: Partitioning with gpart or old style slices?
Message-ID:  <201106050132.04159.rsimmons0@gmail.com>
In-Reply-To: <20110605065944.4cab117a.freebsd@edvax.de>
References:  <4DEAAE54.1050508@locolomo.org> <20110605044021.GA2213@tinyCurrent> <20110605065944.4cab117a.freebsd@edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday, June 05, 2011 12:59:44 AM Polytropon wrote:
> On Sun, 5 Jun 2011 06:40:22 +0200, Matthias Apitz <guru@unixarea.de> wrote:
> > Since some time I'm as well using gpart(8) to setup new systems with the
> > following sequence:
> > 
> > # gpart create -s mbr ad4                 # Init the disk with an MBR
> > # gpart add -t freebsd ad4                # Create a BSD container
> > # gpart create -s bsd ad4s1               # Init with a BSD scheme
> > # gpart add -t freebsd-ufs  -s 1G ad4s1   # 1GB for /
> > # gpart add -t freebsd-swap -s 2G ad4s1   # 2GB for swap
> > # gpart add -t freebsd-ufs  -s 2G ad4s1   # 2GB for /var
> > # gpart add -t freebsd-ufs  -s 1G ad4s1   # 1GB for /tmp
> > # gpart add -t freebsd-ufs ad4s1          # all rest for /usr
> > # gpart set -a active -i 1 ad4
> 
> Just a side question that may be interesting for addition
> in a new Handbook section:
> 
> When you use the "old" method, you can leave out the slicing
> step, creating a "dangerously" (haha) dedicated disk for
> use with FreeBSD. Would this also work with gpart by omitting
> the "gpart create -s bsd ad4s1" step and then refering to
> ad4 instead of ad4s1 in the "gpart add -t freebsd-ufs/swap"
> steps?

Yes, that would be the equivalent, but if you do that, you might as well use 
GPT.  The reason you would want to use MBR is to dual boot with another OS 
that only understands MBR.  If you are using certain newer 64bit versions of 
Windows, they understand GPT boot, so the whole BSD inside MBR vs. BSD 
dedicated is becoming moot in my opinion.  A good reference if you must dual 
boot is:
http://msdn.microsoft.com/en-us/windows/hardware/gg463525

Also, at the bottom of this page is a list of OSs and GPT support:
http://en.wikipedia.org/wiki/GUID_Partition_Table

> > But the result is not ready for boot after install the kernel and
> > system; I allways have to go again with the sysinstall(8) tool to set
> > the 'A' flag; don't know what I'm missing (and the man page is not very
> > instructive on this); thanks
> 
> I agree about the manpage; "gpart set -a attrib -i index [-f
> flags] geom" is mentioned in the synopsis, but there's no
> further mentioning of the -a option and its parameters.
> Maybe (haven't tested!) "gpart set -a active -i 1 ad4s1"
> is equivalent to setting the "A" flag using sysinstall?

After reexamining the man page I think I see where it could be made more 
clear.  The Examples section at the bottom should be changed into sections, 
one for MBR with BSD inside, one for BSD dedicated, one for GPT, and one for 
VTOC8.

Or at minimum add that you _must_ install bootcode if you wish to boot from 
the disk.  From the confusion above it seems that people think that "gpart 
create -s GPT ad0" installs the bootcode, which it does not (replace the GPT 
in my example with MBR, BSD etc).



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