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 3 > Chapter 4 Configuring and Administering a Cache Filesystem

Configuring CacheFS

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

You can use CacheFS to cache the NFS-mounted or automounted NFS filesystems. To mount a filesystem using CacheFS, you must create a cache directory in the local filesystem.

This section describes the tasks that you must complete to configure CacheFS:

Configuring Cache in a Local Filesystem

This section describes how to configure a local filesystem as cache. To configure a local filesystem as a cache, follow these steps:

  1. Log in as superuser.

  2. If necessary, configure and mount a new HFS or VxFS filesystem to be used as the front filesystem where data will be cached.

    For more information about filesystems, see HP-UX System Administrator’s Guide (5991-7436).

    NOTE: No special disk partitioning is necessary for creating a front filesystem. If the mounted filesystem has sufficient disk space for caching the NFS filesystems, you can create a cache directory in the existing filesystem to be used as the front filesystem.
  3. Create a cache directory by entering the following command:

    cfsadmin -c cache_directory

    For example, if you mounted an HFS or a VxFS filesystem called /disk2, you can create a CacheFS directory called /disk2/cache using the following command:

    cfsadmin -c /disk2/cache

CacheFS manages its resources optimally if the entire front filesystem is dedicated to caching, or in cases where the non-cache portions of the front filesystem are static read-only files.

CacheFS allows more than one filesystem to be cached in the same cache. You need not create a separate cache directory for each CacheFS mount. Normally, you need to run cfsadmin -c only once to create a single cache for all the CacheFS mounts.

Mounting an NFS Filesystem using CacheFS

This section describes how to mount an NFS filesystem using CacheFS.

Before you mount an NFS filesystem with CacheFS, you must configure a directory in a local filesystem as cache. For information on how to configure a directory as cache, see “Configuring Cache in a Local Filesystem”.

Following is the syntax for mounting an NFS filesystem with CacheFS:

mount [-F cachefs] [-rqOV] -o backfstype=file_system_type [specific_options] resource mount_point

To mount an NFS filesystem using CacheFS, follow these steps:

  1. Enter the following command to mount an NFS filesystem using CacheFS:

    mount -F cachefs -o backfstype=nfs,cachedir=/disk2/cache \
    nfsserver:/opt/frame /opt/cframe

    In this example, the /opt/frame directory is NFS-mounted from the NFS server nfsserver to the local /opt/cframe directory. The /opt/frame directory can now be accessed like any mounted filesystem. When data in /opt/frame is referenced, it is copied into /disk2/cache.

    NOTE: For HP-UX 11i v3, NFSv3 is the default NFS version. If NFSv4 is specified as the default NFS version, the CacheFS mount fails.
  2. If you require the CacheFS filesystem to be mounted at system boot, add the following line to the /etc/fstab file , as shown in the following example:

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

The data is read across the network from the NFS server when accessed for the first time. All future accesses to the data are served from the local cache, if the data is not modified.

For more information on the various mount options of the CacheFS filesystem, see mount_cachefs(1M).

Automounting a Filesystem Using CacheFS

This section describes how to automount a filesystem using CacheFS.

Before you automount an NFS filesystem with CacheFS, you must configure a directory in a local filesystem as cache. For more information on how to configure a directory as cache, see “Configuring Cache in a Local Filesystem”.

To automount a filesystem using CacheFS, follow these steps:

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

    Example 1

    # direct map example:
    /usr/dist -ro,nosuid,fstype=cachefs,backfstype=nfs, \
    cachedir=/disk2/cache distserver:/export/dist


    Example 2

    # 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, enter 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, or with LDAP, only if all clients who use the map have their caching directory set up in the same location (/disk2/cache in the examples).

For more information on CacheFS, see the mount (1M), and mount_cachefs (1M).

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