From owner-freebsd-geom@FreeBSD.ORG Mon Nov 6 11:50:31 2006 Return-Path: X-Original-To: freebsd-geom@FreeBSD.ORG Delivered-To: freebsd-geom@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC3D316A516 for ; Mon, 6 Nov 2006 11:50:31 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33D0743D5A for ; Mon, 6 Nov 2006 11:49:53 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (zmjktu@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id kA6Bnltu079136; Mon, 6 Nov 2006 12:49:52 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id kA6BnkOb079135; Mon, 6 Nov 2006 12:49:46 +0100 (CET) (envelope-from olli) Date: Mon, 6 Nov 2006 12:49:46 +0100 (CET) Message-Id: <200611061149.kA6BnkOb079135@lurza.secnetix.de> From: Oliver Fromme To: freebsd-geom@FreeBSD.ORG, vanhu_bsd@zeninc.net In-Reply-To: <20061102143915.GA26008@zen.inc> X-Newsgroups: list.freebsd-geom User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Mon, 06 Nov 2006 12:49:52 +0100 (CET) Cc: Subject: Re: FSCKing a RO partition X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-geom@FreeBSD.ORG, vanhu_bsd@zeninc.net List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2006 11:50:32 -0000 VANHULLEBUS Yvan wrote: > [background] > When the system starts up, root partition is already monted RO, and > fsck works, without any problems, without any warning. > > [my problem] > Very early in the startup (in a custom init to be exact), I need to > remount ROOT R/W, do some write operations, then I want to remount it > RO to let the normal rc process continue. > > Under FreeBSD 4.11, it works. > > But under FreeBSD6 (and I guess 5, but I don't have a running FreeBSD5 > host), fsck says "NO WRITE ACCESS", then starts its stuff (but I fear > what will happen if it detect problems on the filesystem....). > > The RO remount is done by a call to mount(2), with > MNT_RDONLY|MNT_UPDATE flags and MNT_EXRDONLY ex_flags. > > I also tried with the mount command and -u -r options with the same > result. A quick workaround would be to run "fsck -p" yourself on the root partition before you remount it read-write. You have to do that anyway, because the FS might be dirty so you wouldn't be able to remount it r-w in the first place (unless you apply "force", which is dangerous). You will still get a warning message from fsck later, but at least your root FS should be clean at that point. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "Perl will consistently give you what you want, unless what you want is consistency." -- Larry Wall