Subject: bin/1324: fsck's marking of root file system as clean doesn't stick
To: None <gnats-bugs@gnats.NetBSD.ORG>
From: John Kohl <jtk@kolvir.arlington.ma.us>
List: netbsd-bugs
Date: 08/08/1995 20:35:48
>Number: 1324
>Category: bin
>Synopsis: fsck's marking of root file system as clean doesn't stick
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Aug 8 21:20:01 1995
>Last-Modified:
>Originator: John Kohl
>Organization:
NetBSD Kernel Hackers `R` Us
>Release: NetBSD-current as of 8 August 1995
>Environment:
System: NetBSD pattern 1.0A NetBSD 1.0A (PATTERN) #62: Tue Aug 8 19:29:58 EDT 1995 jtk@pattern:/u1/NetBSD-current/src/sys/arch/i386/compile/PATTERN i386
>Description:
If your root file system is dirty, and you boot up, fsck will clean the
filesystem and mark it clean.
However, when you then start up /etc/rc and go multi-user, the kernel
will complain that the file system is dirty and you should run fsck(8).
>How-To-Repeat:
get a dirty root file system (e.g. shutdown to single user, unmount
everything else, sync, hit the reset button, and watch it happen.
>Fix:
2 parts: 1) mount needs to pass the reload option when asked to do so.
2) /etc/rc needs to "mount -o reload" the root file system after fsck
runs.
p.s. /etc/rc should have its Id string changed to a NetBSD ident.
===================================================================
RCS file: etc/RCS/rc,v
retrieving revision 1.1
diff -c -r1.1 etc/rc
*** etc/rc 1995/08/08 23:55:34 1.1
--- etc/rc 1995/08/09 00:30:09
***************
*** 56,61 ****
--- 56,64 ----
fi
trap "echo 'Boot interrupted.'; exit 1" 3
+
+ # refresh anything cleaned up on the root:
+ mount -o reload -u /
swapon -a
===================================================================
RCS file: sbin/mount/RCS/mount.c,v
retrieving revision 1.1
diff -c -r1.1 sbin/mount/mount.c
*** sbin/mount/mount.c 1995/08/08 23:36:27 1.1
--- sbin/mount/mount.c 1995/08/08 23:55:08
***************
*** 336,341 ****
--- 336,343 ----
*/
if (flags & MNT_UPDATE)
optbuf = catopt(optbuf, "update");
+ if (flags & MNT_RELOAD)
+ optbuf = catopt(optbuf, "reload");
argc = 0;
argv[argc++] = vfstype;
>Audit-Trail:
>Unformatted: