Subject: Re: bogus "/dev/wd0c: file system not clean (fs_flags=1); please fsck(8)"
To: matthew green <mrg@eterna.com.au>
From: Tad Hunt <tad@entrisphere.com>
List: tech-kern
Date: 02/19/2002 18:38:58
Sorry, there is a typo in my example.  I've summarized with snarf-n-barf'd
output (rather than handwritten) below.

Version: NetBSD-1.5

Two questions:
	1) Is this warning bogus, or am I confused?
	2) Is this problem fixed in a later release?

Bogus warning:

	# umount /mnt
	# newfs /dev/rwd0e
	[newfs output elided]
	# mount /dev/wd0e /mnt
	# echo foo > /mnt/wd0e
	# mount -u -o ro /mnt
	/dev/wd0e: file system not clean (fs_flags=1); please fsck(8)
	# 

No warning if I umount(8) /mnt first:

	# newfs /dev/rwd0e
	[newfs output elided]
	# mount /dev/wd0e /mnt
	# echo foo > /mnt/wd0e
	# umount /mnt
	# mount -o ro /dev/wd0e /mnt
	# 

-Tad

In message <14371.1014169860@eterna.com.au>, you said:
;
;   
;   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.