Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Installing and Administering NFS Services with 10.20 ACE and HWE: HP 9000 Networking > Chapter 3 Configuring the Cache File System (CacheFS)

Configuring CacheFS

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Before you mount a file system, you must decide whether to use CacheFS. CacheFS improves read performance for data that will be read more than once. It does not improve write performance at all.

The first time data is read from an NFS-mounted file system, there is actually some overhead while CacheFS writes the data to its local cache. After the data is written to the cache, read performance for the file system is significantly improved.

Good choices for cached file systems include man pages and executable programs, which are read multiple times and rarely modified. A bad choice is /var/mail, which is modified frequently but is typically read only once and then thrown away.

You cannot use SAM to mount a file system with CacheFS.

You can use CacheFS to cache NFS-mounted or automounted NFS file systems. Before you can mount a file system using CacheFS, you must configure a local file system as the cache directory.

This section gives instructions for completing the following tasks:

For more information on CacheFS, see the following man pages: cfsadmin(1M), fsck_cachefs(1M), mount(1M), mount_cachefs(1M), and cachefsstat(1M).

To Configure a Local File System as Cache

  1. If necessary, configure and mount an HFS or JFS file system on the client system where data will be cached. See the HP-UX System Administration Tasks manual for more information.

    No special disk partitioning is necessary for creating a CacheFS front file system. If you already have a mounted file system with sufficient disk space for caching your NFS file systems, you can create a subdirectory in the existing file system to use for your CacheFS front file system.

  2. Issue the following command to create a CacheFS directory with the data structures necessary to allow a CacheFS mount:

    /usr/sbin/cfsadmin -c /cache_directory

    For example, if you had a mounted file system called /disk2, you could create a CacheFS directory called /disk2/cache with the following command:

    /usr/sbin/cfsadmin -c /disk2/cache

CacheFS manages its resources most effectively in cases where the entire front file system is dedicated to caching, or in cases where the non-cache portions of the front file system are static, read-only files.

CacheFS allows more than one file system to be cached in the same cache. There is no need to create a separate cache directory for each CacheFS mount. In typical usage, you need to run cfsadmin -c only once to create a single cache for all of your CacheFS mounts.

For more information, type man 1M cfsadmin at the HP-UX prompt.

To Mount an NFS File System Using CacheFS

Before you can mount an NFS file system with CacheFS, you must configure a directory in a local file system as cache. See “To Configure a Local File System as Cache”.

  1. Issue the mount(1M) command to mount an NFS file system using CacheFS, as in the following examples:

    mount -F cachefs -o backfstype=nfs,cachedir=/disk2/cache \
    nfsserver:/opt/frame /opt/frame
  2. Add a line to the /etc/fstab file, as in the following example, to cause your NFS file system to be mounted at system boot:

    nfsserver:/opt/frame /opt/frame cachefs \
    backfstype=nfs,cachedir=/disk2/cache 0 0

This example NFS-mounts the directory /opt/frame from server nfsserver to the local /opt/frame directory. Now, /opt/frame can be accessed just like any mounted file system. As data in /opt/frame is referenced, it will be copied into /disk2/cache. Further references to the data will access the data on the local disk instead of the data on the remote server.

For more information, type man 1M mount at the HP-UX prompt.

To Automount a File System Using CacheFS

Before you can automount an NFS file system with CacheFS, you must configure a directory in a local file system as cache. See “To Configure a Local File System as Cache”.

  1. Add a line for the automounted file system to the appropriate automounter direct or indirect map, as in the following examples:

    # direct map example:
    /usr/dist -ro,nosuid,fstype=cachefs,backfstype=nfs, \
    cachedir=/disk2/cache distserver:/export/dist
    # indirect map example:
    proj1 -nosuid,fstype=cachefs,backfstype=nfs,\
    cachedir=/disk2/cache \
    /src testbox1:/export/proj1/src
    /data testbox2:/export/proj1/data
  2. If you modified a direct map or the automounter master map, issue the following command, on each NFS client that will use the map, to force AutoFS to reread its maps:

    /usr/sbin/automount

You can specify caching in an NIS automounter map only if all clients who will use the map have their caching directory set up in the same location (/disk2/cache, in the examples).

For more information, type man 1M automount at the HP-UX prompt.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1998 Hewlett-Packard Development Company, L.P.