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
NFS Services Administrator's Guide: HP-UX 11i version 2 > Chapter 3 Configuring the Cache File System (CacheFS)

Configuring CacheFS

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

IMPORTANT: CacheFS is not available on HP-UX 11.0.

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

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

Configuring CacheFS involves several procedures. This section provides instructions for completing tasks needed to configure CacheFS:

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

Configure a Local File System as Cache

  1. If necessary, configure and mount the HFS file system, the front 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. Become root user.

  3. Create a CacheFS directory with the data structures necessary to allow a CacheFS mount, by typing the following command:

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

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 “Configure a Local File System as Cache”.

  1. Mount an NFS file system using CacheFS by typing the mount(1M) command, 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.

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 “Configure a Local File System as Cache”.

  1. Add a line for the automounted file system to the appropriate AutoFS 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 AutoFS master map, (Step 1 instructs users to edit direct map. When did or would users edit 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 AutoFS 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.

  • cachefsstat shows information, gathered from the cache, about a specific file system or all cached file systems.

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