Subject: re: bogus "/dev/wd0c: file system not clean (fs_flags=1); please fsck(8)"
To: Tad Hunt <tad@entrisphere.com>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 02/20/2002 12:51:00
My question was why do I see the "file system not clean" warning
(from sys/ufs/ffs/ffs_vfsops.c) when I'm simply changing the mounted
partition from read/write to readonly (the "-u" flag to mount(8)).
without unmounting it first. I would expect the switch to readonly
to have flushed any pending writes, and then switch the filesystem
to readonly mode.
The mount(8) manpage says this about the "-u" flag:
> -u The -u flag indicates that the status of an already mounted file
> system should be changed. Any of the options discussed above
> (the -o option) may be changed; also a file system can be changed
> from read-only to read-write or vice versa. An attempt to change
> from read-write to read-only will fail if any files on the
> filesystem are currently open for writing unless the -f flag is
> also specified. ...
If I do the following:
# newfs /dev/rwd0c
# mount /dev/wd0c /mnt
# mount -u -o ro /dev/wd0c /mnt
#
I do not get the warning.
If I change something on the filesystem before I do the "mount -u"
to switch the fs to readonly, I get the warning:
# newfs /dev/rwd0
# mount /dev/wd0c /mnt
# echo foo > /mnt/foo
# mount -o ro /dev/wd0c /mnt
/dev/wd0c: file system not clean (fs_flags=1); please fsck(8)
#
looks like you forgot the "-u" here? this is mounting wd0c again.