System information
File systems that support functionalities required by FS-Cache cache back-end include the Red Hat
Enterprise Linux 6 implementations of the following file systems:
ext3 (with extended attributes enabled)
ext4
BTRFS
XFS
The host file system must support user-defined extended attributes; FS-Cache uses these attributes to
store coherency maintenance information. To enable user-defined extended attributes for ext3 file
systems (i.e. device), use:
# tune2fs -o user_xattr /d ev/device
Alternatively, extended attributes for a file system can be enabled at mount time, as in:
# mo unt /d ev/device /path/to/cache -o user_xattr
The cache back-end works by maintaining a certain amount of free space on the partition hosting the
cache. It grows and shrinks the cache in response to other elements of the system using up free
space, making it safe to use on the root file system (for example, on a laptop). FS-Cache sets defaults
on this behavior, which can be configured via cache cull limits. For more information about
configuring cache cull limits, refer to Section 10.4, “ Setting Cache Cull Limits” .
Once the configuration file is in place, start up the cachefi l esd daemon:
# servi ce cachefi l esd start
To configure cachefi l esd to start at boot time, execute the following command as root:
# chkco nfi g cachefi l esd o n
10.3. Using t he Cache Wit h NFS
NFS will not use the cache unless explicitly instructed. To configure an NFS mount to use FS-Cache,
include the -o fsc option to the mo unt command:
# mo unt nfs-share: / /mount/point -o fsc
All access to files under /mount/point will go through the cache, unless the file is opened for direct
I/O or writing (refer to Section 10.3.2, “ Cache Limitations With NFS” for more information). NFS
indexes cache contents using NFS file handle, not the file name; this means that hard-linked files
share the cache correctly.
Caching is supported in version 2, 3, and 4 of NFS. However, each version uses different branches
for caching.
10.3.1. Cache Sharing
There are several potential issues to do with NFS cache sharing. Because the cache is persistent,
blocks of data in the cache are indexed on a sequence of four keys:
Red Hat Ent erprise Lin ux 6 St orage Admin ist rat io n G uide
76