Managing File Systems in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014

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

Use this procedure to mount non-ZFS file systems at boot time unless legacy mount behavior is needed for some ZFS file systems. For more information about mounting ZFS file systems, see Managing ZFS File Systems in Oracle Solaris 11.2 .

  1. Become an administrator.

    For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. Create a mount point for the file system to be mounted, if necessary.
    # mkdir /mount-point

    There must be a mount point on the local system to mount a file system. A mount point is a directory to which the mounted file system is attached.

  3. Edit the /etc/vfstab file and add an entry. Ensure that you do the following:
    1. Separate each field with white space (a space or a tab).
    2. Specify a dash (-) if a field has no contents.
    3. Save the changes.

    Note - Because the root (/) file system is mounted read-only by the kernel during the boot process, only the remount option (and options that can be used in conjunction with remount) affect the root (/) entry in the /etc/vfstab file.
Example 2-7  Adding an Entry to the /etc/vfstab File

The following example shows how to mount the disk slice /dev/dsk/c0t3d0s7 as a legacy UFS file system to the mount point /files1. The raw character device /dev/rdsk/c0t3d0s7 is specified as the device to fsck. The fsck pass value of 2 means that the file system will be 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 shows how to mount the legacy /export/man directory from the system pluto as an NFS file system on mount point /usr/man. Neither a device to fsck nor a fsck pass is specified because it's an NFS file system. In this example, mount options are ro (read-only) and soft.

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

After you add the remote system and resource to the /etc/vfstab file, be sure that the following service is started.

# svcs -a | grep nfs/client
disabled       May_14   svc:/network/nfs/client:default
# svcadm enable svc:/network/nfs/client:default

Otherwise, the remote file system will not be mounted after the system is rebooted.