System Administration Guide: Devices and File Systems

ProcedureHow to Delete a CacheFS File System

  1. Become superuser on the client system.

  2. Unmount the CacheFS file system.


    # umount /mount-point
    

    where /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 CacheFS 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.


    # fsck -F cachefs /cache-directory
    

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


Example 20–6 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
# fsck -F cachefs /cache-directory