New BSD Installer

Jeremy Chadwick freebsd at
Tue Feb 14 20:15:34 UTC 2012

On Tue, Feb 14, 2012 at 12:05:31PM -0800, Devin Teske wrote:
> Please don't get rid of fdisk or bsdlabel as they are (and forever will be)
> required to do things like:
> 1. scripted formatting of a thumb drive

Can't this be done with gpart(8)?  There are scripts all over the web
and on the lists here showing people using it for that purpose.  It
doesn't require use of GPT either.

> 2. automated probing of disk information (fdisk -p)

Can't this be accomplished with "gpart list"?  Yes I know the man page
doesn't appear to have it documented, but it's there.  Furthermore,
fdisk -p shows silly things like C/H/S nomenclature; do you really use
this?  Do you have boards which don't support even the most basic 28-bit
LBA addressing?

> 3. Other tasks that are not suitably handled by curses-based utilities
> ...
> For example, the following command will create a second Windows partition on a
> thumb drive without user interaction:
> 	echo "p 2 0x0c * *" | fdisk -f - /dev/da0
> If you take away fdisk, how am I supposed to achieve the above?

Again: gpart(8).  And before you complain: yes, I am in full agreement
that introduction of gpart into the fray should have probably been "more
public".  The syntax of the gpart commands takes some getting used to as
well (some things are hardly intuitive, but eventually make sense once
you see them in use).

I'm happy to use gpart for scripting, while fdisk/bsdlabel are like
pulling teeth.  That said, like others, I would be thrilled to see fdisk
and bsdlabel/disklabel disappear.  However, for that to happen, I really
expect gpart to be better documented.  Hell, all of the GEOM-based g*
utilities should be implemented slightly... differently.  It's hard to
explain what I mean by this.  Play with the geom(8) command sometime to
see what I mean.  "geom list" says to use "geom list list", etc..  Once
you delve into the code to see how it all works it then starts making
more sense why the utilities behave this way, but it's completely and
entirely non-intuitive to anyone not already familiar with it.

| Jeremy Chadwick                                 jdc at |
| Parodius Networking            |
| UNIX Systems Administrator                 Mountain View, CA, US |
| Making life hard for others since 1977.             PGP 4BD6C0CB |

More information about the freebsd-stable mailing list