Configuring CacheFS

CacheFS is not implemented by default or prompted at the time of the creation of an NFS file system. You must specify explicitly which file systems are to be mounted in the cache.

To specify which file systems are to be mounted in the cache, do the following:

  1. Create the local cache file system by using the cfsadmin command:
    # cfsadmin -c -o parameters cache-directory

    where parameters specify the resource parameters and cache-directory is the name of the directory where the cache should be created.

  2. Mount the back file system onto the cache:
    # mount -V cachefs -o backfstype=nfs,cachedir=/cache-directory remhost:/rem-directory local-mount-point

    where rem-directory is the name of the remote host and file system where the data resides, and local-mount-point is the mount point on the client where the remote file system should be mounted.

  3. Alternately, you could administer CacheFS using the SMIT command (use the smitty cachefs fast path).

Several parameters can be set at creation time, as follows:

maxblocks
Sets the maximum number of blocks that CacheFS is allowed to claim within the front file system. Default = 90 percent.
minblocks
Sets the minimum number of blocks that CacheFS is allowed to claim within the front file system. Default = 0 percent.
threshblocks
Sets the number of blocks that must be available in the JFS file system on the client side before CacheFS can claim more than the blocks specified by minblocks. Default = 85 percent.
maxfiles
Maximum number of files that CacheFS can use, expressed as a percentage of the total number of i-nodes in the front file system. Default = 90 percent.
minfiles
Minimum number of files that CacheFS is always allowed to use, expressed as a percentage of the total number of i-nodes in the front file system. Default = 0 percent.
maxfilesize
Largest file size, expressed in megabytes, that CacheFS is allowed to cache. Default = 3.