Subject: Re: Pain about disklabel
To: None <curt@portal.ca>
From: David Mazieres <dm@amsterdam.lcs.mit.edu>
List: port-i386
Date: 01/11/1996 13:18:50
> Date: Wed, 10 Jan 1996 19:31:00 -0800 (PST)
> From: Curt Sampson <curt@portal.ca>
> cc: earle@isolar.Tujunga.CA.US, port-i386@NetBSD.ORG
> MIME-Version: 1.0
> Content-Type: TEXT/PLAIN; charset=US-ASCII
> Sender: owner-port-i386@NetBSD.ORG
> Precedence: list
> X-Loop: port-i386@NetBSD.ORG
> 
> > >  Today I hooked up a new hard drive to my Pentium machine.  Drive is for
> > > NetBSD only.  Thought all I had to do is to edit a disklabel and write that
> > > one.  Disklabel reports me that there is an illegal DOS partition without
> > > NetBSD-id.  The drive was never been partitioned under DOS, nor does
> > > DOS-fdisk report any partitions.
> 
> Was that the exact error message? I've not seen it before, and I
> don't understand it the way it's currently phrased.
> 
> > >  My question:  What am I supposed to do before/while hooking a new drive?
> > > Is "pfdisk" the answer for all new drives, even if for NetBSD-only?
> > 
> > I believe so....  Since I was doing a fresh
> > install, maybe it was easier, since that mandates running "pfdisk" and
> > assigning a "NetBSD"-tagged partition, etc.
> 
> No, this is not necessary. I currently have ten NetBSD drives
> nearby, few of which which have ever had DOS or Windows95 lay their
> creepy little hands on them. :-) If it's a new drive, you can just
> `disklabel -r -R sd0 protofile' (or whatever options you find
> appropriate) and forget about a DOS partition table altogether.
> Life is much, much easier this way.

First, I think you probably need "disklabel -w -B" to ignore
everything on the disk.  Second, I once had trouble convincing an old
version of disklabel to clobber an fdisk-style boot block.  I was able
to fix the problem with "dd if=/dev/zero of=/dev/rsd1d" which I let
run for a little while before interrupting (obviously sd1 was the new
disk which contained no valid data).  That clobbered anything that
might have looked like a valid fdisk partition on sd1.  Note that I
used rsd1d and not rsd1c.

David