Solaris Transition Guide

Sharing File Systems

File systems were "exported" in the SunOS release 4 software to make them available to other systems. This was done through the /etc/exports file and the exportfs command. However, only NFS systems could be exported.

In the SunOS release 5.7 software, this same concept is referred to as "sharing resources," and it has been expanded to include more file systems. File systems are shared with the share(1M) and shareall(1M) commands. The share command is similar to the exportfs pathname command, while shareall is similar to the exportfs -a command.

The share -F fstype option specifies the type of file system to be shared. If the -F option is not specified, share uses the first file-system type listed in the /etc/dfs/dfstab file.

File systems that you want to be shared automatically should have share command entries in the /etc/dfs/dfstab file (which replaces the /etc/export file). The commands specified in this file are run automatically when the system enters run level 3 (multiuser mode with network file sharing).

Example of /etc/dfs/dfstab File Entries

The following entry gives clients on mercury, venus, and mars read-write access to /export/home1; the second entry gives clients on saturn and jupiter read-only access to /export/news.

share -F nfs -o rw=mercury:venus:mars -d "Home Dir" /export/home1
share -F nfs -o ro=saturn:jupiter -d "News Postings" /export/news

When the system is running in multiuser mode, these file systems are available to the clients listed. The share command displays all resources shared by the local system.

% share
-               /export/home1   rw=mercury:venus:mars   "Home Dir"
-               /export/news    ro=saturn:jupiter   "News Postings"