From owner-freebsd-hackers Thu Aug 15 07:15:54 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA09486 for hackers-outgoing; Thu, 15 Aug 1996 07:15:54 -0700 (PDT) Received: from brasil.moneng.mei.com (brasil.moneng.mei.com [151.186.109.160]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id HAA09480 for ; Thu, 15 Aug 1996 07:15:50 -0700 (PDT) Received: (from jgreco@localhost) by brasil.moneng.mei.com (8.7.Beta.1/8.7.Beta.1) id JAA13565; Thu, 15 Aug 1996 09:14:22 -0500 From: Joe Greco Message-Id: <199608151414.JAA13565@brasil.moneng.mei.com> Subject: Re: Nightmare. To: bde@zeta.org.au (Bruce Evans) Date: Thu, 15 Aug 1996 09:14:22 -0500 (CDT) Cc: jgreco@brasil.moneng.mei.com, ulf@lamb.net, hackers@FreeBSD.ORG, jkh@time.cdrom.com In-Reply-To: <199608142129.HAA04653@godzilla.zeta.org.au> from "Bruce Evans" at Aug 15, 96 07:29:21 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > >> I would go more into the direction of checking if the dump device is a > >> mounted file system. Easy check. > > >I tend to agree, but wonder if it would not make more sense to tackle this > >from a different angle. > > >Consider all the programs that could clobber a mounted file system. Would > >it make more sense if we somehow protected a mounted disk device from > >being clobbered? > > It is already protected. Even root can't even open a mounted disk device. Root can open (and write to) a raw disk device that has its counterpart mounted, however. I think the "and write to" part is much more of a liability than simply being able to open and read the device. As we saw from the message that started this thread. ;-) > However, mounted disk devices can easiliy be clobbered using an alias. > There are about 2^(1+5+3) = 512 possible aliases (raw/buffered, 2^5 > slices, 2^3 partitions). This is useful for things like installing > new bootblocks on the root partition without having to reboot with a > different root partition. Don't fix it. Root knows all about this > problem, and never makes mistakes :-). As we saw from the message that started this thread. ;-) In general I don't think it's a solvable problem. I'm willing to live with that personally, I think that the current state of affairs is a good compromise, but I think it's really a good idea to toss around ideas anyways to see if there isn't a better general solution of some sort waiting out there to be found. ... JG