Subject: RE: NetBSD Hang after disklabel, xsm crash
To: None <port-i386@NetBSD.ORG>
From: Todd Whitesel <toddpw@best.com>
List: port-i386
Date: 07/28/1998 21:42:56
HB> But anyway: The system should complain with an error message, not a
HB> freeze!

Amen.

TPW> I think your best bet is to zero-wipe that disk or hard-format it, to
TPW> remove the magic bits that make NetBSD think there is a label on it. 
HB> Ehh... I'll be glad to, but how? I know that some five years ago I was
HB> taught that you should never low-level format IDE disks anymore, because
HB> you could destroy the disk, so tell me how, and I'll get right to it.

Hmm, I keep a commercial disk partitioner (OnTrack Disk Manager) around for
just this sort of emergency. This would be a good function to add to
PFDISK.EXE, since we really only need to blast the disklabels, not the
whole disk. Does anyone happen to know the current maintainer of PFDISK?

HB> I am a bit confused about this; on my pmax with NetBSD 1.3.1 (i believe)
HB> I am using the c-partition w/o problems, and was told to do so by
HB> someone.

Yes. Use of c-partition is traditional.

HB> In some docu for the i386 it seemed like it was normal to use the d
HB> partition for all of the disk.

Heh. On i386 the safest practice is to use d-partition for the whole raw
disk, and c-partition for the area that contains the NetBSD partitions.
In your case both c and d would cover the entire disk.

JW> This may not work - the kernel will want to know about the c partitoon and
JW> will read the disklabel - and if the disklabel is what is causing the
JW> problem in the first place...

Alert! Bogons detected. This is one thing about disklabels that has always
pissed me off. I intend to propose some solutions to it, but I need to
learn more about the current state of things first.

GH> OK, now I'm confused. I thought that using partition d was a bad idea
GH> but using partition c was OK, at least if c is offset 63 sectors from
GH> the beginning of the disk.

Early in my SunOS career I decided that a disk with just "c" on it was a
blank disk and that a disk with both "c" and some other partition (like "g")
set to the whole disk was a used disk with a single huge filesystem on it.
Partitions that weren't used were set to zero size but their starting
cylinder was left intact for future reference. With NetBSD I can just set
their type to 'unused' -- that is much clearer.

The actual filesystem will avoid trashing the first block of its partition.
You could newfs+mount either c or d, but since those already represent
things independent of the filesystem layout, I advise against it. I prefer
using "a" (bootdisk or removable) and "e" (/usr or data disk). But I always
set "c" (and "d" on i386) so that the supposed crowd of scripts and programs
out there will be able to use those devices safely.

Todd Whitesel
toddpw @ best.com