Something like this
Autofs consults the master map configuration file /etc/auto_master to determine the mount points defined. Then, it starts an automatic mounting process. Each line of the master map defines a mount point and a separate map file that defines the file systems to be mounted under this mount point. for example, /etc/auto.misc defines mount points in the /misc directory; this relationship would be defined in /etc/auto_master.
Each entry in auto_master has
1 Assembly point.
2 The location of the map file
To mount the shared /usr/backup/poolrecovery directory of the storm server to the /misc/poolrecovery mount point, add the following line to the /etc/auto_master file
/misc /etc/auto.misc
Then we add this line to the /etc/auto.misc file
poolrecovery -rw,soft,intr,tcp,rsize=8192,wsize=8192 \
tormenta:/usr/backup/poolrecovery
The first field in /etc/auto.misc is the name of the /misc subdirectory and is created dynamically by automount. The second field is the mount options and the third field is the NFS export location which includes the hostname and directory.
The /misc directory must exist on the local file system and must not contain a subdirectory under /misc
We restart the service
# service automountd restart
Stopping automountd.
Waiting for PIDS: 37558.
Starting automountd.
% mount | grep autofs
map -hosts on /net (autofs)
map /etc/auto.misc on /misc (autofs)
% ls /misc/poolrecovery
...
map -hosts on /net (autofs)
tormenta:/usr/backup/poolrecovery on /misc/poolrecovery (nfs, automounted)
Of course, you also need:
NFS over ZFS
# zfs create -o canmount=off zroot/usr/backup
# zfs get mounted zroot/usr/backup
NAME PROPERTY VALUE SOURCE
zroot/usr/backup mounted no -
# zfs create -o mountpoint=/usr/backup/poolrecovery zroot/usr/backup/poolrecovery
Regardless of the method chosen /etc/exports must exist
Create /etc/exports
# touch /etc/exports
Start sharing sharenfs=on
# zfs set sharenfs=on zroot/usr/backup/poolrecovery
To stop sharing the data set, set sharenfs to off.
# zfs set sharenfs=off zroot/dellhome
Set a maproot user and restrict clients to the local network
# zfs set sharenfs="-maproot=0 192.168.88.51" zroot/usr/backup/poolrecovery
Using ZFS is less flexible for managing NFS exports because all allowed hosts get the same options.
ZFS automatically creates the File /etc/exports
cat /etc/zfs/exports
# !!! DO NOT EDIT THIS FILE MANUALLY !!!
/usr/backup/poolrecovery -maproot=0 192.168.88.51
Enable NFS client (solaris)
/etc/hosts
...
192.168.88.160 solaris
192.168.88.51 tormenta
...
sysrc nfs_client_enable=YES
List all NFS exports available to a client
$ showmount -e tormenta
Exports list on tormenta:
/usr/backup/poolrecovery 192.168.88.51
solaris:~ % showmount -e tormenta
Exports list on tormenta:
/usr/backup/poolrecovery 192.168.88.51