retry mounting with ro when rw fails

Andriy Gapon avg at
Fri Apr 8 12:11:06 UTC 2011

on 07/04/2011 23:20 Garrett Cooper said the following:
>     As a generic question / observation, maybe we should just
> implement 'errors=remount-ro' (or a reasonable facsimile) like Linux
> has in our mount(8) command? Doesn't look like NetBSD, OpenBSD, or
> [Open]Solaris sported similar functionality.

No problem, I am OK with being first.
Then, I only want to deal with media that is "semi-permanently" or permanetly
read-only.  That's why I handle only failure to mount media as R/W.

But from what I read 'errors=remount-ro' in Linux has to do with errors that
happen after filesystem is mounted.  That is, you mounted a filesystem, you work
with it, you get some error (e.g. because of bad blocks), you auto-downgrade the
filesystem to readonly.  This may be a nice feature, but this is something
different from what I proposed.

And, AFAIK, Linux does what I propose by default, without any additional options.
Google for "block device ... is write-protected, mounting read-only".
But yes, it seems that they handle this situation entirely in userland.
And I am not against it.

Andriy Gapon

More information about the freebsd-hackers mailing list