File Formats vfstab(4)
NAME
vfstab - table of file system defaults
DESCRIPTION
The file /etc/vfstab describes defaults for each file sys-
tem. The information is stored in a table with the following column headings: device device mount FS fsck mount mount to mount to fsck point type pass at boot optionsThe fields in the table are space-separated and show the
resource name (device to mount), the raw device to fsck (device to fsck), the default mount directory (mount point), the name of the file system type (FS type), the number usedby fsck to decide whether to check the file system automati-
cally (fsck pass), whether the file system should be mountedautomatically by mountall (mount at boot), and the file sys-
tem mount options (mount options). (See respective mountfile system man page below in SEE ALSO for mount options.) A
'-' is used to indicate no entry in a field. This can be
used when a field does not apply to the resource being mounted. The getvfsent(3C) family of routines is used to read andwrite to /etc/vfstab.
/etc/vfstab can be used to specify swap areas. An entry so
specified, (which can be a file or a device), automatically is added as a swap area by the /sbin/swapadd script when thesystem boots. To specify a swap area, the device-to-mount
field contains the name of the swap file or device, the FS-
type is swap, mount-at-boot is no and all other fields have
no entry. iSCSI LUN can only be mounted after the iSCSI initiator SMF service, svc:/network/iscsi/initiator, is started. Set themount at boot entries for iSCSI LUN in /etc/vfstab to iscsi
instead of yes. This enables the iSCSI initiator SMF service to attempt to mount iSCSI LUN later.EXAMPLES
The following are vfstab entries for various file system
types supported in the Solaris operating environment.SunOS 5.11 Last change: 13 Apr 2010 1
File Formats vfstab(4)
Example 1 NFS and UFS Mounts The following entry invokes NFS to automatically mount the directory /usr/local of the server example1 on the client's/usr/local directory with read-only permission:
example1:/usr/local - /usr/local nfs - yes ro
The following example assumes a small departmental mail setup, in which clients mount /var/mail from a server mailsvr. The following entry would be listed in eachclient's vfstab:
mailsvr:/var/mail - /var/mail nfs - yes intr,bg
The following is an example for a UFS file system in which logging is enabled: /dev/dsk/c2t10d0s0 /dev/rdsk/c2t10d0s0 /export/local ufs 3 yes loggingSee mount_nfs(1M) for a description of NFS mount options and
mount_ufs(1M) for a description of UFS options.
Example 2 pcfs Mounts The following example mounts a pcfs file system on a fixed hard disk on an x86 machine:/dev/dsk/c1t2d0p0:c - /win98 pcfs - yes -
The example below mounts a Jaz drive on a SPARC machine. Normally, the volume management software handles mounting ofremovable media, obviating a vfstab entry. Specifying a
SunOS 5.11 Last change: 13 Apr 2010 2
File Formats vfstab(4)
device that supports removable media in vfstab with set the
mount-at-boot field to no (as shown below) disables the
automatic handling of that device. Such an entry presumes you are not running volume management software./dev/dsk/c1t2d0s2:c - /jaz pcfs - no -
For removable media on a SPARC machine, the convention for the slice portion of the disk identifier is to specify s2, which stands for the entire medium. For pcfs file systems on x86 machines, note that the disk identifier uses a p (p0) and a logical drive (c, in the /win98 example above) for a pcfs logical drive. Seemount_pcfs(1M) for syntax for pcfs logical drives and for
pcfs-specific mount options.
Example 3 CacheFS Mount Below is an example for a CacheFS file system. Because ofthe length of this entry and the fact that vfstab entries
cannot be continued to a second line, the vfstab fields are
presented here in a vertical format. In re-creating such an
entry in your own vfstab, you would enter values as you
would for any vfstab entry, on a single line.
device to mount: svr1:/export/abc device to fsck: /usr/abc mount point: /opt/cache FS type: cachefs fsck pass: 7 mount at boot: yes mount options:local-access,bg,nosuid,demandconst,backfstype=nfs,cachedir=/opt/cache
See mount_cachefs(1M) for CacheFS-specific mount options.
Example 4 Loopback File System MountSunOS 5.11 Last change: 13 Apr 2010 3
File Formats vfstab(4)
The following is an example of mounting a loopback (lofs) file system:/export/test - /opt/test lofs - yes -
See lofs(7FS) for an overview of the loopback file system.SEE ALSO
fsck(1M), mount(1M), mount_cachefs(1M), mount_hsfs(1M),
mount_nfs(1M), mount_tmpfs(1M), mount_ufs(1M), swap(1M),
getvfsent(3C) System Administration Guide: Basic AdministrationSunOS 5.11 Last change: 13 Apr 2010 4