NFS Services Administrator's Guide (762805-001, March 2014)
To change the mount option from noconst to the default option, without deleting or rebuilding
the cache, enter the following commands:
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 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:
86 Configuring and administering a cache filesystem