Forcing the Update of Cached Data
| Chapter 10. Administering Client Machines and the Cache Manager |

## Forcing the Update of Cached Data

AFS's callback mechanism normally guarantees that the Cache Manager provides the most current version of a file or directory to the application programs running on its machine. However, you can force the Cache Manager to discard (flush) cached data so that the next time an application program requests it, the Cache Manager fetches the latest version available at the File Server.

You can control how many file system elements to flush at a time:

- To flush only specific files or directories, use the fs flush command. This command forces the Cache Manager to discard the data and status information it has cached from the specified files or directories. It does not discard information from an application program's buffer or information that has been altered locally (changes made in the cache but not yet saved permanently to the File Server). However, the next time an application requests the element's data or status information, the Cache Manager has to contact the File Server to get it.

- To flush everything cached from a certain volume, use the fs flushvolume command. This command works like the fs flush command, but differs in two ways:

  - The Cache Manager discards data for all elements in the cache that come from the same volume as the specified files or directories.

  - The Cache Manager discards only data, not status information. This difference has little practical effect, but can lead to different output from the ls command when the two different commands are used to flush the same element.

In addition to callbacks, the Cache Manager has a mechanism for tracking other kinds of possible changes, such as changes in a volume's location. If a volume moves and the Cache Manager has not accessed any data in it for a long time, the Cache Manager's volume location record can be wrong. To resynchronize it, use the fs checkvolumes command. When you issue the command, the Cache Manager creates a new table of mappings between volume names, ID numbers, and locations. This forces the Cache Manager to reference newly relocated and renamed volumes before it can provide data from them.

It is also possible for information about mount points to become corrupted in the cache. Symptoms of a corrupted mount point included garbled output from the fs lsmount command, and failed attempts to change directory to or list the contents of a mount point. Use the fs flushmount command to discard a corrupted mount point. The Cache Manager must refetch the mount point the next time it crosses it in a pathname. (The Cache Manager periodically refreshes cached mount points, but the only other way to discard them immediately is to reinitialize the Cache Manager by rebooting the machine.

### To flush certain files or directories

1. Issue the fs flush command.

          % fs flush [<dir/file path>+]

   where

   flush

     Must be typed in full.

   dir/file path

     Names each file or directory structure to flush from the cache. Omit this argument to flush the current working directory. Flushing a directory structure does not flush any files or subdirectories cached from it.

### To flush all data from a volume

1. Issue the fs flushvolume command.

         % fs flushvolume [<dir/file path>+]

   where

   flushv

     Is the shortest acceptable abbreviation of flushvolume.

   dir/file path

     Names a file or directory from each volume to flush from the cache. The Cache Manager flushes everything in the cache that it has fetched from the same volume. Omit this argument to flush all cached data fetched from the volume that contains the current working directory.

### To force the Cache Manager to notice other volume changes

1. Issue the fs checkvolumes command.

          % fs checkvolumes

   where checkv is the shortest acceptable abbreviation of checkvolumes.

The following command confirms that the command completed successfully:

       All volumeID/name mappings checked.

### To flush one or more mount points

1. Issue the fs flushmount command.

          % fs flush [<dir/file path>+]

   where

   flushm

     Is the shortest acceptable abbreviation of flushmount.

   dir/file path

     Names each mount point to flush from the cache. Omit this argument to flush the current working directory. Files or subdirectories cached from the associated volume are unaffected.

Setting a Client Machine's Cell Membership |  | Maintaining Server Preference Ranks