NFS Services Administrator's Guide (B.11.31.04) March 2009

umount /mnt1
mount -F cachefs -o backfstype=nfs,cachedir=/cache
CFS1:/tmp /mnt1
To change the mount option from default to weakconst after unmounting, enter the
following command:
mount -F cachefs -o backfstype=nfs,cachedir=/cache,weakconst
CFS2:/tmp /mnt1
For more information on the various mount options of the CacheFS filesystem, see
mount_cachefs(1M).
Automounting a Filesystem Using CacheFS
This section describes how to automount a filesystem using CacheFS.
Before you automount an NFS filesystem using CacheFS, you must configure a directory
in a local filesystem as cache. For more information on how to configure a directory as
cache, see “Creating a CacheFS Cache” (page 112).
To automount a filesystem using CacheFS, follow these steps:
1. Add a line to the appropriate AutoFS direct or indirect map, as in the following
examples:
Example 1
Direct map example:
/tmp/dist -nosuid,fstype=cachefs,backfstype=nfs, \
cachedir=/disk2/cache distserver:/export/dist
Example 2
Indirect map example:
proj1 -nosuid,fstype=cachefs,backfstype=nfs, \
cachedir=/disk2/cache \
/src testbox1:/export/proj1/src \
/data testbox2:/export/proj1/data
2. If you have modified a direct map, enter the following command on each NFS
client that uses the map, to force AutoFS to reread its maps:
/usr/sbin/automount
NOTE: If you have modified an indirect map, the changes are read immediately.
AutoFS need not be restarted and forced to reread it maps.
You can specify caching in an NIS AutoFS map, or by using LDAP, only if all the clients
who use the map have their caching directory set up in the same location
(/disk2/cache in the examples).
114 Configuring and Administering a Cache Filesystem