Subject: Re: shooting oneself in the foot
From: David Laight <firstname.lastname@example.org>
Date: 01/16/2002 21:07:51
> boot single user, read-only root, do your mucking/mirroring, swap
> the disklabel then reboot...
Might - depends on how well the 'readonly' attribute is handled.
> or, well this might work, but I'm not sure, I'm not terribly familiar
> with it, but in FreeBSD it seems as if you can update the on-disk
> disklabel without modifing the in-core copy, that's what you probably
> wanted to do anyhow. Are you sure that NetBSD's disklabel doesn't
> offer this sort of control?
You might think that 'disklabel -R -r special file' would have that
effect.... It doesn't seem to. What is more there are traps to stop you
overwriting the sector that the label is probably in.....
> The filesystem always refers to a disk device, if the disk device
> wants to change the mapping from logical to phyiscall offsets the
> filesystem really doesn't have a say in that.
But in some sense the filesystem code did an 'open' of the raw device,
the device map shouldn't change under this open file.
> I think a warning when doing disklabel operations on a mounted disk
> should be in order.
The warning is too late! You either have to error it completely or make
the fs code continue to use the old mapping.