How to Mount a File System at Boot Time

This procedure shows how to mount file systems at boot time instead of using the autofs maps. This procedure must be completed on every client that requires access to remote file systems.

  1. Become an administrator.
  2. Add an entry for the file system to the /etc/vfstab file.

    Entries in the /etc/vfstab file have the following syntax:

    #device       device       mount      FS      fsck    mount     mount    
    #to mount     to fsck      point      type    pass    at boot   options

    For information about the /etc/vfstab file entries, see the vfstab(5) man page.

    Caution:

    NFS servers that also have NFS client vfstab entries must always specify the bg option to avoid a system hang during reboot. For more information, see the mount(8) man page.
  3. Enable the NFS client service.
    # svcadm enable -r nfs/client

    Note:

    The nfs/client service does not need to be enabled for manual mounts or when using autofs maps. The sole purpose of the nfs/client service is to mount the NFS file systems that are listed in /etc/vfstab with the mount at boot field set to yes.

Example 3-1 Entry in the Client's /etc/vfstab File

Assume that you want a client system to mount the /var/mail directory from the server wasp. You want the file system to be mounted as /var/mail on the client, and you want the client to have read-write access. You would add the following entry to the client's vfstab file:

wasp:/var/mail - /var/mail nfs - yes rw