Subject: Re: fdisk from a scripts
To: None <netbsd-help@netbsd.org>
From: Wolfgang Rupprecht <wolfgang+gnus20020829T131131@wsrcc.com>
List: netbsd-help
Date: 08/29/2002 13:18:50
reed@reedmedia.net (Jeremy C. Reed) writes:
> On 28 Aug 2002, Wolfgang Rupprecht wrote:
> 
> >         fdisk -0 -s 169 /dev/${to}
> >
> > The above seems to do nothing...
> 
> I think you need "-s 169/start/size" (where start and size are in
> sectors).

The key was that the command line also needed the christmas-tree
string "-fuia" added.  Without it the settings never seemed to get
written to the disk.  The full command needed to make a disk with one
honking partition is:

    to='wd2'
    eval `fdisk -S ${to}`
    SZREST="$(($DLSIZE - $DLSEC))"
    fdisk -fuia -0 -s 169/$DLSEC/$SZREST ${to}

-wolfgang
-- 
       Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
		    http://www.wsrcc.com/wolfgang/
      Hackers don't spread viruses.  Microsoft spreads viruses.