Skip Navigation Links | |
Exit Print View | |
System Administration Guide: Devices and File Systems Oracle Solaris 10 8/11 Information Library |
1. Managing Removable Media (Overview)
2. Managing Removable Media (Tasks)
3. Accessing Removable Media (Tasks)
4. Writing CDs and DVDs (Tasks)
5. Managing Devices (Overview/Tasks)
6. Dynamically Configuring Devices (Tasks)
7. Using USB Devices (Overview)
9. Using InfiniBand Devices (Overview/Tasks)
11. Administering Disks (Tasks)
12. SPARC: Setting Up Disks (Tasks)
13. x86: Setting Up Disks (Tasks)
14. Configuring Oracle Solaris iSCSI Targets and Initiators (Tasks)
15. The format Utility (Reference)
16. Managing File Systems (Overview)
17. Creating and Mounting File Systems (Tasks)
18. Using The CacheFS File System (Tasks)
High-Level View of Using the CacheFS File System (Task Map)
Overview of the CacheFS File System
How a CacheFS File System Works
CacheFS File System Structure and Behavior
Creating and Mounting a CacheFS File System (Task Map)
Mounting a File System in the Cache
How to Mount a CacheFS File System (mount)
Maintaining a CacheFS File System (Task Map)
Maintaining a CacheFS File System
Modifying a CacheFS File System
How to Display Information About a CacheFS File System
Consistency Checking of a CacheFS File System
Consistency Checking on Demand
How to Specify Cache Consistency Checking on Demand
How to Delete a CacheFS File System
How to Check the Integrity of a CacheFS File System
Packing a Cached File System (Task Map)
How to Pack Files in the Cache
How to Display Packed Files Information
How to Pack Files in the Cache With a Packing List
Unpacking Files or Packing Lists From the Cache
How to Unpack Files or Packing Lists From the Cache
Troubleshooting cachefspack Errors
Collecting CacheFS Statistics (Task Map)
How to Locate the CacheFS Log File
How to View the Working Set (Cache) Size
How to View CacheFS Statistics
19. Configuring Additional Swap Space (Tasks)
20. Checking UFS File System Consistency (Tasks)
21. UFS File System (Reference)
22. Backing Up and Restoring UFS File Systems (Overview)
23. Backing Up UFS Files and File Systems (Tasks)
24. Using UFS Snapshots (Tasks)
25. Restoring UFS Files and File Systems (Tasks)
26. UFS Backup and Restore Commands (Reference)
27. Copying Files and File Systems (Tasks)
Use the procedures in this task map to create and mount a CacheFS file system.
|
# cfsadmin -c /cache-directory
where cache-directory indicates the name of the directory where the cache resides.
For more information, see cfsadmin(1M).
Note - After you have created the cache, do not perform any operations within the cache directory itself. Doing so could cause conflicts within the CacheFS software.
Example 18-1 Creating the Cache
The following example shows how to create a cache in the /local/mycache directory by using the default cache parameter values.
# mkdir /local # cfsadmin -c /local/mycache
You specify a file system to be mounted in the cache so that users can locally access files in that file system. The files do not actually get placed in the cache until the user accesses the files.
The following table describes three ways to mount a CacheFS file system.
|
Choose the method of mounting file systems that best suits your environment.
You can mount only file systems that are shared. For information on sharing file systems, see share(1M).
Note - The caching of the root (/) and /usr file systems is not supported in a CacheFS file system.
# mkdir /mount-point
You can create the mount point from anywhere, but it must be a UFS file system. The CacheFS options used with the mount command, as shown in the next step, determine that the mount point you create is cached in the cache directory you specify.
# mount -F cachefs -o backfstype=fstype,cachedir=/cache-directory[,options] /back-filesystem /mount-point
Indicates the file system type of the back file system, which can be either NFS or HSFS.
Indicates the name of the UFS directory where the cache resides. This name is the same name you specified when you created the cache in How to Create the Cache.
Specifies other mount options that you can include when you mount a file system in a cache. For a list of CacheFS mount options, see mount_cachefs(1M).
Specifies 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:/data/abc.
Indicates the directory where the file system is mounted.
# cachefsstat /mount-point
The /mount-point is the CacheFS file system that you created.
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
If the file system was not mounted in the cache, an error message similar to the following is displayed:
# cachefsstat /mount-point cachefsstat: mount-point: not a cachefs mountpoint
For more information about the cachefsstat command, see Collecting CacheFS Statistics.
Example 18-2 Mounting a CacheFS File System (mount)
The following example shows how to mount the NFS file system merlin:/docs as a CacheFS 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 shows how to make a Solaris 10 DVD available as a CacheFS file system named /cfssrc. Because you cannot write to the DVD, the ro argument is specified to make the CacheFS file system read-only. This example assumes that the removable media services are not running.
# mount -F hsfs -o ro /dev/dsk/c0t6d0s0 /sol10 # mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst, backpath=/sol10 /dev/dsk/c0t6d0s0 /cfssrc # ls /cfssrc Copyright Solaris_10
The following example shows how to mount a Solaris 10 DVD as a CacheFS file system with vold running.
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst, backpath=/cdrom/sol_10_sparc/s0 /vol/dev/dsk/c0t2d0/sol_10_sparc/s0 /cfssrc
The following example shows how to mount a DVD as a CacheFS file system with vold running.
# mount -F cachefs -o backfstype=hsfs,cachedir=/cfs/cache,ro,noconst, backpath=/cdrom/epson /vol/dev/dsk/c0t2d0/epson /drvrs
The following example uses the demandconst option to specify consistency checking on demand for the NFS CacheFS file system /docs, whose back file system is merlin:/docs. For more information, see Consistency Checking of a CacheFS File System.
# mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache,demandconst merlin:/docs /docs
See the example that follows.
For more information on the /etc/vfstab file, see Field Descriptions for the /etc/vfstab File.
# mount /mount-point
Or, reboot the system.
Example 18-3 Mounting a CacheFS File System (/etc/vfstab)
The following example shows the /etc/vfstab entry for the /data/abc directory from the remote system starbug that is mounted in the cached directory, /opt/cache.
#device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # starbug:/data/abc /local/abc /opt/cache cachefs 7 yes local-access,bg, nosuid,demandconst,backfstype=nfs,cachedir=/opt/cache
You can mount a file system in a cache with autofs by specifying the -fstype=cachefs mount option in your automount map. Note that the CacheFS mount options, for example, backfstype and cachedir, are also specified in the automount map.
For details on automount maps, see Task Overview for Autofs Administration in System Administration Guide: Network Services or automount(1M).
/mount-point -fstype=cachefs,cachedir=/directory,backfstype=nfs server:/file-system
/-
The /- entry is a pointer to check the auto_direct map.
# cd /filesystem # ls
Example 18-4 Mounting a CacheFS File System (autofs)
The following auto_direct entry automatically mounts the CacheFS file system in the /docs directory.
/docs -fstype=cachefs,cachedir=/local/mycache,backfstype=nfs merlin:/docs