NFS Services Administrator's Guide HP-UX 11i version 3
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 84).
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).
Enabling Logging in CacheFS
This section describes how you can enable logging in CacheFS. You can use the cachefslog
command to enable logging for a CacheFS mount-point. Enabling the logging functionality may
have a performance impact on the operations performed for all the CacheFS mount-points that
are using the same cache directory.
To enable CacheFS logging, follow these steps:
1. Log in as superuser.
2. To enable logging for a CacheFS mount-point, say /cfs_mnt1, enter the following command:
cachefslog -f /tmp/logfile /cfs_mnt1
Where:
/tmp/logfile Specifies the logfile to be used.
NOTE: When multiple mount-points use the same cache directory, enabling logging for
one CacheFS mount-point automatically enables logging for all the other mount-points.
3. To verify if logging is enabled for /cfs_mnt1, enter the following command:
86 Configuring and Administering a Cache Filesystem