FSCKing a RO partition

VANHULLEBUS Yvan vanhu_bsd at zeninc.net
Thu Nov 2 14:39:17 UTC 2006


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.


More information about the freebsd-geom mailing list