Subject: Re: How to change serial baud rate on already installed bootblocks
To: Job Hanssen <job.hanssen@xs4all.nl>
From: Job Hanssen <job.hanssen@xs4all.nl>
List: port-i386
Date: 09/06/2007 09:03:02
David Laight schreef:
> On Wed, Sep 05, 2007 at 06:43:32PM +0200, Job Hanssen wrote:
>> Problem solved...
>>
>> Suddenly it hit me: I shouldn't have reinstalled the bootblocks on 
>> /dev/rdw0a, but on /dev/rdw0d, as this is wat the disklabel looks like:
>>
>> testbak# disklabel /dev/rwd0
>> # /dev/rwd0d:
> ...
>> 13 partitions:
>> #        size    offset     fstype [fsize bsize cpg/sgs]
>>  a:   2097152        63     4.2BSD   2048 16384 21848  # (Cyl.      0*-   
>>  2080*)
>>  b:   8388608   2097215       swap                     # (Cyl.   2080*-  
>>  10402*)
>>  c: 488397105        63     unused      0     0        # (Cyl.      0*- 
>>  484520)
>>  d: 488397168         0     unused      0     0        # (Cyl.      0 - 
>>  484520)
> ...
>> testbak# hexdump -x -s0x418 -n4 /dev/rwd0a
>> 0000418    c200    0001
>> testbak# hexdump -x -s0x418 -n4 /dev/rwd0d
>> 0000418    9600    0000
> 
> Hmmm...  I suspect things have got themselves very confused!

I suspect that _I_ have got things very confused! ;-)

> The disklabel looks like a 'standard' i386 pc config with a single
> type 169 mbr partition covering all but the first track.
> In that case sector zero of the disk would usually contain one of
> /usr/mdec/mbr* files, and sector 63 (ie the first of the mbr partition)
> /usr/mdec/bootxx_xxxfs.
> For various reasons the pbr code does have space for the mbr table,
> so it does all work - but is somewhat confusing - as you found out.

I'm not sure what you mean with pbr code.

Appearently there's no 'real' mbr at the moment:

testbak# fdisk
Disk: /dev/rwd0d
NetBSD disklabel disk geometry:
cylinders: 484521, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 488397168

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 488397168

Partition table:
0: <UNUSED>
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>

testbak# disklabel /dev/rwd0
# /dev/rwd0d:
type: ESDI
disk: WDC WD2500JB-00E
label: netbsd
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 484521
total sectors: 488397168
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

13 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
  a:   2097152        63     4.2BSD   2048 16384 21848  # (Cyl.      0*-   2080*)
  b:   8388608   2097215       swap                     # (Cyl.   2080*-  10402*)
  c: 488397105        63     unused      0     0        # (Cyl.      0*- 484520)
  d: 488397168         0     unused      0     0        # (Cyl.      0 - 484520)
  e:   4194304  10485823     4.2BSD   2048 16384 21848  # (Cyl.  10402*-  14563*)
  f:  20971520  14680127     4.2BSD   2048 16384 28088  # (Cyl.  14563*-  35368*)
  g:  20971520  35651647     4.2BSD   2048 16384 28088  # (Cyl.  35368*-  56173*)
  h:  20971520  56623167     4.2BSD   2048 16384 28088  # (Cyl.  56173*-  76978*)
  i:  20971520  77594687     4.2BSD   2048 16384 28088  # (Cyl.  76978*-  97783*)
  j:  20971520  98566207     4.2BSD   2048 16384 28088  # (Cyl.  97783*- 118589*)
  k:  20971520 119537727     4.2BSD   2048 16384 28088  # (Cyl. 118589*- 139394*)
  l:  20971520 140509247     4.2BSD   2048 16384 28088  # (Cyl. 139394*- 160199*)
  m:  41943040 161480767     4.2BSD   2048 16384 28088  # (Cyl. 160199*- 201809*)


Suppose I were to make this system behave as it's supposed to. How would I go 
about it?

- install a new mbr on /dev/rwd0d (using fdisk I suppose?). I suppose I would feed 
it with the data from disklabel on partition c as input?
- set the NetBSD-partition as active (also using fdisk)
- (re)install the bootblock on /dev/rwd0a as already discussed in this thread.


Regards,

Job Hanssen