|author||Andriy Gapon <avg@FreeBSD.org>||2018-03-27 14:31:42 +0000|
|committer||Andriy Gapon <avg@FreeBSD.org>||2018-03-27 14:31:42 +0000|
vfs_donmount: in certain cases try r/o mount if r/w mount fails
If the operation is not an update, if neither r/w nor r/o mode is explicitly requested, if the error code hints at the possibility of the media being read-only, and if the fallback is allowed, then we can try to automatically downgrade to the readonly mode. This is especially useful for auto-mounting of removable media that sometimes can happen to be write-protected. The fallback to r/o is not enabled by default. It can be requested on a per-mount basis with a new mount option, 'autoro'. Or it can be globally allowed by setting vfs.default_autoro. Reviewed by: cem, kib MFC after: 3 weeks Relnotes: yes Differential Revision: https://reviews.freebsd.org/D13361
Notes: svn path=/head/; revision=331616
Diffstat (limited to 'sbin/mount')
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/mount/mount.8 b/sbin/mount/mount.8
index fcff497d7e5a..0e57e7f2192f 100644
@@ -155,6 +155,10 @@ This flag indicates that the file system was mounted by
.Xr automountd 8 .
Automounted file systems are automatically unmounted by
.Xr autounmountd 8 .
+.It Cm autoro
+Mount the file system read-write.
+If that fails with an error that suggests that the media could be read-only,
+then automatically try to mount the file system read-only.
.It Cm current
When used with the