Maintaining a CacheFS File System

This section describes how to maintain a CacheFS file system.

If you are using the /etc/vfstab file to mount
file systems, you modify the cache by editing the file system options in the /etc/vfstab file. If you are using autofs, you modify the cache
by editing the file system options in the autofs maps.

Modifying a CacheFS File System

When you modify a file system in the cache, you need to delete the cache
and then re-create it. You might also need to reboot your machine in single-user
mode, depending on how your file systems are shared and accessed.

In the following example, the cache is deleted, re-created, and then
mounted again by using demandconst option specified for
the /docs file system.

How to Display Information About a CacheFS
File System

Display information about all file systems cached under a specified
cache.

# cfsadmin -l/cache-directory

where /cache-directory is the name of the
directory where the cache resides.

Example 19–5 Displaying Information About CacheFS File Systems

The following example shows information about the /local/mycache cache
directory. In this example, the /docs file system is
cached in /local/mycache. The last line displays the
name of the CacheFS file system.

Consistency Checking of a CacheFS File
System

To ensure that the cached directories and files remain current, the
CacheFS software periodically checks the consistency of files stored in the
cache. To check consistency, the CacheFS software compares the current modification
time to the previous modification time. If the modification times are different,
all data and attributes for the directory or file are purged from the cache.
Then, new data and attributes are retrieved from the back file system.

Consistency Checking on Demand

Consistency checks can be performed only when you explicitly request
checks for file systems that are mounted by using the -o demandconst option.
If you mount a file system in a cache with this option, then use the cfsadmin command with the -s option to request a consistency
check. By default, consistency checking is performed file by file as the files
are accessed. If no files are accessed, no checks are performed. Using the -o demandconst option avoids the situation where the network is flooded
with consistency checks.

Indicates the name of the CacheFS file system, which is the
last line of the cfsadmin -l output. For more information,
see How to Display Information About a CacheFS File System. You can delete all the CacheFS file systems in
a particular cache by specifying all for cache-ID.

/cache-directory

Specifies the directory where the cache resides.

Verify that the CacheFS file system has
been deleted.

The cache ID of the file system you just deleted
should be missing from the cfsadmin-l output.

Example 19–6 Deleting a CacheFS File System

How to Check the Integrity of a CacheFS
File System

Use the fsck command to check the integrity of CacheFS
file systems. The CacheFS version of the fsck command automatically
corrects problems without requiring user interaction. You should not need
to run the fsck command manually for CacheFS file systems
because the fsck command is run automatically at boot time
or when the file system is mounted. If you want to manually check the integrity,
you can use the following procedure.