Information Technology Reference
In-Depth Information
command, at system boot, by adding it to the
/etc/vfstab
file, or as needed
using the AutoFS mechanism (described in the previous section).
The root (
/
) and
/usr
file systems cannot be cached using the CacheFS mechanism.
However, these two file systems can be cached using the Auto Client configuration.
Configuring a Cache
The
cfsadmin(1M)
command is used to create, check, tune, and delete
caches. The
cachefsstat(1M)
command can also be used to display cache
statistics.
The
-c
command-line argument is specified to create a cache, followed by
the full pathname of a directory to be used for the cache. In addition, multi-
ple options (separated by commas) can be specified using the
-o
command-
line argument. The following listing shows using the
cfsadmin
command to
create a cache under the
/cache
directory. The size of the largest file that can
be cached is set to 10MB:
# cfsadmin -c -o maxfilesize=10 /cache
#
To list the file systems mounted in the cache and cache status, use the
-l
command-line argument. Additional command-line arguments include
-s
to
perform a consistency check,
-u
to update cache parameters, and
-d
to delete
a cache. All of these command-line arguments should be followed by the full
pathname of the cache directory.
Mounting a remote NFS resource in the cache using the
mount
command
requires specifying the remote file system, the local cache, and a local mount
point.
The
-F
command-line argument should be used to identify the file system
type as
cacheFS
. In addition, at least two cache-specific mount options need
to be specified using the
-o
command-line argument:
backfstype
, which is
used to identify the type of file system being mounted (typically
nfs
), and
cachedir
, which is used to identify the cache directory. The following listing
shows using the
mount
command to mount the
/export/home
file system
from the host
sparc20
on the
/home
mount point (referred to as the front file
system) using
/cache
as the cache directory. The line is wrapped to improve
readability:
# mount -F cachefs -o backfstype=nfs,cachedir=/cache
sparc20:/export/home /home
#