Subject: Re: shooting oneself in the foot
To: David Laight <email@example.com>
From: Alfred Perlstein <firstname.lastname@example.org>
Date: 01/16/2002 12:47:04
* David Laight <email@example.com> [020116 12:37] wrote:
> Greywolf 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?
boot single user, read-only root, do your mucking/mirroring, swap
the disklabel then reboot...
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?
> and Alfred:
> > This would seem to be a major layering violation. The FS is only
> > supposed to know about the underlying disk, not the boundry of
> > the partition. It sees 0..endofpartition, not start..end. :)
> 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.
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.
I think a warning when doing disklabel operations on a mounted disk
should be in order.
-Alfred Perlstein [firstname.lastname@example.org]
'Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.'
Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/