Subject: Re: How to change serial baud rate on already installed bootblocks
To: None <port-i386@NetBSD.org>
From: Job Hanssen <job.hanssen@xs4all.nl>
List: port-i386
Date: 09/09/2007 09:44:03
David Laight schreef:
> On Thu, Sep 06, 2007 at 09:03:02AM +0200, Job Hanssen wrote:
>> I'm not sure what you mean with pbr code.
> 
> The code that resides in sector zero of the partition, this is the code
> that the mbr (sector zero of the disk) reads into memory and then execuctes.

Ok, that's clear.

>> - 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.
> 
> Sounds about right, except I'd install bootxx_ffsv1 into rwd0a first.

Yes, normally I would, but in this case, I had put it there already a few times 
while trying to get my console on 115200 baud... :-)

> Running fdisk interactively will save you typing the sector numbers,
> the partition type should be 169.
> 
> You also want to be careful of where the NetBSD disklabel is coming from.
> On a disk without an mbr table it is probably coming from sector 1,
> with a mbr table it would (normally) be read from sector 1 of the
> netbsd mbr partition.
> More recent kernels and disklabel(8) have got better 'hunt the disklabel'
> code [1], but for 3.0 you might want to verify that both locations contain
> the (same) disklabel, and once everthing is sane, delete the one from
> sector 1 (NB always use 'raw' disk devices.)
> 
> [1] All copies that can be found get updated to stay in sync.

Thanks for the warning.

I first tried to install the disklabel on /dev/rwd0a, but the system wouldn't do 
that (didn't complain, but didn't install it either).

Then I deciced to just try what would happen if I just ran fdisk, set the 
partition and make it active, then reboot.

The system came up fine. When I checked the disklabel, there was none on _any_ of 
the netbsd-partitions. However, the kernel's view of things was fine, so it must 
have 'guessed' the partitions by itself. Just to be safe, I again tried to install 
the disklabel on /dev/rwd0a, and that now succeeded. So I guess there can only be 
one disklabel on a mbr-paritition?

Anyway, I think the system if fine now. I'd like to thank all of you for your 
advice and insights bigtime. I've learned a lot.

Regards,

Job Hanssen