Raspberry Pi 4, umbrelOS 1.7.4, backing up to a NAS.
The issue
My backups had been failing for ~22 hours with no warning anywhere — dashboard clean, all
apps ready. I only found it by querying the backup repo by hand:
ERROR error connecting to repository: unable to write config file:
error writing file: cannot create temp file: no space left on device
“No space left on device” — with 4.6 GB free. It was inodes:
$ df -h /home → 19G 15G 4.6G 76% ← looks fine
$ df -i /home → 1261568 1261567 1 100% ← ONE free inode
Run df -i on your box now. df -h will never show this.
The cause: kopia’s cache at /kopia/cache had grown to 13 GB across 1,259,040 files —
99.97% of every inode on the SD card. Note this is the SD card (mmcblk0p6), not the SSD,
and nothing on the SD is even being backed up — the cache is a byproduct of backing up
app-data, which lives on the SSD. Snapshots are ~640 MB each, so the cache was over 20×
the size of the data being backed up, on the most fragile medium in the machine.
It also can’t self-heal: kopia sweeps its cache when it opens the repository, and opening the
repository is exactly what fails once inodes are gone.
That partition also backs /, /home, /var/log and /data, so this breaks writes
system-wide, not just backups.
Temporary fix
Check nothing is mid-backup (ps aux | grep [k]opia must be empty), then:
sudo mv /kopia/cache/kopia /kopia/cache/kopia.old
sudo rm -rf /kopia/cache/kopia.old
Rename first, don’t rm -rf in place. A rename within the same directory needs no new
inode — which matters when you have exactly 1 free — and it hands kopia a clean slate
immediately instead of leaving it with no cache directory for the several minutes the delete
takes. Kopia recreates the cache itself; nothing needs restoring.
Took ~6 minutes for 1.26 M files. Result: 15 G → 85 M used, 100% → 1% inodes. Backups
worked again immediately.
Before you delete, grab this — I didn’t, and lost the evidence of which subdirectory was
responsible:
sudo sh -c "du --inodes -xs /kopia/cache/kopia/<repo-id>/*"
You cannot cap the cache yourself. kopia cache set applies, then gets wiped by the next
backup operation — umbreld re-runs kopia repository connect on routine operations, which
rewrites the config with defaults. Verified: hard limits of 2 GB/1 GB reverted to none after
a single listBackups call. And you can’t script a workaround either, since umbrelOS 1.x wipes
the root filesystem on every reboot, taking cron jobs and systemd units with it.
So the only maintenance available is manual: check df -i /home periodically and clear the
cache when it creeps up. Mine took 22 days to go from clean to fatal.
One security note while you’re in there: the kopia repository password is stored in
plaintext in ~/umbrel/umbrel.yaml, and umbreld passes it via --password= on the command
line so it’s echoed back in any backups.* error. Redact before posting error output.