FFS writes to read-only mount

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri Mar 16 01:48:59 UTC 2007


On Fri, Mar 16, 2007 at 08:42:20AM +1000, David Cecil wrote:
> 
> >>It may be that snapshots are used, but not explicitly.  The startup scripts attempt to run fsck in the background, which would normally require a snapshot, but shouldn't 
> >>for a read-only mount, right?
> >>    
> >
> >What happens if the filesystem is marked dirty, background fsck is
> >enabled, but the filesystem is mounted read-only?
> >  
> 
> Yeah, I was wondering the same thing Kris.  In fact, that was one of my first suspects when I started looking at this problem.
> 
> I had eliminated it because fstat (and ps in ddb) doesn't show fsck running, or the raw device open for writing.  Maybe fsck had already closed the descriptor and exited 
> but the write to disk (GEOM mirror) is still outstanding in the buffer cache?

Is the offset always the same for this error you're seeing? Maybe some
dirty buffer isn't flushed on disk properly and syncer retries syncing
it every now and then. This would explain why you see it not only early
after system was booted.

Could you try disabling bgfsck, by setting background_fsck="NO" to your
/etc/rc.conf?

I know that there is a hack for handling fsck of the root file system.
Bascially once system is mounted read-only (the partition it resides on
is opened read-only), it (the partition) can't be opened for write by
anything else (because of how GEOM works). But there is an exception for
the root partition, which is opened without exclusive bit at first time,
which allows, eg. to boot system into single-user mode and run fsck -
without this hack it won't be possible. So I'm wondering if this can be
problematic if one use bgfsck for the root file system...

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20070316/3f831e54/attachment.pgp


More information about the freebsd-fs mailing list