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.
Become superuser.
Using an editor, add the following line to the auto_direct map:
/mount-point -fstype=cachefs,cachedir=/directory,backfstype=nfs server:/file-system |
Using an editor, add the following line to the auto_master map:
/- |
The /- entry is a pointer to check the auto_direct map.
Reboot the system.
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.
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 |