Under the hood
PolicyFS is a FUSE daemon that sits between your apps and physical storage. It routes each filesystem call
based on explicit rules. For archive disks marked indexed: true, a local SQLite database serves
readdir and getattr calls so the HDD can stay spun down. Three maintenance jobs —
pfs move, pfs prune, and pfs index — run on a schedule and handle
housekeeping.
Architecture
Your application issues a normal POSIX syscall — pfs is transparent to userspace.
The kernel forwards the call over FUSE to the pfs daemon.
The router matches the path to a rule. For indexed storage, metadata may be served from the index.
File content I/O hits physical storage through pfs, typically via a cached file descriptor.
Indexed storage
pfs index reduces HDD wakeups
With indexed: true, pfs index scans physical storage and upserts metadata into
index.db. readdir and getattr for indexed storage can be served from
the database, reducing HDD wakeups. File content I/O still hits the underlying storage. Non-indexed storage
paths (indexed: false) are accessed via the filesystem directly (no metadata index).
Deferred operations
pfs prune replays deferred operations
On indexed storage, delete/rename/setattr operations are recorded to events.ndjson and reflected
in the index without immediately touching the physical disk. pfs prune replays the log and
applies pending operations to physical storage, freeing space and making changes persistent.
Tiered storage
pfs move migrates files
As new files land on SSD storage, the fast tier fills up.
pfs move copies eligible files — based on minimum age, size, and disk usage threshold — from the
fast tier to destination storage (typically an indexed HDD archive). If the daemon control socket is
available, open files are skipped.
Limitations
O_DIRECT is not supportedThe deep dive explains routing semantics, indexed storage invariants, and the maintenance cycle in detail.