xref: /illumos-gate/usr/src/man/man5/vfstab.5 (revision dd72704bd9e794056c558153663c739e2012d721)
1'\"
2.\" Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved.
3.\" Copyright 1989 AT&T
4.\" Copyright 2015 Nexenta Systems, Inc. All rights reserved.
5.\" Copyright 2022 Oxide Computer Company
6.\"
7.\" The contents of this file are subject to the terms of the
8.\" Common Development and Distribution License (the "License").
9.\" You may not use this file except in compliance with the License.
10.\"
11.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12.\" or http://www.opensolaris.org/os/licensing.
13.\" See the License for the specific language governing permissions
14.\" and limitations under the License.
15.\"
16.\" When distributing Covered Code, include this CDDL HEADER in each
17.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18.\" If applicable, add the following below this CDDL HEADER, with the
19.\" fields enclosed by brackets "[]" replaced with your own identifying
20.\" information: Portions Copyright [yyyy] [name of copyright owner]
21.\"
22.Dd January 16, 2022
23.Dt VFSTAB 5
24.Os
25.Sh NAME
26.Nm vfstab
27.Nd table of file system defaults
28.Sh DESCRIPTION
29The file
30.Pa /etc/vfstab
31describes defaults for each file system.
32The information is stored in a table with the following column headings:
33.Bd -literal
34device       device       mount      FS      fsck    mount      mount
35to mount     to fsck      point      type    pass    at boot    options
36.Ed
37.Pp
38The fields in the table are space-separated and show the resource name
39.Pq Fa device to mount ,
40the raw device to
41.Sy fsck
42.Pq Em device to fsck ,
43the default mount directory
44.Pq Em mount point ,
45the name of the file system type
46.Pq Em FS type ,
47the number used by
48.Xr fsck 8
49to decide whether to check the file system automatically
50.Pq Em fsck pass ,
51whether the file system should be mounted automatically by
52.Xr mountall 8
53.Pq Em mount at boot ,
54and the file system mount options
55.Pq Em mount options .
56See respective mount file system man page below in
57.Sx SEE ALSO
58for
59.Em mount options.
60A
61.Sq -
62is used to indicate no entry in a field.
63This may be used when a field does not apply to the resource being mounted.
64.Pp
65The
66.Xr getvfsent 3C
67family of routines is used to read
68.Pa /etc/vfstab .
69There are currently no library routines to automate the writing of
70.Pa /etc/vfstab .
71.Pp
72.Pa /etc/vfstab
73can be used to specify swap areas.
74An entry so specified,
75.Pq which can be a file or a device ,
76will automatically be added as a swap area by the
77.Pa /sbin/swapadd
78script when the system boots.
79To specify a swap area, the
80.Em device-to-mount
81field contains the name of the swap file or device, the
82.Em FS-type
83is
84.Dq swap ,
85.Em mount-at-boot
86is
87.Dq no
88and all other fields have no entry.
89.Sh EXAMPLES
90The following are
91.Pa /etc/vfstab
92entries for various file system types supported in illumos.
93.Pp
94.Sy Example 1
95NFS and UFS Mounts
96.Pp
97The following entry invokes NFS to automatically mount the directory
98.Pa /usr/local
99of the server
100.Sy example1
101on the client's
102.Pa /usr/local
103directory with read-only permission:
104.Bd -literal -offset indent
105example1:/usr/local - /usr/local nfs - yes ro
106.Ed
107.Pp
108The following example assumes a small departmental mail setup, in which clients
109mount
110.Pa /var/mail
111from a server
112.Sy mailsvr .
113The following entry would be listed in each client's
114.Pa /etc/vfstab:
115.Bd -literal -offset indent
116mailsvr:/var/mail - /var/mail nfs - yes intr,bg
117.Ed
118.Pp
119The following is an example for a UFS file system in which logging is enabled:
120.Bd -literal -offset indent
121/dev/dsk/c2t10d0s0 /dev/rdsk/c2t10d0s0 /export/local ufs 3 yes logging
122.Ed
123.Pp
124See
125.Xr mount_nfs 8
126for a description of NFS mount options and
127.Xr mount_ufs 8
128for a description of UFS options.
129.Pp
130.Sy Example 2
131pcfs Mounts
132.Pp
133The following example mounts a pcfs file system on a fixed hard disk on an x86
134machine:
135.Bd -literal -offset indent
136/dev/dsk/c1t2d0p0:c - /win98 pcfs - yes -
137.Ed
138.Pp
139The example below mounts a Jaz drive on a SPARC machine.
140Normally, the volume management software handles mounting of removable media,
141obviating a
142.Nm
143entry.
144Specifying a device that supports removable media in
145.Pa /etc/vfstab
146with set the mount-at-boot field to
147.Dq no
148.Pq as shown below
149disables the automatic handling of that device.
150Such an entry presumes you are not running volume management software.
151.Bd -literal -offset indent
152/dev/dsk/c1t2d0s2:c - /jaz pcfs - no -
153.Ed
154.Pp
155For removable media on a SPARC machine, the convention for the slice portion of
156the disk identifier is to specify
157.Sy s2 ,
158which stands for the entire medium.
159.Pp
160For pcfs file systems on x86 machines, note that the disk identifier uses
161a
162.Sy p
163.Pq Sy p0
164and a logical drive
165.Po
166.Sy c ,
167in the
168.Pa /win98
169example above
170.Pc
171for a pcfs logical drive.
172See
173.Xr mount_pcfs 8
174for syntax for pcfs logical drives and for pcfs-specific mount options.
175.Pp
176.Sy Example 3
177loopback File System Mount
178.Pp
179The following is an example of mounting a loopback
180.Pq lofs
181file system:
182.Bd -literal
183/export/test - /opt/test lofs - yes -
184.Ed
185See
186.Xr lofs 4FS
187for an overview of the loopback file system.
188.Sh SEE ALSO
189.Xr getvfsent 3C ,
190.Xr fsck 8 ,
191.Xr mount 8 ,
192.Xr mount_hsfs 8 ,
193.Xr mount_nfs 8 ,
194.Xr mount_tmpfs 8 ,
195.Xr mount_ufs 8 ,
196.Xr swap 8
197