From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 13 07:41:47 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7079216A403 for ; Fri, 13 Oct 2006 07:41:47 +0000 (UTC) (envelope-from vanhu@zeninc.net) Received: from leia.fdn.fr (ns0.fdn.org [80.67.169.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CC6643D5D for ; Fri, 13 Oct 2006 07:41:45 +0000 (GMT) (envelope-from vanhu@zeninc.net) Received: from smtp.zeninc.net (reverse-25.fdn.fr [80.67.176.25]) by leia.fdn.fr (8.13.3/8.13.3/FDN) with ESMTP id k9D7fhYN002381 for ; Fri, 13 Oct 2006 09:41:44 +0200 Received: by smtp.zeninc.net (smtpd, from userid 1000) id 513C23F17; Fri, 13 Oct 2006 09:41:37 +0200 (CEST) Date: Fri, 13 Oct 2006 09:41:37 +0200 From: VANHULLEBUS Yvan To: freebsd-hackers@freebsd.org Message-ID: <20061013074136.GA31459@zen.inc> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: All mail clients suck. This one just sucks less. Subject: Fscking a partition mounted Read only... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2006 07:41:47 -0000 Hi all. I didn't really know where to post this question, so I try "hackers".... When rc starts, root filesystem is already mounted readonly, and fsck runs ok, then root is remounted read/write. Later, if root filesystem is remounted readonly, then fsck is called, it will says "NO WRITE ACCESS". If "later" is "in multi user mode with lots of running process", I guess it is a really bad idea to run fsck, but if "later" is "still very early during rc process", it should not generate more problems than the usual fsck. My exact situation is: - run a custom init * remounts root read/write * do some write operations on root filesystem * remount root read-only (mnt_flags = MNT_RDONLY|MNT_UPDATE, export.ex_flags = MNT_EXRDONLY in mount syscall). * execv real /sbin/init - init starts - rc starts - fsck says "NO WRITE ACCESS".... Is there a way to remount root read only in the exact same state as it is when init starts ? Thanks, Yvan.