Fscking a partition mounted Read only...

VANHULLEBUS Yvan vanhu_bsd at zeninc.net
Fri Oct 13 00:41:47 PDT 2006


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.


More information about the freebsd-hackers mailing list