System Administration Guide

How to Add an Entry in the /etc/vfstab File

  1. Make sure you have met the prerequisites listed on "Prerequisites".

  2. Edit the /etc/vfstab file and add an entry.

    See Table 28-3for detailed information about the /etc/vfstab field entries. Make sure you:

    • Separate each field with white space (a space or a tab).

    • Enter a dash (-) if a field has no contents.

  3. Save the changes.

Examples--Adding an Entry in the /etc/vfstab File


 
#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       -
pluto:/export/man   -                /usr/man nfs     -      yes     ro,soft
/                   -                /tmp/newroot lofs -     yes     -                   

This example mounts the disk slice /dev/dsk/c0t3d0s7 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 fsck. The fsck pass value of 2 means that the file system will be checked, but not sequentially.

This example mounts the directory /export/man from the system pluto as an NFS file system on mount point /usr/man. It does not specify a device to fsck or a fsck pass because it's an NFS file system. In this example, mount options are ro (read-only) and soft. For greater reliability, specify the hard mount option for read/write NFS file systems.

This example mounts the root (/) file system on a loopback mount point named /tmp/newroot. It specifies 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 it depends on.