1 '\" te
   2 .\" Copyright (c) 2001 Sun Microsystems, Inc. All Rights Reserved.
   3 .\" Copyright 1989 AT&T
   4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   7 .TH VFSTAB 4 "Mar 2, 2007"
   8 .SH NAME
   9 vfstab \- table of file system defaults
  10 .SH DESCRIPTION
  11 .sp
  12 .LP
  13 The file \fB/etc/vfstab\fR describes defaults for each file system. The
  14 information is stored in a table with the following column headings:
  15 .sp
  16 .in +2
  17 .nf
  18 device       device       mount      FS      fsck    mount      mount
  19 to mount     to fsck      point      type    pass    at boot    options
  20 .fi
  21 .in -2
  22 .sp
  23 
  24 .sp
  25 .LP
  26 The fields in the table are space-separated and show the resource name
  27 (\fIdevice to mount\fR), the raw device to \fBfsck\fR (\fIdevice to fsck\fR),
  28 the default mount directory (\fImount point\fR), the name of the file system
  29 type (\fIFS type\fR), the number used by \fBfsck\fR to decide whether to check
  30 the file system automatically (\fIfsck pass\fR), whether the file system should
  31 be mounted automatically by \fBmountall\fR (\fImount at boot\fR), and the file
  32 system mount options (\fImount options\fR). (See respective mount file system
  33 man page below in \fBSEE ALSO\fR for \fImount options\fR.) A '-' is used to
  34 indicate no entry in a field. This may be used when a field does not apply to
  35 the resource being mounted.
  36 .sp
  37 .LP
  38 The \fBgetvfsent\fR(3C) family of routines is used to read and write to
  39 \fB/etc/vfstab\fR.
  40 .sp
  41 .LP
  42 \fB/etc/vfstab\fR can be used to specify swap areas. An entry so specified,
  43 (which can be a file or a device), will automatically be added as a swap area
  44 by the \fB/sbin/swapadd\fR script when the system boots. To specify a swap
  45 area, the \fIdevice-to-mount\fR field contains the name of the swap file or
  46 device, the \fIFS-type\fR is "swap", \fImount-at-boot\fR is "no" and all other
  47 fields have no entry.
  48 .SH EXAMPLES
  49 .sp
  50 .LP
  51 The following are \fBvfstab\fR entries for various file system types supported
  52 in the Solaris operating environment.
  53 .LP
  54 \fBExample 1 \fRNFS and UFS Mounts
  55 .sp
  56 .LP
  57 The following entry invokes NFS to automatically mount the directory
  58 \fB/usr/local\fR of the server \fBexample1\fR on the client's \fB/usr/local\fR
  59 directory with read-only permission:
  60 
  61 .sp
  62 .in +2
  63 .nf
  64 example1:/usr/local - /usr/local nfs - yes ro
  65 .fi
  66 .in -2
  67 .sp
  68 
  69 .sp
  70 .LP
  71 The following example assumes a small departmental mail setup, in which clients
  72 mount \fB/var/mail\fR from a server \fBmailsvr\fR. The following entry would be
  73 listed in each client's \fBvfstab\fR:
  74 
  75 .sp
  76 .in +2
  77 .nf
  78 mailsvr:/var/mail - /var/mail nfs - yes intr,bg
  79 .fi
  80 .in -2
  81 .sp
  82 
  83 .sp
  84 .LP
  85 The following is an example for a UFS file system in which logging is enabled:
  86 
  87 .sp
  88 .in +2
  89 .nf
  90 /dev/dsk/c2t10d0s0 /dev/rdsk/c2t10d0s0 /export/local ufs 3 yes logging
  91 .fi
  92 .in -2
  93 .sp
  94 
  95 .sp
  96 .LP
  97 See \fBmount_nfs\fR(1M) for a description of NFS mount options and
  98 \fBmount_ufs\fR(1M) for a description of UFS options.
  99 
 100 .LP
 101 \fBExample 2 \fR\fBpcfs\fR Mounts
 102 .sp
 103 .LP
 104 The following example mounts a \fBpcfs\fR file system on a fixed hard disk on
 105 an x86 machine:
 106 
 107 .sp
 108 .in +2
 109 .nf
 110 /dev/dsk/c1t2d0p0:c - /win98 pcfs - yes -
 111 .fi
 112 .in -2
 113 .sp
 114 
 115 .sp
 116 .LP
 117 The example below mounts a Jaz drive on a SPARC machine. Normally, the volume
 118 management software handles mounting of removable media, obviating a
 119 \fBvfstab\fR entry. Specifying a device that supports removable media in
 120 \fBvfstab\fR  with set the mount-at-boot field to \fBno\fR (as shown below)
 121 disables the  automatic handling of that device. Such an entry presumes you are
 122 not running volume management software.
 123 
 124 .sp
 125 .in +2
 126 .nf
 127 /dev/dsk/c1t2d0s2:c - /jaz pcfs - no -
 128 .fi
 129 .in -2
 130 .sp
 131 
 132 .sp
 133 .LP
 134 For removable media on a SPARC machine, the convention for the slice portion of
 135 the disk identifier is to specify \fBs2\fR, which stands for the entire medium.
 136 
 137 .sp
 138 .LP
 139 For \fBpcfs\fR file systems on x86 machines, note that the disk identifier uses
 140 a \fBp\fR (\fBp0\fR) and a logical drive (\fBc\fR, in the \fB/win98\fR example
 141 above) for a \fBpcfs\fR logical drive. See \fBmount_pcfs\fR(1M) for syntax for
 142 \fBpcfs\fR logical drives and for \fBpcfs\fR-specific mount options.
 143 
 144 .LP
 145 \fBExample 3 \fRCacheFS Mount
 146 .sp
 147 .LP
 148 Below is an example for a CacheFS file system. Because of the length of this
 149 entry and the fact that \fBvfstab\fR entries cannot be continued to a second
 150 line, the \fBvfstab\fR fields are presented here in a vertical format. In
 151 re-creating such an entry in your own \fBvfstab\fR, you would enter values as
 152 you would for any \fBvfstab\fR entry, on a single line.
 153 
 154 .sp
 155 .in +2
 156 .nf
 157 device to mount:  svr1:/export/abc
 158 device to fsck:  /usr/abc
 159 mount point:  /opt/cache
 160 FS type:  cachefs
 161 fsck pass:  7
 162 mount at boot:  yes
 163 mount options:
 164 local-access,bg,nosuid,demandconst,backfstype=nfs,cachedir=/opt/cache
 165 .fi
 166 .in -2
 167 .sp
 168 
 169 .sp
 170 .LP
 171 See \fBmount_cachefs\fR(1M) for CacheFS-specific mount options.
 172 
 173 .LP
 174 \fBExample 4 \fRLoopback File System Mount
 175 .sp
 176 .LP
 177 The following is an example of mounting a loopback (\fBlofs\fR) file system:
 178 
 179 .sp
 180 .in +2
 181 .nf
 182 /export/test - /opt/test lofs - yes -
 183 .fi
 184 .in -2
 185 .sp
 186 
 187 .sp
 188 .LP
 189 See \fBlofs\fR(7FS) for an overview of the loopback file system.
 190 
 191 .SH SEE ALSO
 192 .sp
 193 .LP
 194 \fBfsck\fR(1M), \fBmount\fR(1M), \fBmount_cachefs\fR(1M), \fBmount_hsfs\fR(1M),
 195 \fBmount_nfs\fR(1M), \fBmount_tmpfs\fR(1M), \fBmount_ufs\fR(1M),
 196 \fBswap\fR(1M), \fBgetvfsent\fR(3C)
 197 .sp
 198 .LP
 199 \fISystem Administration Guide: Basic Administration\fR