Subject: Re: shooting oneself in the foot
To: <>
From: David Laight <>
List: tech-kern
Date: 01/16/2002 21:10:12
Greywolf wrote:

> # Ok, My system has been running with root on wd0a, I've generated a new
> # root filesystem (say for a new version of netbsd) on wd0h.  I've tested
> # the new system by typing 'boot wd0h:' and am now happy with it so I want
> # to make it the default.  So what I want to do is swap over wd0a and wd0h
> # on the disklabel and reboot.
> # Tell me which commands I can use to do this, quite reasonable, action?
> NetBSD# cd /usr/mdec
> NetBSD# ./installboot bootbios.sym /dev/rwd0h

Erm: that is the command to add the bootloader to the pbr.
Start with disklabel(8)
> # I didn't say that the knowledge should be in the fs code itself, just
> # saved so that the filesystem always refers to the same disk blocks.  At
> # the moment every disk write is compared against the CURRENT disk label
> # for the disk.
> It is compared, more specifically, to the current IN-CORE VERSION of
> the disk label, which gets clopped when you write it out to disk,
> by and large.  We do not remember any previous disklabels.  It could
> be done, but if the check exists in disklabel(8), there should
> be no issue with this.

Except that there is no method of updating the on-disk label without
updating thein-core one.  Indeed you need to stop the on-disk one being
read back in as well.