Author: gbe (doc committer)
Date: Mon Dec  7 20:36:58 2020
New Revision: 368418
URL: https://svnweb.freebsd.org/changeset/base/368418

Log:
  MFC r350224 by sobomax:
  
  Allow "update" option to be used in the fstab(5). Document possible use case.
  
  Approved by:  sobomax
  Differential Revision:        https://reviews.freebsd.org/D18586

Modified:
  stable/12/sbin/mount/mount.c
  stable/12/share/man/man5/fstab.5
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/mount/mount.c
==============================================================================
--- stable/12/sbin/mount/mount.c        Mon Dec  7 18:58:08 2020        
(r368417)
+++ stable/12/sbin/mount/mount.c        Mon Dec  7 20:36:58 2020        
(r368418)
@@ -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,

Modified: stable/12/share/man/man5/fstab.5
==============================================================================
--- stable/12/share/man/man5/fstab.5    Mon Dec  7 18:58:08 2020        
(r368417)
+++ stable/12/share/man/man5/fstab.5    Mon Dec  7 20:36:58 2020        
(r368418)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to