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 How to Check the Integrity of a CacheFS File System  Previous   Contents   Next 
   
 

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:

  • You can identify files in the packing list as regular expressions rather than literal file names so that you don't have to specify each individual file name.

  • You can pack files from a shared directory by ensuring that you pack only those files that you own.

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

 
 
 
  Previous   Contents   Next