Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Nov 2006 15:39:15 +0100
From:      VANHULLEBUS Yvan <vanhu_bsd@zeninc.net>
To:        freebsd-geom@freebsd.org
Subject:   FSCKing a RO partition
Message-ID:  <20061102143915.GA26008@zen.inc>

next in thread | raw e-mail | index | archive | help
Hi all.

(problem reported first to FreeBSD-hackers, where people told me
"GEOM"....).


[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.


Can someone explain me why it works like that, and, most important
for me, give me a way to remount the root partition exactly as it was
mounted when init started ?



Thanks,

Yvan.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061102143915.GA26008>