PolicyFS unifies multiple storage paths under a single FUSE mountpoint. Routing rules control exactly where reads and writes go — and an optional SQLite index keeps your HDDs asleep during metadata-heavy workloads.
Features
Route reads and writes by path pattern — one rule for photos/**, another for everything else.
Write policies (first_found, most_free, least_free) control target
selection. Path-preserving mode keeps related files on the same disk.
Mark a storage path indexed: true and readdir/getattr calls are
served from a local SQLite database — no disk spin-up. Metadata mutations (delete, rename, chmod) are
deferred to an event log and applied later by pfs prune.
pfs move tiers files from fast SSD to bulk HDD. pfs prune applies deferred
mutations. pfs index refreshes metadata. pfs maint runs all three in the right
order — ready for a daily systemd timer.
Architecture
Your application opens a file normally — pfs is transparent to userspace.
The kernel forwards the call over FUSE to the running pfs daemon process.
The router matches the path to a rule. Metadata is served from SQLite; HDDs stay asleep.
Data reads and writes hit the physical storage directly via a cached file descriptor.
Comparison
mergerfs is a mature, battle-tested FUSE union filesystem with broad POSIX coverage and a large install base. pfs is a narrower tool focused on making storage placement and metadata access explicit. If you need maximum compatibility or are running complex workloads, mergerfs is likely the better fit.
| Feature | pfs | mergerfs |
|---|---|---|
| FUSE-based storage pooling | ✓ | ✓ |
| Path-pattern routing rules | ✓ | — |
| Multiple write target policies | ✓ | ✓ |
| SQLite metadata index (HDD sleep) | ✓ | — |
| Deferred metadata mutations | ✓ | — |
| Built-in tiered storage mover | ✓ | — |
| POSIX feature coverage | partial | ✓ |
| Maturity & ecosystem | newer | established |
pfs trades POSIX breadth for explicit, inspectable behavior. mergerfs covers more edge cases and has a much longer track record.
Configuration
A minimal two-tier setup: SSD as a fast write cache, HDDs as indexed archive storage.
# /etc/pfs/pfs.yaml mounts: - name: media mountpoint: /mnt/media storage_paths: - id: ssd1 path: /mnt/nvme/cache - id: hdd1 path: /mnt/hdd1/media indexed: true - id: hdd2 path: /mnt/hdd2/media indexed: true routing_rules: - match: "**" targets: [ssd1, hdd1, hdd2] write_policy: most_free
Package and systemd units included. Runs as an unprivileged service.
apt install pfs
Install guide →