Subject: Re: shooting oneself in the foot
To: David Laight <david@nohope.l8s.co.uk>
From: Greywolf <greywolf@starwolf.com>
List: tech-kern
Date: 01/16/2002 12:42:16
On Wed, 16 Jan 2002, David Laight wrote:
# > disklabel(8) should not be allowing modifications of mounted filesystems
# > (by checking at write time). At least not without sufficient warnings
# > that will drive off someone with a shadow of a doubt as to what they
# > are doing.
#
# 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
# 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.
# David
--*greywolf;
--
NetBSD: the free unix for the rest of us.