System Administration Guide: Basic Administration

Chapter 40 Using The CacheFS File System (Tasks)

This chapter describes how to set up and maintain CacheFSTM file systems.

This is a list of task maps in this chapter.

For information on troubleshooting CacheFS errors, see Troubleshooting cachefspack Errors.

High-Level View of Using the CacheFS File System (Task Map)

Use this task map to identify all the tasks for using CacheFS file systems. Each task in this map points to a series of additional tasks such as creating and mounting the CacheFS file systems, and packing and maintaining the cache.

Task 

Description 

For Instructions 

1. Create and mount a CacheFS file system 

Create the cache and mount the file system in the cache. 

Creating and Mounting a CacheFS File System (Task Map)

2. Maintain a CacheFS file system 

Display and modify a CacheFS file system by unmounting, removing, or re-creating the cache. 

Maintaining a CacheFS File System (Task Map)

3. (Optional) Pack and unpack a CacheFS file system 

Determine whether you want to pack the cache and use packing lists. Packing the cache ensures that certain files and directories are always updated in the cache. 

Packing a Cached File System (Task Map)

4. Collect CacheFS statistics 

Determine cache performance and appropriate cache size. 

Collecting CacheFS Statistics (Task Map)

Overview of the CacheFS File System

The CacheFS file system is a general purpose caching mechanism that improves NFS server performance and scalability by reducing server and network load. Designed as a layered file system, the CacheFS file system provides the ability to cache one file system on another. In an NFS environment, the CacheFS file system increases the client per server ratio, reduces server and network loads, and improves performance for clients on slow links, such as Point-to-Point Protocol (PPP).

How a CacheFS File System Works

You create a CacheFS file system on a client system so that file systems you cache can be accessed by the client locally instead of across the network. The following figure shows the relationship of the components that are involved in using CacheFS file system.

Figure 40–1 How a CacheFS File System Works

Graphic

The back file system is the file system that you specify to be mounted in the cache, which can be either NFS or HSFS (High Sierra File System). When the user attempts to access files that are part of the back file system, those files are placed in the cache. The front file system is the file system that is mounted in the cache and is accessed from the local mount point. The front file system type must be UFS.

To the user, the initial request to access a file in a CacheFS file system might seem slow, but subsequent uses of the same file are faster.

CacheFS File System Structure and Behavior

Each cache has a set of parameters that determines how it behaves and its structure. The parameters are set to default values which are listed in the following table. The default values specify that the entire front file system is used for caching, which is the recommended method of caching file systems.

Table 40–1 CacheFS File System Parameters and Their Default Values

CacheFS File System Parameter 

Default Value 

Definition 

maxblocks

90% 

Sets the maximum number of blocks that a CacheFS file system is allowed to claim within the front file system. 

minblocks

0% 

Sets the minimum number of blocks that a CacheFS file system is allowed to claim within the front file system. 

threshblocks

85% 

Sets the number of blocks that must be available in the front file system before a CacheFS file system can claim more than the blocks specified by minblocks.

maxfiles

90% 

Sets the maximum number of available inodes (number of files) that a CacheFS file system is allowed to claim within the front file system. 

minfiles

0% 

Sets the minimum number of available inodes (number of files) that a CacheFS file system is allowed to claim within the front file system. 

threshfiles

85% 

Sets the number of inodes (number of files) that must be available in the front file system before a CacheFS file system can claim more than the files specified in minfiles.

Typically, you should not change any of these parameter values. They are set to default values to achieve optimal cache behavior. However, you might want to modify the maxblocks and maxfiles values if you have some room in the front file system that is not used by the cache, and you wish to use it for some other file system. You do so by using the cfsadmin command. For example:


$ cfsadmin -o maxblocks=60

Creating and Mounting a CacheFS File System (Task Map)

Use the procedures in this table to create and mount a CacheFS file system.

Task 

Description 

For Instructions 

1. Share the file system to be cached 

Verify that the file system you want to cache is shared. 

share(1M)

2. Create the cache 

Use the cfsadmin command to create the cache.

How to Create the Cache

3. Mount a file system in the cache 

Mount a file system in a cache by using one of the following methods: 

 

 

Mount a CacheFS file system by using the mount command.

How to Mount a CacheFS File System (mount)

 

Mount a CacheFS file system by editing the /etc/vfstab file.

How to Mount a CacheFS File System (/etc/vfstab)

 

Mount a cached a file system by using AutoFS. 

How to Mount a CacheFS File System (AutoFS)

How to Create the Cache

  1. Become superuser on the client system.

  2. Create the cache.


    # cfsadmin -c /cache-directory
    

    cache-directory indicates the name of the directory where the cache resides.

    For more information, see cfsadmin(1M).


    Note –

    After you have created the cache, do not perform any operations within the cache directory itself. Doing so could cause conflicts within the CacheFS software.


Example—Creating the Cache

The following example shows how to create a cache in the /local/mycache directory by using the default cache parameter values.


# mkdir /local
# cfsadmin -c /local/mycache

Mounting a File System in the Cache

You specify a file system to be mounted in the cache so that users can locally access files in that file system. The files do not actually get placed in the cache until the user accesses the files.

The following table describes three ways to mount a CacheFS file system.

Mount Type for CacheFS File System 

Frequency of CacheFS Mount Type 

Using the mount command

Every time the system reboots in order to access the same file system. 

Editing the /etc/vfstab file

Only once. The /etc/vfstab file remains unchanged after the system reboots.

Using AutoFS 

Only once. AutoFS maps remain unchanged after the system reboots.  

Choose the method of mounting file systems that best suits your environment.

You can mount only file systems that are shared. For information on sharing file systems, see share(1M).


Note –

The caching of the root (/) and /usr file systems is not supported in a CacheFS file system.


How to Mount a CacheFS File System (mount)

  1. Become superuser on the client system.

  2. Create the mount point, if necessary.


    # mkdir /mount-point
    

    You can create the mount point from anywhere but it must be a UFS file system. The CacheFS options used with the mount command, as shown in the next step, determine that the mount point you create is cached in the cache directory you specify.

  3. Mount a file system in the cache.


    # mount -F cachefs -o backfstype=fstype,cachedir=/cache-directory[,options]
    /back-filesystem /mount-point
    

    fstype

    Indicates the file system type of the back file system (can be either NFS or HSFS).

    /cache-directory

    Indicates the name of the UFS directory where the cache resides. This name is the same name you specified when you created the cache in How to Create the Cache.

    options

    Specifies other mount options that you can include when you mount a file system in a cache. For a list of CacheFS mount options, see mount_cachefs(1M).

    /back-filesystem

    Specifies the mount point of the back file system to cache. If the back file system is an NFS file system, you must specify the host name of the server from which you are mounting the file system and the name of the file system to cache (separated by a colon). For example, merlin: /data/abc.

    /mount-point

    Indicates the directory where the file system is mounted. 

  4. Verify that the cache you created was actually mounted.


    # cachefsstat /mount-point 
    

    The /mount-point is the CacheFS file system that you created.

    For example:


    # cachefsstat /docs
    /docs
    	         cache hit rate:   100% (0 hits, 0 misses)
    	     consistency checks:      1 (1 pass, 0 fail)
    	               modifies:      0
    	     garbage collection:      0

    If the file system was not mounted in the cache, you see an error message similar to the following:


    # cachefsstat /mount-point
    cachefsstat: mount-point: not a cachefs mountpoint

    For more information about the cachefsstat command, see Collecting CacheFS Statistics.

Examples—Mounting a CacheFS File System (mount)

The following example shows how to mount the NFS file system merlin:/docs as a CacheFS file system named /docs in the cache named /local/mycache.


# mkdir /docs
# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache merlin:/docs /docs

The following example shows how to make a Solaris 9 SPARC CD (HSFS file system) available as a CacheFS file system named /cfssrc. Because you cannot write to the CD, the ro argument is specified to make the CacheFS file system read-only. This example assumes that vold is not running.


# mount -F hsfs -o ro /dev/dsk/c0t6d0s0 /sol9
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst,
backpath=/sol9 /dev/dsk/c0t6d0s0 /cfssrc
# ls /cfssrc
Copyright  Solaris_9

The following example shows how to mount a Solaris 9 SPARC CD as a CacheFS file system with vold running.


# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst,
backpath=/cdrom/sol_9_sparc/s0 /vol/dev/dsk/c0t2d0/sol_9_sparc/s0 /cfssrc

The following example shows how to mount a CD as a CacheFS file system with vold running.


# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst,
backpath=/cdrom/epson /vol/dev/dsk/c0t2d0/epson /drvrs

The following example uses the demandconst option to specify consistency checking on demand for the NFS CacheFS file system /docs, whose back file system is merlin:/docs. For more information, see Consistency Checking of a CacheFS File System.


# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache,demandconst merlin:/docs /docs

How to Mount a CacheFS File System (/etc/vfstab)

  1. Become superuser on the client system.

  2. Using an editor, specify the file systems to be mounted in the /etc/vfstab file.

    See the example that follows.

    For more information on the /etc/vfstab file, see Field Descriptions for the /etc/vfstab File.

  3. Mount the CacheFS file system.


    # mount /mount-point
    

    Or, reboot the system.

Example—Mounting a CacheFS File System (/etc/vfstab)

The following example shows the /etc/vfstab entry for the /data/abc directory from remote system starbug that is mounted in the cached directory, /opt/cache.


 
#device           device             mount      FS     fsck  mount   mount
#to mount         to fsck            point      type   pass  at boot options
#
starbug:/data/abc /local/abc         /opt/cache cachefs 7    yes     local-access,bg,
nosuid,demandconst,backfstype=nfs,cachedir=/opt/cache

How to Mount a CacheFS File System (AutoFS)

You can mount a file system in a cache with AutoFS by specifying the -fstype=cachefs mount option in your automount map. Note that the CacheFS mount options (for example, backfstype and cachedir) are also specified in the automount map. For details on automount maps, see automount(1M).

  1. Become superuser on the client system.

  2. Using an editor, add the following line to the auto_direct map:


    /mount-point -fstype=cachefs,cachedir=/directory,backfstype=nfs 
    server:/file-system
    
  3. Using an editor, add the following line to the auto_master map:


    /-

    The /- entry is a pointer to check the auto_direct map.

  4. Reboot the system.

  5. Verify that the entry was made correctly by changing to the file system you mounted in the cache, and then list the contents, as follows:


    # cd /filesystem
    # ls 
    

For more information about AutoFS and how to edit the maps, refer to “Autofs Administration Task Overview” in System Administration Guide: Resource Management and Network Services.

Example—Mounting a CacheFS File System (AutoFS)

The following auto_direct entry automatically mounts the CacheFS file system in the /docs directory.


/docs -fstype=cachefs,cachedir=/local/mycache,backfstype=nfs merlin:/docs

Maintaining a CacheFS File System (Task Map)

After a CacheFS file system is set up, it requires little maintenance. Use the optional procedures in this table if you need to perform maintenance tasks on your CacheFS file systems.

Task 

Description 

For Instructions 

1. Modify a CacheFS file system 

Modify CacheFS file system behavior by unmounting, deleting, or re-creating the cache. 

Modifying a CacheFS File System

2. Display CacheFS file system information 

Display information about CacheFS file systems by using the cfsadmin command.

How to Display Information About a CacheFS File System

3. Perform consistency checking 

Perform consistency checking on demand by using the cfsadmin command.

How to Specify Cache Consistency Checking on Demand

4. Delete a CacheFS file system 

Delete a CacheFS file system by using the umount command and the cfsadmin command.

How to Delete a CacheFS File System

5. Check the integrity of a CacheFS file system 

Check the integrity of a CacheFS file system by using the fsck_cachefs command.

How to Check the Integrity of a CacheFS File System

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 with the demandconst option specified for the /docs file system.


# shutdown -g30 -y
.
.
.
Type Cntrl-d to proceed with normal startup,
(or give root password for system maintenance):
# enter password:
.
.
.
Here is where you might be prompted to run fsck on the
file system where the cache is located.

# fsck /local
# mount /local
# cfsadmin -d all /local/mycache
# cfsadmin -c /local/mycache
# init 6
.
.
.
console login:
password:
# mount -F cachefs -o backfstype=nfs,cachedir=/local/cache1,demandconst
merlin:/docs /docs
#

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. 

Example—Checking the Integrity of CacheFS File Systems

The following example shows how to check the file systems cached in the /local/mycache cache.


# fsck -F cachefs /local/mycache
#

Packing a Cached File System (Task Map)

The following task map describes the procedures that are associated with packing a CacheFS file system. All of these procedures are optional.

Task 

Description 

For Instructions 

Pack files in the cache 

Identify files and directories to be loaded in the cache and pack them. Packing ensures that current copies of these files are available in the cache. 

How to Pack Files in the Cache

Create a packing list 

Create a packing list if you do not want to specify each individual file that you want packed in the cache. 

How to Create a Packing List

Pack files in the cache with a packing list 

Specify the name of the packing list of the files to be packed in the cache. 

How to Pack Files in the Cache With a Packing List

Unpack files or packing lists from the cache 

Remove a file from the cache that is no longer needed. 

How to Unpack Files or Packing Lists From the Cache

Display packed files information 

View information about the files that you've packed, including their packing status. 

How to Display Packed Files Information

Packing a CacheFS File System

For general use, the CacheFS software operates automatically after it is set up, without requiring any action from the user. Files are cached on a most recently used basis. With the packing feature, you can take a more active role in managing your cache by ensuring that certain files or directories are always updated in the cache.

You can specify files and directories to be loaded in the cache with the cachefspack command. This command ensures that current copies of these files are available in the cache.

The packing list contains the names of specific files and directories. The packing list can also contain other packing lists. This feature saves you having to specify individual files and directories when you have many items to pack in your cache.

You can print out a brief help summary of all the cachefspack options by using the -h option as follows:


$ cachefspack -h
Must select 1 and only 1 of the following 5 options
-d Display selected filenames
-i Display selected filenames packing status
-p Pack selected filenames
-u Unpack selected filenames
-U Unpack all files in directory 'dir'
-f Specify input file containing rules
-h Print usage information
-r Interpret strings in LIST rules as regular expressions
-s Strip './' from the beginning of a pattern name
-v Verbose option
files - a list of filenames to be packed/unpacked

How to Pack Files in the Cache

Pack files in the cache by using the cachefspack command.


$ cachefspack -p filename

-p

Specifies that you want the file or files to be packed. This option is also the default. 

filename

Specifies the name of the files or directory you want packed in the cache. When you specify a directory, all of its subdirectories are also packed. For more information, see cachefspack(1M).

Examples—Packing Files in the Cache

The following example shows the projects file being packed in the cache.


$ cachefspack -p projects

The following example shows three files being packed in the cache.


$ cachefspack -p projects updates master_plan 

The following example shows a directory being packed in the cache.


$ cachefspack -p /data/abc/bin

How to Display Packed Files Information

Display packed files information by using the cachefspack -i command.


$ cachefspack -i[v] filename

-i

Specifies that you want to view information about your packed files. 

-v

Is the verbose option. 

cached-filename-or-directory

Specifies the name of the file or directory for which to display information. 

Example—Displaying Packed Files Information

The following example shows the doc_file file is successfully packed.


$ cachefspack -i doc_file
cachefspack: file doc_file marked packed YES, packed YES

In the following example, the /data/abc directory contains the bin subdirectory. The bin subdirectory has three files: big, medium, and small. Although the big and small files are specified to be packed, they are not. The medium file is successfully packed.


$ cd /data/abc
$ cachefspack -i bin
.
.
.
cachefspack: file /bin/big marked packed YES, packed NO
cachefspack: file /bin/medium marked packed YES,
packed YES
cachefspack: file /bin/small marked packed YES,
packed NO
.
.
.

If you use the -iv options together, you get additional information as to whether the file or directory specified has been flushed from the cache. For example:


$ cd /data/bin
$ cachefspack -iv bin
.
.
.
cachefspack: file /bin/big marked packed YES, packed NO,
nocache YES
cachefspack: file /bin/medium marked packed YES,
packed YES, nocache NO
cachefspack: file /bin/small marked packed YES,
packed NO
nocache NO
.
.
.

The last line of the preceding example shows that the directory contents have not been flushed from the cache.

Using Packing Lists

One feature of the cachefspack command is the ability to create packing lists.

A packing list contains files or directories to be packed in the cache. If a directory is in the packing list, all of its subdirectories and files will also be packed.

This feature saves the time of having to specify each individual file that you want packed in the cache.

How to Create a Packing List

To create a packing list, open a file by using vi or the editor of your choice. The packing list file format uses the same format as the filesync command. For more information, see filesync(1).

Two packing list features are the following:

For more information on using these features, see cachefspack(1M).

Example—Creating a Packing List

The following example shows the contents of a packing list file.


BASE /home/ignatz
LIST plans
LIST docs
IGNORE *.ps

How to Pack Files in the Cache With a Packing List

Pack files in the packing list by using the cachefspack -f command, as follows:


$ cachefspack -f packing-list

-f

Specifies that you want to use a packing list. 

packing-list

Specifies the name of the packing list. 

Example—Packing Files in the Cache With a Packing List

This example uses the list.pkg file as the packing list for the cachefspack command.


$ cachefspack -f list.pkg

Unpacking Files or Packing Lists From the Cache

You might need to remove, or unpack, a file from the cache. Perhaps you have some files or directories that have a higher priority than others, so you need to unpack the less critical files. For example, you finished up a project and have archived the files that are associated with that project. You are now working on a new project, and therefore, a new set of files.

How to Unpack Files or Packing Lists From the Cache

Unpack files or packing lists from the cache by using the -u or -U option of the cachefspack command.


$ cachefspack -u filename | -U cache-directory

-u

Specifies that you want the file or files unpacked. You must specify a filename with this option. 

filename

Specifies the name of the file or packing list that you want unpacked in the cache.  

-U

Specifies that you want to unpack all files in the cache. 

For more information about the cachefspack command, see the man page.

Examples—Unpacking Files or Packing Lists From the Cache

The following example shows the file /data/abc/bin/big being unpacked from the cache.


$ cachefspack -u /data/abc/bin/big

The following example shows several files being unpacked from the cache.


$ cd /data/abc/bin/big
$ cachefspack -u big small medium

The following example shows how to unpack a packing list, which is a file that contains the path to a directory of files, as follows:


$ cachefspack -uf list.pkg

The following example uses the -U option to specify that all files in a cache directory being unpacked.


$ cachefspack -U /local/mycache

You cannot unpack a cache that does not have at least one file system mounted. With the -U option, if you specify a cache that does not contain mounted file systems, you see output similar to the following:


$ cachefspack -U /local/mycache
cachefspack: Could not unpack cache /local/mycache, no mounted
filesystems in the cache.

Troubleshooting cachefspack Errors

You might see the following error messages when you use the cachefspack command.


cachefspack: pathname - can't open directory: permission denied
Cause

You might not have the correct permissions to access the file or directory.

Action

Set the correct permissions.


cachefspack: pathname - can't open directory: no such file or
directory
Cause

You might not have the correct file or directory.

Action

Check for a possible typo.


cachefspack: pathname - can't open directory: stale NFS file handle
Cause

The file or directory might have been moved or deleted from the server at the time you attempted to access it.

Action

Verify that the file or directory on the server is still accessible.


cachefspack: pathname - can't open directory: interrupted system
call
Cause

You might have inadvertently pressed Control-C while issuing the command.

Action

Reissue the command.


cachefspack: pathname - can't open directory: I/O error
Cause

You might have a hardware problem.

Action

Check your hardware connections.


cachefspack: error opening dir
Cause

You might not have the correct file or directory. The path identified after the BASE command in the file format could be a file and not a directory. The path specified must be a directory.

Action

Check for a possible typo. Check the path identified after the BASE command in your file format. Make sure it identifies a directory, not a file.


cachefspack: unable to get shared objects
Cause

The executable might be corrupt or it's in a format that is not recognizable.

Action

Replace the executable.


cachefspack: filename - can't pack file: permission denied
Cause

You might not have the correct permissions to access the file or directory.

Action

Set the correct permissions.


cachefspack: filename - can't pack file: no such file or directory
Cause

You might not have the correct file or directory.

Action

Check for a possible typo.


cachefspack: filename- can't pack file: stale NFS file handle
Cause

The file or directory might have been moved or deleted from the server at the time you attempted to access it.

Action

Verify that the file or directory on the server is still accessible.


cachefspack: filename- can't pack file: interrupted system call
Cause

You might have inadvertently pressed Control-C while issuing the command.

Action

Reissue the command.


cachefspack: filename- can't pack file: I/O error
Cause

You might have a hardware problem.

Action

Check your hardware connections.


cachefspack: filename- can't pack file: no space left on device.
Cause

The cache is out of disk space.

Action

You need to increase the size of the cache by increasing disk space.


cachefspack: filename - can't unpack file: permission denied
Cause

You might not have the correct permissions to access the file or directory.

Action

Set the correct permissions.


cachefspack: filename - can't unpack file: no such file or directory
Cause

You might not have the correct file or directory.

Action

Check for a possible typo.


cachefspack: filename- can't unpack file: stale NFS file handle
Cause

The file or directory might have been moved or deleted from the server at the time you attempted to access it.

Action

Verify that the file or directory on the server is still accessible.


cachefspack: filename - can't unpack file: interrupted system call
Cause

You might have pressed Control-C inadvertently while issuing the command.

Action

Reissue the command.


cachefspack: filename- can't unpack file I/O error
Cause

You might have a hardware problem.

Action

Check your hardware connections.


cachefspack: only one `d', `i', `p', or `u' option allowed
Cause

You entered more than one of these options in a command session.

Action

Select one option for the command session.


cachefspack: can't find environment variable.
Cause

You forgot to set a corresponding environment variable to match the $ in your configuration file.

Action

Define the environment variable in the proper location.


cachefspack: skipping LIST command - no active base
Cause

A LIST command is present in your configuration file that has no corresponding BASE command.

Action

Define the BASE command.

Collecting CacheFS Statistics (Task Map)

The following task map shows the steps involved in collecting CacheFS statistics. All the procedures in this table are optional.

Task 

Description 

For Instructions 

Set up logging 

Set up logging on a CacheFS file system using the cachefslog command.

How to Set Up CacheFS Logging

Locate the log file 

Locate the log file with the cachefslog command.

How to Locate the CacheFS Log File

Stop logging  

Stop logging with the cachefslog command.

How to Stop CacheFS Logging

View the cache size 

View the cache size by using the cachefswssize command.

How to View the Working Set (Cache) Size

View the cache statistics 

View the statistics by using the cachefsstat command.

How to View CacheFS Statistics

Collecting CacheFS Statistics

Collecting CacheFS statistics enable you to do the following:

These statistics will help you determine the trade-off between your cache size and the desired performance of the cache.

The CacheFS statistics commands consist of the following:

Command 

Man Page 

Description 

cachefslog

cachefslog(1M)

Specifies the location of the log file. This command also displays where the statistics are currently being logged, and enables you to stop logging.  

cachefswssize

cachefswssize(1M)

Interprets the log file to give a recommended cache size.  

cachefsstat

cachefsstat(1M)

Displays statistical information about a specific file system or all CacheFS file systems. The information provided in the output of this command is taken directly from the cache.  

 

 

 


Note –

You can issue the CacheFS statistics commands from any directory. You must be superuser to issue the cachefswssize command.


The CacheFS statistics begin accumulating when you create the log file. When the work session is over, stop the logging by using the cachefslog -h command, as described in How to Stop CacheFS Logging.

Before using the CacheFS statistics commands, you must do the following:


Note –

The following procedures are presented in a recommended order. The order is not required.


How to Set Up CacheFS Logging

  1. Set up logging.


    $ cachefslog -f log-file-path /mount-point
    

    -f

    Sets up logging. 

    log-file-path

    Specifies the location of the log file. The log file is a standard file you create with an editor, such as vi. 

    /mount-point

    Designates the mount point (CacheFS file system) for which statistics are being collected.  

  2. Verify that you correctly set up the log file.


    $ cachefslog /mount-point
    

Example—Setting Up CacheFS Logging

The following example shows how to set up the /var/tmp/samlog log file to collect statistics about the /home/sam directory.


$ cachefslog -f /var/tmp/samlog /home/sam
  /var/tmp/samlog: /home/sam

How to Locate the CacheFS Log File

You can also use the cachefslog command with no options to locate a log file for a particular mount point.


$ cachefslog /mount-point

/mount-point specifies the CacheFS file system for which you want to view the statistics.

The following example shows what you would see if a log file has been set up. The location of the log file is /var/tmp/stufflog.


$ cachefslog /home/stuff
	 /var/tmp/stufflog: /home/stuff

The following example shows that no log file has been set up for the specified file system.


$ cachefslog /home/zap
	not logged: /home/zap 

How to Stop CacheFS Logging

Use the cachefslog -h option to stop logging.


$ cachefslog -h /mount-point

The following example shows how to stop logging on /home/stuff.


$ cachefslog -h /home/stuff
not logged: /home/stuff

If you get a system response other than the one specified here, you did not successfully stop logging. Check to see if you are using the correct log file name and mount point.

How to View the Working Set (Cache) Size

You might want to check if you need to increase the size of the cache or determine what the ideal cache size is based on your activity since you last used the cachefslog command for a particular mount point.

  1. Become superuser on the client system.

  2. View the current cache size and highest logged cache size.


    # cachefswssize log-file-path
    

    For more information, see cachefswssize(1M).

Example—Viewing the Working Set (Cache) Size

In the following example, the end size is the size of the cache at the time you issued the cachefswssize command. The high water size is the largest size of the cache during the time frame in which logging occurred.


# cachefswssize /var/tmp/samlog
 
    /home/sam
	       end size:  10688k
	high water size:  10704k
 
    /
	       end size:   1736k
	high water size:   1736k
 
    /opt
	       end size:    128k
	high water size:    128k
 
    /nfs/saturn.dist
	       end size:   1472k
	high water size:   1472k
 
    /data/abc
	       end size:   7168k
	high water size:   7168k
 
    /nfs/venus.svr4
	       end size:   4688k
	high water size:   5000k
 
    /data
	       end size:   4992k
	high water size:   4992k
 
    total for cache
	   initial size: 110960k
	       end size:  30872k
	high water size:  30872k

Viewing CacheFS Statistics

You might want to view certain information about a specific CacheFS file system. The following table explains the terminology that is displayed in the statistics output.

Table 40–2 CacheFS Statistics Terminology

Output Term 

Description 

cache hit rate

The rate of cache hits versus cache misses, followed by the actual number of hits and misses. A cache hit occurs when the user wants to perform an operation on a file or files, and the file or files are actually in the cache. A cache miss occurs when the file is not in the cache. The load on the server is the sum of cache misses, consistency checks, and modifications (modifies). 

consistency checks

The number of consistency checks performed, followed by the number that passed, and the number that failed. 

modifies

The number of modify operations; for example, writes or creates. 

How to View CacheFS Statistics

View the statistics with the cachefsstat command. You can view the statistics at any time. For example, you do not have to set up logging in order to view the statistics.


$ cachefsstat /mount-point

/mount-point specifies the CacheFS file system for which you want to view the statistics.

If you do not specify the mount point, statistics for all mounted CacheFS file systems will be displayed.

For more information, see cachefsstat(1M).

Example—Viewing CacheFS Statistics

This example shows how to view statistics on the cached file system, /home/sam.


$ cachefsstat /home/sam
	    cache hit rate: 73% (1234 hits, 450 misses)
	consistency checks: 700 (650 pass, 50 fail)
	          modifies: 321
garbage collection:  0