Subject: after fdisk'ing SCSI, can't boot DOS
To: None <berke@panix.com>
From: Gordon W. Ross <gwr@jericho.mc.com>
List: port-i386
Date: 01/03/1995 15:05:50
> Date: Tue, 03 Jan 1995 11:54:58 -0500
> From: Wayne Berke <berke@panix.com>
> 
> I'm not sure if my problem is related or not.
> 
> I'm trying to get NetBSD and DOS to coexist on an AST Pentium box with
> a 730M Quantum Lightning SCSI2 disk (NCR 53C810 card).

I'll try to tell you how to use pfdisk to make them coexist.

[ installed NetBSD on whole disk ]

> The only problem is, after I use either fdisk or pfdisk to create a new
> primary partition (with no errors), I can no longer boot DOS, even from
> the floppy.  My boot disk (MSDOS 6.20) gets as far as printing
> "Starting MS-DOS", then just hangs (with both floppy and hard drive
> lights off).  This happens whether I partitioned the whole disk for DOS
> or just part of it.

Gotta love MS-DOS (sigh...)

> Paradoxically, the only way I can now get it to boot off a DOS floppy is to
> first re-install NetBSD!  But then I'm back to square one.

I.e. a _REAL_ OS (snicker 8-)

> Has anyone else seen this kind of thing?  The guys at AST recommended
> various useless things like doing an "fdisk /mbr" and clearing the EISA CMOS
> before partitioning.  None of this made any difference.  Maybe I need some
> low level disk formatter/editor?

Typical tech support:  "Duh, UNIX? uh..."

I would probably try booting good-old DOS 3.3 or something.
Also, make sure the CMOS is set up as directed by the documentation
that came with your SCSI disk controller. (i.e. some tell you to set
the CMOS "drive type" to _one_ -- not that it makes any sense...)

> Interestingly enough, right after installing NetBSD and booting DOS, fdisk
> and pfdisk both tell me that there's a single 24M partition (50,000 sectors)
> at the beginning of the disk with the 165 sys_id.  It doesn't matter what
> parameters I had previously given to the install program: how big I want
> the NetBSD partition, the offset, even the size of the overall disk.  Nor
> does it matter how I've partitioned the disk before installing NetBSD.  No
> matter what I do, after the NetBSD install fdisk always sees a single
> partition with size 24M.

That sounds a bit strange...

> This is how the partition looks under pfdisk (my real geometry according
> to NetBSD is 3657 x 4 x 97).

That looks like the result of having garbage in the MBR fdisk table.

> 	pfdisk> # Partition table on device: 0
> 	geometry 88 256 63 (cyls heads sectors)
> 	#  ID  First(cyl)  Last(cyl)  Name  # start, length (sectors)
> 	1   0      0          0       empty # 0, 0
> 	2   0      0          0       empty # 0, 0
> 	3   0      0          0       empty # 0, 0
> 	4 165      0          3       unkno # 0, 50000
> 	# note:  last(4): phys=(1023,255,63) logical=(3,25,41)
> 	# note: first(4): phys=(0,0,1) should be (0,1,1)
> 	active: 4
> 	pfdisk> 

Yes.  The garbage is evident in the listing above.

Whatever created that partition table set the "last" (c,s,h) fields
to (3,25,41) and from that, NetBSD concludes that the disk has only
four cylinders, 26 heads, and 41 sectors (about 20 MB) because the
NetBSD driver just believes what it sees in "last" field.

When you ran pfdisk and it told you:

> 	geometry 88 256 63 (cyls heads sectors)

that was probably correct.  If you multiply that out, you get
about 710 MB, which sounds about right.  So, you should just
get pfdisk running from somewhere (NetBSD?) and give something
like the following:  (with sizes adjusted to your liking)

	# Read in the boot program
	R bootauto.bin
	# Partition table on device: 0
	# geometry 88 256 63 (cyls heads sectors)
	#  ID  First(cyl)  Last(cyl)  Name  # start, length (sectors)
	1   6      0         10       DOS
	2   0      0          0
	3   0      0          0
	4 165     11         87       NetBSD
	A 4
	WQ

The above makes a DOS6 partition in the first 10% or so, and
makes the remaining 90% into a NetBSD partition.

> Thanks in advance for any insights, and
> Happy New Year!

You're welcome.  I hope you get it going.

Gordon Ross