# info > CACHEFILESD.CONF

---
type: CommandReference
command: cachefilesd.conf
mode: man
section: 5
source: man-pages
---

## Quick Reference
- `dir /var/cache/fscache` — Set cache storage directory (mandatory)
- `secctx cachefiles_kernel_t` — Set SELinux security context for kernel access
- `tag mycache` — Name the cache to distinguish multiple caches
- `brun 10%` — Resume culling when free blocks reach 10%
- `bcull 7%` — Start culling when free blocks fall below 7%
- `bstop 3%` — Stop new allocations when free blocks fall below 3%
- `debug 7` — Enable kernel tracing (entry+exit+debug points)

## Name
`/etc/cachefilesd.conf` — Local file caching configuration file

## Synopsis
The configuration file for `cachefilesd` to manage a persistent cache for network filesystems using an already mounted filesystem as the data store. Each directive is on its own line; comments start with `#`.

dir <path>
[secctx <label>]
[tag <name>]
[brun <N>%] [bcull <N>%] [bstop <N>%]
[frun <N>%] [fcull <N>%] [fstop <N>%]
[culltable <log2size>]
[nocull]
[resume_thresholds <blocks> <files>]
[debug <mask>]
## Options
- `dir <path>` — Root directory of the cache. Mandatory; only one per file.
- `secctx <label>` — SELinux security context for kernel cache operations. Defaults to cachefilesd’s security context; cache files inherit the directory’s label.
- `tag <name>` — FS-Cache tag to distinguish multiple caches. Default: `CacheFiles`.
- **Block culling limits** (`brun`, `bcull`, `bstop`): Control free **disk space** thresholds. Defaults: `brun 7%`, `bcull 5%`, `bstop 1%`. Constraint: `0 <= bstop < bcull < brun < 100`.
- **File culling limits** (`frun`, `fcull`, `fstop`): Control free **file count** thresholds. Same defaults and constraint as block limits.
- `culltable <log2size>` — Size of the cull table as log₂(entries). Range 12–20 (default 12 → 4096 entries). Larger tables speed up culling with many objects but consume more memory.
- `nocull` — Disable all culling activity. The cache will grow to limits and only shrink by removing outdated files.
- `resume_thresholds <blocks> <files>` — When scanning of the cull table is suspended (all objects pinned), resume once the kernel releases this many blocks or files. Use `-` to ignore a threshold.
- `debug <mask>` — Numeric bitmask for kernel module debugging (default 0). Mask values (OR):
    - `1` — Trace function entry (`_enter()`)
    - `2` — Trace function exit (`_leave()`)
    - `4` — Trace internal debug points (`_debug()`)
   Also settable via `/sys/module/cachefiles/parameters/debug`.

## Examples
A basic configuration with SELinux context and custom culling thresholds:

dir /var/cache/fscache
secctx cachefiles_kernel_t
tag mycache
brun 10%
bcull 7%
bstop 3%
This stores cache objects under `/var/cache/fscache`, names the cache `mycache`, and uses thresholds: start culling when free space drops below 7%, stop writing at 3%, resume when free space returns to 10%.

## See Also
- [cachefilesd(8)](https://www.chedong.com/phpMan.php/man/cachefilesd/8/markdown)
- [df(1)](https://www.chedong.com/phpMan.php/man/df/1/markdown)
- `/usr/share/doc/cachefilesd/README`