path: root/sbin/mount
diff options
authorAndriy Gapon <avg@FreeBSD.org>2018-03-27 14:31:42 +0000
committerAndriy Gapon <avg@FreeBSD.org>2018-03-27 14:31:42 +0000
commit31260bf042555bba6523d127ed80172bb97c1839 (patch)
tree55c41bd0c7b5065d6b8473926d0a2deea11c5545 /sbin/mount
parent5a2fc46447b2c0df080a907f722f9705aacf26ce (diff)
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
--- a/sbin/mount/mount.8
+++ b/sbin/mount/mount.8
@@ -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
.Fl u