Subject: Re: unbootable new disk?
To: Greywolf <greywolf@starwolf.com>
From: Steven M. Bellovin <smb@research.att.com>
List: current-users
Date: 11/24/2004 19:30:20
In message <Pine.NEB.4.51.0411241437260.448@lothlorien.starwolf.com>, Greywolf 
writes:
>[Thus spake Christos Zoulas ("CZ: ") 12:52pm...]
>
>CZ: Which means that the fdisk partition has the wrong magic? I am just guessi
>ng.
>CZ:
>CZ: I would escape to shell and:
>CZ:
>CZ: 1. Run fdisk -u and make sure you write in the partition in question
>CZ:    so that the magic gets fixed [in case that was broken].
>CZ: 2. Run fdisk -i to update the mbr; this will use the standard console. You
>CZ:    can change it later.
>CZ: 3. Run disklabel -r wd0 to see if the label is there. If not, you can use
>CZ:    disklabel -I -ir wd0 to create it interactively. If it is there, you
>CZ:    can use disklabel -ir wd0 to edit it.
>
>4.  Make sure you set the fdisk partition in question to be "Active" via
>	fdisk -a?

I had done that.

The problem isn't loading the MBR, since I'm getting the boot selector 
prompt and can even use F2 to switch to the other drive.  I can indeed 
read the disk label.  I've even checked the block numbers for /boot via 
fsdb; the answer look low enough:

Direct blocks:
0: 1504 1512 1520 1528 1536 1544 1497 

that I don't think I'm hitting some ancient BIOS limit.  I reconfigured 
the hardware to make it wd1 so that I could boot a different disk; 
here's what I have after reinstalling again (yes, I zero'd the start of 
the drive), this time using the default console:

# fdisk wd1
Disk: /dev/rwd1d
NetBSD disklabel disk geometry:
cylinders: 310101, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 312581808

BIOS disk geometry:
cylinders: 1024, heads: 240, sectors/track: 63 (15120 sectors/cylinder)
total sectors: 268435455

Partition table:
0: NetBSD (sysid 169)
    bootmenu: NetBSD
    start 63, size 312581745 (152628 MB, Cyls 0-20673/96/1), Active
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector disabled.
# disklabel -r wd1
# /dev/rwd1d:
type: unknown
disk: SAMSUNG SP1604N
label: 
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 310101
total sectors: 312581808
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 310483152        63     4.2BSD   1024  8192 46664  # (Cyl.      0*- 308019*)
 b:   2098593 310483215       swap                     # (Cyl. 308019*- 310100)
 c: 312581745        63     unused      0     0        # (Cyl.      0*- 310100)
 d: 312581808         0     unused      0     0        # (Cyl.      0 - 310100)

I'll retry the installboot later this evening.  (I'm not 100% certain I 
specified the raw disk when I ran installboot, but if that was the 
problem there's a definite bug in sysinst.)

		--Steve Bellovin, http://www.research.att.com/~smb