NFS Services Administrator's Guide (B.11.31.03) August 2008

not logged: /cfs_mnt1
Caching a Complete Binary
CacheFS is designed to work best with NFS filesystems that contain stable read-only
data. One of the most common uses of CacheFS is managing application binaries. These
are typically read-only and are rarely ever modified. They are modified when new
versions of the application are installed or a patch containing a modified binary is
installed. The rpages mount option enables you to cache a complete binary file.
When an application in a cached NFS filesystem is executed, CacheFS checks if the
binary file is cached. If it is not cached, then the client reads the entire binary file and
automatically caches it. If the rpages mount option is not used, only the accessed
portion of the binary is cached. Using the rpages mount option causes slower initial
load times, but subsequent executions of the application binary are significantly faster.
For example, to load the netscape binary, do the following:
1. To create a cache, if it does not exist, enter the following command:
cfsadmin -c /cachedir
2. To mount the cache filesystem, enter the following command:
mount -F cachefs -o backfstype=nfs,rpages,cachedir=/cachedir \
nfsserver:/opt/netscape /opt/netscape
3. To run the netscape binary in /opt/netscape, enter the following command:
/opt/netscape/netscape
The netscape binary and the files that netscape needs are cached and populated
in the cache directory /cachedir.
For more information on the rpages mount option, see mount_cachefs(1M).
Packing a Cached Filesystem
Starting with HP-UX 11i v3, the cachefspack command is introduced to provide
greater control over the cache. This command enables you to specify files and directories
to be loaded, or packed, in the cache. It also ensures that the current copies are always
available in the cache.
You can pack files using one of the following methods:
Specifying the files or directories to be packed
Enter the following command to pack a file in the cache:
cachefspack -p filename
where:
-p Packs the file or files in the cache.
filename Name of the file or directory that is to be packed in the cache.
118 Configuring and Administering a Cache Filesystem