System Administration Guide, Volume 1

How to Mount a File System in a Cache With 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 CacheFS mount options (for example, backfstype and cachedir) are also specified in the automount map. See automount(1M) for details on automount maps. Also see System Administration Guide, Volume 3.

  1. Become superuser.

  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 filesystem
    

For more information about AutoFS and how to edit the maps, refer to the AutoFS chapter of the System Administration Guide, Volume 3.

Example--Mounting a File System in a Cache With AutoFS

The following auto_master entry automatically mounts the cache file system in the /docs directory.


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