Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
40.  Using The CacheFS File System (Tasks) Maintaining a CacheFS File System Modifying a CacheFS File System  Previous   Contents   Next 
   
 

How to Display Information About a CacheFS File System

  1. Become superuser on the client system.

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

    # cfsadmin -l /cache-directory

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

Example--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.

# cfsadmin -l /local/mycache
cfsadmin: list cache FS information
   maxblocks     90%
   minblocks      0%
   threshblocks  85%
   maxfiles      90%
   minfiles       0%
   threshfiles   85%
   maxfilesize    3MB
merlin:_docs:_docs
#

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 and new data and attributes are retrieved from the back file system.

When a user requests an operation on a directory or file, the CacheFS software checks if it is time to verify consistency. If so, the CacheFS software obtains the modification time from the back file system and performs the comparison.

Consistency Checking on Demand

Consistency checks can be performed only when you explicitly request them for file systems that are mounted with -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.

For more information, see mount_cachefs(1M).

How to Specify Cache Consistency Checking on Demand

  1. Become superuser on the client system.

  2. Mount the file system in the cache and specify cache consistency checking.

    # mount -F cachefs -o backfstype=nfs,cachedir=/directory,demandconst
    server:/file-system /mount-point

  3. Initiate consistency checking on a specific CacheFS file system.

    # cfsadmin -s /mount-point

How to Delete a CacheFS File System

  1. Become superuser on the client system.

  2. Unmount the CacheFS file system.

    # umount /mount-point

    /mount-point specifies the CacheFS file system that you want to delete.

  3. Determine the name of the CacheFS file system (cache ID).

    # cfsadmin -l /cache-directory
    cfsadmin: list cache FS information
       maxblocks     90%
       minblocks      0%
       threshblocks  85%
       maxfiles      90%
       minfiles       0%
       threshfiles   85%
       maxfilesize    3MB
    cache-ID
    #
  4. Delete the CacheFS file system from the specified cache.

    # cfsadmin -d cache-ID /cache-directory

    cache-ID

    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.

  5. Verify that the file system has been deleted.

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

    # cfsadmin -l /cache-directory
    cfsadmin: list cache FS information
       maxblocks     90%
       minblocks      0%
       threshblocks  85%
       maxfiles      90%
       minfiles       0%
       threshfiles   85%
       maxfilesize    3MB
    # 

    For more information about the fields that are specified in the command output, refer to cfsadmin(1M).

  6. Update the resource counts for the cache by running the fsck -F cachefs command.

    For more information, see "How to Check the Integrity of a CacheFS File System".

Examples--Deleting a CacheFS File System

The following example shows how to delete the file systems from the cache.

# umount /cfssrc
# cfsadmin -l /cfssrc
# cfsadmin -d _dev_dsk_c0t6d0s0:_cfssrc
# cfsadmin -l

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.

For more information, see fsck_cachefs(1M).

  1. Become superuser on the client system.

  2. Check the file systems in the specified cache.

    # fsck -F cachefs [-m -o noclean] /cache-directory

    -m

    Causes the fsck command to check a CacheFS file system without making any repairs.

    -o noclean

    Forces a check on the CacheFS file systems only. Does not make any repairs.

    /cache-directory

    Indicates the name of the directory where the cache resides.

 
 
 
  Previous   Contents   Next