diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index 3f35baccce22..102e87009b0f 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -361,6 +361,7 @@ main(int argc, char *argv[]) else failok = 0; if (!(init_flags & MNT_UPDATE) && + !hasopt(fs->fs_mntops, "update") && ismounted(fs, mntbuf, mntsize)) continue; options = update_options(options, fs->fs_mntops, diff --git a/share/man/man5/fstab.5 b/share/man/man5/fstab.5 index f4e9ce2b653e..1b2d99daa25e 100644 --- a/share/man/man5/fstab.5 +++ b/share/man/man5/fstab.5 @@ -190,6 +190,32 @@ see the .Xr mount 8 manual page. .Pp +If the option +.Dq update +is specified, it indicates that the status of an already mounted file +system should be changed accordingly. +This allows, for example, file systems mounted read-only to be upgraded +read-write and vice-versa. +By default, an entry corresponding to a file systems that is already +mounted is going to be skipped over when processing +.Nm , +unless it's a root file system, in which case logic similar to +.Dq update +is applied automatically. +.Pp +The +.Dq update +option is typically used in conjuction with two +.Nm +files. +The first +.Nm +file is used to set up the initial set of file systems. +The second +.Nm +file is then run to update the initial set of file systems and +to add additional file systems. +.Pp The type of the mount is extracted from the .Fa fs_mntops field and stored separately in the