summaryrefslogtreecommitdiff
path: root/static/freebsd/man5/fstab.5 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man5/fstab.5 3.html')
-rw-r--r--static/freebsd/man5/fstab.5 3.html272
1 files changed, 272 insertions, 0 deletions
diff --git a/static/freebsd/man5/fstab.5 3.html b/static/freebsd/man5/fstab.5 3.html
new file mode 100644
index 00000000..d5f862a0
--- /dev/null
+++ b/static/freebsd/man5/fstab.5 3.html
@@ -0,0 +1,272 @@
+<table class="head">
+ <tr>
+ <td class="head-ltitle">FSTAB(5)</td>
+ <td class="head-vol">File Formats Manual</td>
+ <td class="head-rtitle">FSTAB(5)</td>
+ </tr>
+</table>
+<div class="manual-text">
+<section class="Sh">
+<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
+<p class="Pp"><code class="Nm">fstab</code> &#x2014; <span class="Nd">static
+ information about the file systems</span></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
+<p class="Pp"><code class="In">#include
+ &lt;<a class="In">fstab.h</a>&gt;</code></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
+<p class="Pp">The file <code class="Nm">fstab</code> contains descriptive
+ information about the various file systems. <code class="Nm">fstab</code> is
+ only read by programs, and not written; it is the duty of the system
+ administrator to properly create and maintain this file. Each file system is
+ described on a separate line; fields on each line are separated by tabs or
+ spaces. The order of records in <code class="Nm">fstab</code> is important
+ because <a class="Xr">fsck(8)</a>, <a class="Xr">mount(8)</a>, and
+ <a class="Xr">umount(8)</a> sequentially iterate through
+ <code class="Nm">fstab</code> doing their thing.</p>
+<p class="Pp">The first field, (<var class="Fa">fs_spec</var>), describes the
+ special device or remote file system to be mounted. The contents are decoded
+ by the <a class="Xr">strunvis(3)</a> function. This allows using spaces or
+ tabs in the device name which would be interpreted as field separators
+ otherwise.</p>
+<p class="Pp">The second field, (<var class="Fa">fs_file</var>), describes the
+ mount point for the file system. For swap partitions, this field should be
+ specified as &#x201C;none&#x201D;. The contents are decoded by the
+ <a class="Xr">strunvis(3)</a> function, as above.</p>
+<p class="Pp">The third field, (<var class="Fa">fs_vfstype</var>), describes the
+ type of the file system. The system can support various file system types.
+ Only the root, /usr, and /tmp file systems need be statically compiled into
+ the kernel; everything else will be automatically loaded at mount time.
+ (Exception: the FFS cannot currently be demand-loaded.) Some people still
+ prefer to statically compile other file systems as well.</p>
+<p class="Pp">The fourth field, (<var class="Fa">fs_mntops</var>), describes the
+ mount options associated with the file system. It is formatted as a comma
+ separated list of options. It contains at least the type of mount (see
+ <var class="Fa">fs_type</var> below) plus any additional options appropriate
+ to the file system type. See the options flag (<code class="Fl">-o</code>)
+ in the <a class="Xr">mount(8)</a> page and the file system specific page,
+ such as <a class="Xr">mount_nfs(8)</a>, for additional options that may be
+ specified. All options that can be given to the file system specific mount
+ commands can be used in <code class="Nm">fstab</code> as well. They just
+ need to be formatted a bit differently. The arguments of the
+ <code class="Fl">-o</code> option can be used without the preceding
+ <code class="Fl">-o</code> flag. Other options need both the file system
+ specific flag and its argument, separated by an equal sign. For example,
+ mounting an <a class="Xr">msdosfs(4)</a> filesystem, the options</p>
+<div class="Bd Pp Bd-indent Li">
+<pre>-o sync -o noatime -m 644 -M 755 -u foo -g bar</pre>
+</div>
+<p class="Pp">should be written as</p>
+<div class="Bd Pp Bd-indent Li">
+<pre>sync,noatime,-m=644,-M=755,-u=foo,-g=bar</pre>
+</div>
+<p class="Pp">in the option field of <code class="Nm">fstab</code>.</p>
+<p class="Pp">If the options &#x201C;userquota&#x201D; and/or
+ &#x201C;groupquota&#x201D; are specified, the file system is automatically
+ processed by the <a class="Xr">quotacheck(8)</a> command, and user and/or
+ group disk quotas are enabled with <a class="Xr">quotaon(8)</a>. By default,
+ file system quotas are maintained in files named
+ <span class="Pa">quota.user</span> and <span class="Pa">quota.group</span>
+ which are located at the root of the associated file system. These defaults
+ may be overridden by putting an equal sign and an alternative absolute
+ pathname following the quota option. Thus, if the user quota file for
+ <span class="Pa">/tmp</span> is stored in
+ <span class="Pa">/var/quotas/tmp.user</span>, this location can be specified
+ as:</p>
+<div class="Bd Pp Bd-indent Li">
+<pre>userquota=/var/quotas/tmp.user</pre>
+</div>
+<p class="Pp">If the option &#x201C;failok&#x201D; is specified, the system will
+ ignore any error which happens during the mount of that filesystem, which
+ would otherwise cause the system to drop into single user mode. This option
+ is implemented by the <a class="Xr">mount(8)</a> command and will not be
+ passed to the kernel.</p>
+<p class="Pp">If the option &#x201C;noauto&#x201D; is specified, the file system
+ will not be automatically mounted at system startup. Note that, for network
+ file systems of third party types (i.e., types supported by additional
+ software not included in the base system) to be automatically mounted at
+ system startup, the <var class="Va">extra_netfs_types</var>
+ <a class="Xr">rc.conf(5)</a> variable must be used to extend the
+ <a class="Xr">rc(8)</a> startup script's list of network file system
+ types.</p>
+<p class="Pp">If the option &#x201C;late&#x201D; is specified, the file system
+ will be automatically mounted at a stage of system startup after remote
+ mount points are mounted. For more detail about this option, see the
+ <a class="Xr">mount(8)</a> manual page.</p>
+<p class="Pp">If the option &#x201C;update&#x201D; 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 <code class="Nm">fstab</code>, unless it's a root file system, in
+ which case logic similar to &#x201C;update&#x201D; is applied
+ automatically.</p>
+<p class="Pp">The &#x201C;update&#x201D; option is typically used in conjunction
+ with two <code class="Nm">fstab</code> files. The first
+ <code class="Nm">fstab</code> file is used to set up the initial set of file
+ systems. The second <code class="Nm">fstab</code> file is then run to update
+ the initial set of file systems and to add additional file systems.</p>
+<p class="Pp">The type of the mount is extracted from the
+ <var class="Fa">fs_mntops</var> field and stored separately in the
+ <var class="Fa">fs_type</var> field (it is not deleted from the
+ <var class="Fa">fs_mntops</var> field). If <var class="Fa">fs_type</var> is
+ &#x201C;rw&#x201D; or &#x201C;ro&#x201D; then the file system whose name is
+ given in the <var class="Fa">fs_file</var> field is normally mounted
+ read-write or read-only on the specified special file.</p>
+<p class="Pp">If <var class="Fa">fs_type</var> is &#x201C;sw&#x201D; then the
+ special file is made available as a piece of swap space by the
+ <a class="Xr">swapon(8)</a> command at the end of the system reboot
+ procedure. For swap devices, the keyword &#x201C;trimonce&#x201D; triggers
+ the delivery of a <code class="Dv">BIO_DELETE</code> command to the device.
+ This command marks the device's blocks as unused, except those that might
+ store a disk label. This marking can erase a crash dump. To delay
+ <code class="Nm">swapon</code> for a device until after
+ <code class="Nm">savecore</code> has copied the crash dump to another
+ location, use the &#x201C;late&#x201D; option. For vnode-backed swap spaces,
+ &#x201C;file&#x201D; is supported in the <var class="Fa">fs_mntops</var>
+ field. When <var class="Fa">fs_spec</var> is an <a class="Xr">md(4)</a>
+ device file (&#x201C;md&#x201D; or &#x201C;md[0-9]*&#x201D;) and
+ &#x201C;file&#x201D; is specified in <var class="Fa">fs_mntopts</var>, an
+ <a class="Xr">md(4)</a> device is created with the specified file used as
+ backing store, and then the new device is used as swap space. Swap entries
+ on <span class="Pa">.eli</span> devices will cause automatic creation of
+ encrypted devices. The &#x201C;ealgo&#x201D;, &#x201C;aalgo&#x201D;,
+ &#x201C;keylen&#x201D;, &#x201C;notrim&#x201D;, and
+ &#x201C;sectorsize&#x201D; options may be passed to control those
+ <a class="Xr">geli(8)</a> parameters. The fields other than
+ <var class="Fa">fs_spec</var> and <var class="Fa">fs_type</var> are unused.
+ If <var class="Fa">fs_type</var> is specified as &#x201C;xx&#x201D; the
+ entry is ignored. This is useful to show disk partitions which are currently
+ unused.</p>
+<p class="Pp">The fifth field, (<var class="Fa">fs_freq</var>), is used for
+ these file systems by the <a class="Xr">dump(8)</a> command to determine
+ which file systems need to be dumped. If the fifth field is not present, a
+ value of zero is returned and <code class="Nm">dump</code> will assume that
+ the file system does not need to be dumped. If the fifth field is greater
+ than 0, then it specifies the number of days between dumps for this file
+ system.</p>
+<p class="Pp">The sixth field, (<var class="Fa">fs_passno</var>), is used by the
+ <a class="Xr">fsck(8)</a> and <a class="Xr">quotacheck(8)</a> programs to
+ determine the order in which file system and quota checks are done at reboot
+ time. The <var class="Fa">fs_passno</var> field can be any value between 0
+ and &#x2018;<code class="Li">INT_MAX-1</code>&#x2019;.</p>
+<p class="Pp">The root file system should be specified with a
+ <var class="Fa">fs_passno</var> of 1, and other file systems should have a
+ <var class="Fa">fs_passno</var> of 2 or greater. A file system with a
+ <var class="Fa">fs_passno</var> value of 1 is always checked sequentially
+ and be completed before another file system is processed, and it will be
+ processed before all file systems with a larger
+ <var class="Fa">fs_passno</var>.</p>
+<p class="Pp">For any given value of <var class="Fa">fs_passno</var>, file
+ systems within a drive will be checked sequentially, but file systems on
+ different drives will be checked at the same time to utilize parallelism
+ available in the hardware. Once all file system checks are complete for the
+ current <var class="Fa">fs_passno</var>, the same process will start over
+ for the next <var class="Fa">fs_passno</var>.</p>
+<p class="Pp">If the sixth field is not present or is zero, a value of zero is
+ returned and <a class="Xr">fsck(8)</a> and <a class="Xr">quotacheck(8)</a>
+ will assume that the file system does not need to be checked.</p>
+<p class="Pp">The <var class="Fa">fs_passno</var> field can be used to implement
+ finer control when the system utilities may determine that the file system
+ resides on a different physical device, when it actually does not, as with a
+ <a class="Xr">ccd(4)</a> device. All file systems with a lower
+ <var class="Fa">fs_passno</var> value will be completed before starting on
+ file systems with a higher <var class="Fa">fs_passno</var> value. E.g. all
+ file systems with a <var class="Fa">fs_passno</var> of 2 will be completed
+ before any file systems with a <var class="Fa">fs_passno</var> of 3 or
+ greater are started. Gaps are allowed between the different
+ <var class="Fa">fs_passno</var> values. E.g. file systems listed in
+ <span class="Pa">/etc/fstab</span> may have <var class="Fa">fs_passno</var>
+ values such as 0, 1, 2, 15, 100, 200, 300, and may appear in any order
+ within <span class="Pa">/etc/fstab</span>.</p>
+<div class="Bd Pp Li">
+<pre>#define FSTAB_RW &quot;rw&quot; /* read/write device */
+#define FSTAB_RQ &quot;rq&quot; /* read/write with quotas */
+#define FSTAB_RO &quot;ro&quot; /* read-only device */
+#define FSTAB_SW &quot;sw&quot; /* swap device */
+#define FSTAB_XX &quot;xx&quot; /* ignore totally */
+
+struct fstab {
+ char *fs_spec; /* block special device name */
+ char *fs_file; /* file system path prefix */
+ char *fs_vfstype; /* File system type, ufs, nfs */
+ char *fs_mntops; /* Mount options ala -o */
+ char *fs_type; /* FSTAB_* from fs_mntops */
+ int fs_freq; /* dump frequency, in days */
+ int fs_passno; /* pass number on parallel fsck */
+};</pre>
+</div>
+<p class="Pp">The proper way to read records from <span class="Pa">fstab</span>
+ is to use the routines <a class="Xr">getfsent(3)</a>,
+ <a class="Xr">getfsspec(3)</a>, <a class="Xr">getfstype(3)</a>, and
+ <a class="Xr">getfsfile(3)</a>.</p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
+<dl class="Bl-tag Bl-compact">
+ <dt><span class="Pa">/etc/fstab</span></dt>
+ <dd>The file <code class="Nm">fstab</code> resides in
+ <span class="Pa">/etc</span>.</dd>
+</dl>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
+<div class="Bd Li">
+<pre># Device Mountpoint FStype Options Dump Pass#
+#
+# UFS file system.
+/dev/da0p2 / ufs rw 1 1
+#
+# Swap space on a block device.
+/dev/da0p1 none swap sw 0 0
+#
+# Swap space using a block device with GELI encryption.
+# aalgo, ealgo, keylen, sectorsize options are available
+# for .eli devices.
+/dev/da1p2.eli none swap sw 0 0
+#
+# tmpfs.
+tmpfs /tmp tmpfs rw,size=1g,mode=1777 0 0
+#
+# UFS file system on a swap-backed md(4). /dev/md10 is
+# automatically created. If it is &quot;md&quot;, a unit number
+# will be automatically selected.
+md10 /scratch mfs rw,-s1g 0 0
+#
+# Swap space on a vnode-backed md(4).
+md11 none swap sw,file=/swapfile 0 0
+#
+# CDROM. &quot;noauto&quot; option is typically used because the
+# media is removable.
+/dev/cd0 /cdrom cd9660 ro,noauto 0 0
+#
+# NFS-exported file system. &quot;serv&quot; is an NFS server name
+# or IP address.
+serv:/export /nfs nfs rw,noinet6 0 0</pre>
+</div>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
+ ALSO</a></h1>
+<p class="Pp"><a class="Xr">getfsent(3)</a>, <a class="Xr">getvfsbyname(3)</a>,
+ <a class="Xr">strunvis(3)</a>, <a class="Xr">ccd(4)</a>,
+ <a class="Xr">dump(8)</a>, <a class="Xr">fsck(8)</a>,
+ <a class="Xr">geli(8)</a>, <a class="Xr">mount(8)</a>,
+ <a class="Xr">quotacheck(8)</a>, <a class="Xr">quotaon(8)</a>,
+ <a class="Xr">swapon(8)</a>, <a class="Xr">umount(8)</a></p>
+</section>
+<section class="Sh">
+<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
+<p class="Pp">The <code class="Nm">fstab</code> file format appeared in
+ <span class="Ux">4.0BSD</span>.</p>
+</section>
+</div>
+<table class="foot">
+ <tr>
+ <td class="foot-date">April 14, 2014</td>
+ <td class="foot-os">FreeBSD 15.0</td>
+ </tr>
+</table>