Become superuser or assume an equivalent role.
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.
Edit the /etc/vfstab file and add an entry. Make sure that you do the following:
Separate each field with white space (a space or a tab).
Enter a dash (-) if a field has no contents.
Save the changes.
For detailed information about the /etc/vfstab field entries, see Table 40–3.
Since 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.
The following example shows how to mount the disk slice /dev/dsk/c0t3d0s7 as a UFS file system to the mount point directory /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 /export/man directory from the system pluto as an NFS file system on mount point /usr/man. 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 |
The following example shows how to mount the root (/) file system on a loopback mount point, /tmp/newroot. LOFS file systems must always be mounted after the file systems that are in the LOFS file system.
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # / - /tmp/newroot lofs - yes - |