[ Team LiB ] Previous Section Next Section

The Virtual File System Table (/etc/vfstab)

Each system has a virtual file system table, /etc/vfstab, that lists all the disk slices and file systems available to the system. The file system table also specifies the mount point and options for each file system. The /etc/vfstab file replaces /etc/fstab and functions in a similar manner. The default file system configuration table (the /etc/vfstab file) depends on the selections made for each system when system software was installed. You should edit the /etc/vfstab file for each system to automatically mount local UFS file systems, essential NFS file systems, and any other appropriate file systems.

This section describes the contents of the /etc/vfstab file and provides information on how to edit and use the file. The file system table is an ASCII file. Comment lines begin with #. The following example shows an /etc/vfstab file for a system with two slices.


castle% more /etc/vfstab
#device         device          mount          FS     fsck    mount   mount
#to mount       to fsck         point          type   pass    at boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr         ufs    1       yes     -
fd      -       /dev/fd fd      -       no     -
/proc   -       /proc   proc    -       no     -
/dev/dsk/c0t3d0s1       -       -       swap   -      no      -
/dev/dsk/c0t3d0s0       /dev/rdsk/c0t3d0s0     /      ufs     1       no     -
swap    -       /tmp    tmpfs   -       yes    -
castle%

Refer to "Disk-Naming Conventions" on page 296 for information on disk device naming conventions.

Note that for / and /usr, the mount at boot field value is specified as no because these file systems are mounted as part of the boot sequence before the mountall command is run. If the mount at boot field value is specified as yes, the mountall program redundantly (and unnecessarily) tries to mount these already mounted file systems.

The file system table has seven fields, each separated by a Tab, as described in Table 45.

Table 45. Fields in the /etc/vfstab File

Field

Description

device to mount

The device to mount can be one of the following.

 

The slice for local UFS file systems (for example, /dev/dsk/c0t0d0s0).

 

The resource name for remote file systems (for example, myserver:/export/home for an NFS file system).

 

The name of the slice on which to swap (for example, /dev/dsk/c0t3d0s1).

 

The /proc directory and proc file system type.

 

A block special device that denotes a particular slice on a CD-ROM. This slice has an HSFS file system or some other CD-ROM-compatible file system written to it.

 

/dev/diskette as PCFS or UFS file system type. This field is also used to specify swap file systems.

device to fsck

The raw (character) special device that corresponds to the file system identified by the device to fsck field (for example, /dev/rdsk/c0t0d0s0). This field determines the raw interface that is used by fsck. Use a dash (-) when either there is no file system written on the slice or the entry denotes an NFS-mounted file system.

mount point

The mount point directory (for example, /usr for /dev/dsk/c0t0d0s6).

FS type

The type of file system identified by the device to fsck field.

fsck pass

The pass number used by fsck to decide whether to check a file system. When the field contains a dash (-), the file system is not checked. When the field contains a value of 1 or more, the file systems are checked sequentially; non- ufs file systems with a zero fsck pass are checked. For ufs file systems only, when the field contains a zero (0), the file system is not checked. When fsck is run on multiple ufs file systems that have fsck pass values greater than 1 and the preen option (-o p) is used, fsck automatically checks the file systems on different disks in parallel to maximize efficiency. Otherwise, the value of the pass number has no effect.

mount at boot

Indicate yes or no for whether the file system should be automatically mounted by mountall when the system is booted.

mount options

A list of comma-separated options (with no spaces) that are used in mounting the file system. Use a dash (-) to show no options. See the mount_file-system-type(1M) manual page for a list of the available options.

* In the Solaris Operating Environment, fsck pass does not explicitly specify the order in which file systems are checked as it did with SunOS 4.x system software.

NOTE. You must have an entry in each field in the /etc/vfstab file. If there is no value for the field, be sure to enter a dash (–).


NFS Client Failover

NFS client failover, introduced in the Solaris 2.6 release, provides a high level of availability of read-only file systems by enabling a client to automatically mount the file system from another server if the first server becomes unavailable.

The file system can become unavailable if the server crashes, if the server is overloaded, or if a network faults. The failover in these conditions can occur at any time without disrupting the processes running on the client.

Failover file systems must be mounted read-only. The file systems must be identical for failover to succeed. You cannot use file systems mounted by CacheFS with failover because extra information stored for each CacheFS file system cannot be updated during failover.

When using client failover, you specify additional hosts from which to mount a file system in case the first host cannot be reached. You can specify alternative failover servers in the /etc/vfstab file, through the automounter, or from the command line.

The following example shows an /etc/vfstab client failover entry.


paperbark,castle:/export/share/local - /usr/local nfs - no ro

NOTE. You cannot mix servers running different versions of the NFS protocol by using a command line or in an /etc/vfstab entry. You can mix servers supporting NFS V2 and V3 protocols only with the automounter. In this case, client failover uses the best subset of version 2 or version 3 servers.


The following example uses the mount command with client failover.


# mount -F nfs -o ro paperbark,castle:/export/share/man /usr/man
#



Creation of an Entry in the File System Table

Use the following steps to create an entry in the file system table.

  1. Become superuser.

  2. Edit the /etc/vfstab file, using an editor such as vi.

  3. Add the entry, separating each field with white space (a space or a Tab). If a field has no entry, enter a dash (-).

  4. Save the changes.

  5. Check to be sure the mount point directory is present. If it's not, create the mount point by changing to the directory in which you want to create it, typing mkdir directory-name, and pressing Return.

  6. Type mount mount-point and press Return.

    The entry is mounted.

The following example mounts the disk slice /dev/dsk/c0t3d0s7, which contains a UFS file system, as a ufs file system attached to the mount point directory /files1 with the default mount options (read/write). It specifies the raw character device /dev/rdsk/c0t3d0s7 as the device to check with fsck. The fsck pass value of 2 means that the file system is checked, but not sequentially.


#device      device             mount   FS    fsck    mount    mount
#to mount    to fsck            point   type  pass    at boot  options
#
/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /files1 ufs   2       yes -

The following example mounts the directory /export/man from the system oak as an nfs file system on mount point /usr/man. You do not specify a device to fsck or a fsck pass for NFS file systems. In the following example, mount options are ro (read-only) and soft. For greater reliability, for read/write NFS file systems, specify the hard mount option (rw,hard).


#device          device       mount      FS      fsck       mount    mount
#to mount        to fsck      point      type    pass       at boot  options
oak:/export/man    -          /usr/man   nfs     -          yes     ro,soft

The following example mounts a CD-ROM drive on a mount point named /hsfiles. CD-ROM files typically are read-only, so you specify ro for the mount options. Specify no for mount at boot because you are most likely to mount and unmount a CD-ROM from the command line or by using volume management. Because hsfs is read-only, specify no device to fsck and no fsck pass number.


#device         device      mount       FS     fsck      mount     mount
#to mount       to fsck     point       type   pass      at boot   options
/dev/dsk/c0t6d0s2 -         /hsfiles    hsfs   -         no        ro

The following example mounts the diskette drive on a mount point named /pcfiles. Specify no for mount at boot because you are most likely to mount and unmount a diskette from the command line or by using volume management. Specify no to fsck or fsck pass because the pcfs file system does not support fsck.


#device           device     mount       FS       fsck     mount     mount
#to mount         to fsck    point       type     pass     at boot   options
/dev/diskette     -          /pcfiles    pcfs     -        no        rw

The following example mounts the root file system on a loopback mount point named /mnt/newroot. Specify yes for mount at boot, no device to fsck, and no fsck pass number. Loopback file systems must always be mounted after the file systems used to make up the loopback file system. Be sure that the loopback entry is the last entry in the /etc/vfstab file so that it follows the entries that depend on it.


#device           device       mount         FS      fsck      mount     mount
#to mount         to fsck      point         type    pass      at boot   options
/                 -            /tmp/newroot  lofs    -         yes      -



    [ Team LiB ] Previous Section Next Section