|[ Team LiB ]|
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.
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.
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 ]|