ext2fs marked dirty when mounted read-only

Stanislav Sedov stas at 310.ru
Tue Jun 20 13:30:25 UTC 2006


On Mon, 19 Jun 2006 18:11:38 -0400 (EDT)
hardware at ee.ccny.cuny.edu wrote:

> Dear FreeBSD Filesystem List,
> 
> When I uncleanly unmount an ext2fs filesystem that is mounted read-only
> it needs to be fsck'ed before the kernel will allow it to remounted.
> 
> kernel: 6.1-RC1 FreeBSD 6.1-RC1
> disk: da0 at umass-sim0 bus 0 target 0 lun 0
>       da0: <ST350084 1A 3.AA> Fixed Direct Access SCSI-0 device
>       da0: 40.000MB/s transfers
>       da0: 476940MB (976773168 512 byte sectors: 255H 63S/T 60801C)
> 
> When I try to mount the ext2fs filesystem in read-only mode, I get this:
> 
>       WARNING: R/W mount denied.  Filesystem is not clean - run fsck
> 
> This problem can be reproduced on my system by the following steps
> 
> 	1) mount -t ext2fs -o ro /dev/da0 /mnt # da0 is external USB
> 	2) ls /mnt
> 	3) UNPLUG THE EXTERNAL USB DISK
> 	4) reboot
> 	5) mount -t ext2fs -o ro /dev/da0 /mnt
> 

There is a small bug in ext2fs code. I'd experienced the same problem
some time ago.

Unfortunately, I have lost the patch.

Try to change the line
"if (fs->s_rd_only && !vfs_flagopt(opts, "ro", NULL, 0)) {"

in ext2_vfsops.c

to
"if (fs->s_rd_only && !(mp->mnt_flag & MNT_RDONLY)) {"

I suppose it will help.


-- 
Stanislav Sedov         MBSD labs, Inc.         <ssedov at mbsd.msk.ru>
Россия, Москва		http://mbsd.msk.ru

--------------------------------------------------------------------
If the facts don't fit the theory, change the facts.  -- A. Einstein
--------------------------------------------------------------------
PGP fingerprint:  F21E D6CC 5626 9609 6CE2  A385 2BF5 5993 EB26 9581
-------------- 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/20060620/bae43339/attachment.pgp


More information about the freebsd-fs mailing list