From owner-freebsd-current@FreeBSD.ORG Mon Apr 4 12:47:32 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99F0716A4CE; Mon, 4 Apr 2005 12:47:32 +0000 (GMT) Received: from mail-gw1.york.ac.uk (mail-gw1.york.ac.uk [144.32.128.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5C2A43D54; Mon, 4 Apr 2005 12:47:31 +0000 (GMT) (envelope-from gavin.atkinson@ury.york.ac.uk) Received: from buffy.york.ac.uk (buffy-128.york.ac.uk [144.32.128.165]) by mail-gw1.york.ac.uk (8.12.10/8.12.10) with ESMTP id j34ClQe2005441; Mon, 4 Apr 2005 13:47:26 +0100 (BST) Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.13.3/8.13.1) with ESMTP id j34ClPFW071598; Mon, 4 Apr 2005 13:47:25 +0100 (BST) (envelope-from gavin.atkinson@ury.york.ac.uk) Received: (from ga9@localhost) by buffy.york.ac.uk (8.13.3/8.13.1/Submit) id j34ClM3x071597; Mon, 4 Apr 2005 13:47:22 +0100 (BST) (envelope-from gavin.atkinson@ury.york.ac.uk) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin.atkinson@ury.york.ac.uk using -f From: Gavin Atkinson To: Andrey Chernov In-Reply-To: <20050404032843.GA49072@nagual.pp.ru> References: <20050403232027.GA42574@nagual.pp.ru> <200504041145.25265.doconnor@gsoft.com.au> <20050404025705.GA48464@nagual.pp.ru> <200504041235.15749.doconnor@gsoft.com.au> <20050404032843.GA49072@nagual.pp.ru> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Mon, 04 Apr 2005 13:47:21 +0100 Message-Id: <1112618841.71324.23.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.2.1.1 FreeBSD GNOME Team Port X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin.atkinson@ury.york.ac.uk cc: current@freebsd.org Subject: Re: Can't change partition table anymore X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2005 12:47:32 -0000 On Mon, 2005-04-04 at 07:28 +0400, Andrey Chernov wrote: > BTW, the trick with kern.geom.debugflags=16 works and I put it permanently > in my sysctl.conf. Could you please make it ON by default or make a > warning at least? I actually agree with this. It's so frustrating to not be able to do what you want to do as root. Consider the following two examples: - Freshly installed machine, I want to move the root disk to be a GEOM mirror. I can't, because gmirror can't open /dev/ad0 for writing, even though I know the last sectors which it needs to write to are unused. It can't even be done in single user mode, as / is still mounted. The only way to do this seems to be to boot off a fixit CD, with all the problems that brings with it. (this issue has been discussed several times before) - I have a partition, which I would like to split into two smaller partitions. Even though it is unmounted, and it's perfectly safe to do, I'm prevented from doing it. Again, it can't be done in single user mode either. Back to the fixit CD. I fully understand why the feature exists, but when it gets in the way of legitimate system administration then perhaps it should be disabled by default (or perhaps based on securelevel). Having to flip bits clearly labelled "debug" flags doesn't seem to be a good solution. Maybe the way forward is to make it more intellegent, "hang on, you can't destroy that partition because this geom is using it". I 'm not sure how this could be implemented, I guess another geom method would have to exists to basically say "somebody wants to make this change, is it ok with you?" before the write occurs, and the caller either gets returned success, or something like EROFS if the responsible geom turned it down. Only the geom in question can ever know if a particular change is safe, so it should be up to that to authorise or deny a change. Or, allow the change, then notify all attached consumers of da0 and say "hey, something's changed". Let the consumers pass that down to the consumers it affects which either respect it (if it can be respected or if it changes nothing significant) or self-destruct. I don't know enough about geom to know the best solution, but something really should be done about it. Gavin