Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jul 2019 20:04:55 +0000 (UTC)
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r350224 - in head: sbin/mount share/man/man5
Message-ID:  <201907222004.x6MK4tUH016964@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sobomax
Date: Mon Jul 22 20:04:55 2019
New Revision: 350224
URL: https://svnweb.freebsd.org/changeset/base/350224

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

Modified:
  head/sbin/mount/mount.c
  head/share/man/man5/fstab.5

Modified: head/sbin/mount/mount.c
==============================================================================
--- head/sbin/mount/mount.c	Mon Jul 22 19:27:23 2019	(r350223)
+++ head/sbin/mount/mount.c	Mon Jul 22 20:04:55 2019	(r350224)
@@ -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: head/share/man/man5/fstab.5
==============================================================================
--- head/share/man/man5/fstab.5	Mon Jul 22 19:27:23 2019	(r350223)
+++ head/share/man/man5/fstab.5	Mon Jul 22 20:04:55 2019	(r350224)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907222004.x6MK4tUH016964>