Become superuser.
Create a mount point.
The mount point allows user access to the file system specified under that mount point. You can create the mount point from anywhere. The CacheFS options used with the mount command, as shown in the next step, will determine that the mount point you created will be cached in the cache directory you specified.
Mount a file system in a cache with the mount command.
# mount -F cachefs -o backfstype=fstype,cachedir=cache-directory[, options] back-filesystem mount-point |
fstype |
Indicates the file system type of the back file system, for example nfs. |
cache-directory |
Indicates the name of the directory where the cache resides. This is the same name you specified when you created the cache in "How to Create a Cache". |
options |
Specifies other mount options that you can include when mounting a file system in a cache. See mount_cachefs(1M) for a list of CacheFS mount options. |
back-filesystem |
The mount point of the back file system to cache. If the back file system is an NFS file system,you must specify the host name of the server from which you are mounting the file system and the name of the file system to cache (separated by a colon), for example, merlin: /usr/openwin |
mount-point |
Indicates the directory where the file system is mounted. |
Verify that the cache you created was actually mounted by using he cachefsstat(1M) command, as follows:
# cachefsstat mount-point |
For example:
# cachefsstat /docs /docs cache hit rate: 100% (0 hits, 0 misses) consistency checks: 1 (1 pass, 0 fail) modifies: 0 garbage collection: 0 |
The mount point is the cached file system you created. For more information about the cachefsstat command, see "CacheFS Statistics".
If the file system was not mounted in the cache, you will receive an error message similar to the following:
# cachefsstat mount-point cachefsstat: mount-point: not a cachefs mountpoint |
The following example creates the mount point /docs, and mounts the NFS file system merlin:/docs as a cached file system named /docs in the cache named /local/mycache.
# mkdir /docs # mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache merlin:/docs /docs |
The following example makes a CD-ROM (HSFS file system) available as a cached file system named /docs. Because you cannot write to the CD-ROM, the ro argument is specified to make the cached file system read-only. You must specify the backpath argument because Volume Management automatically mounts the CD-ROM when it is inserted. The mount point is in the /cdrom directory and is determined by the name of the CD-ROM. The special device to mount is the same as the value for the backpath argument.
# mount -F cachefs -o backfstype=hsfs,cachedir=/local/mycache,ro, backpath=/cdrom/cdrom_name /cdrom/cdrom_name /docs |
The following example uses the demandconst option to specify consistency checking on demand for the NFS cached file system /docs, whose back file system is merlin:/docs. See "Consistency Checking of Cached File Systems With the Back File System" for more information.
# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache, demandconst merlin:/docs /docs |