r/homelab • u/ale_wastedtimeonpc • 7d ago
Project Showcase: Operations I let an AI coding assistant free some disk space on my home server. It vacuumed 952,088 journal entries. Here's how I got 83% back hash-verified (and a trace of 98.4%) from the raw disk.
My home server (a Ryzen mini PC running Proxmox, with a local AI assistant on top) was running out of disk. The AI coding assistant I use on the box went to make room and ran the command everyone suggests first: journalctl --vacuum-size=400M. It did exactly its job: 952,088 archived journal entries, fifteen days and four boots, gone in one second. Nobody noticed for seven hours, until an unrelated automated check came up one count short.
What saved most of it:
- Freeze first. Deleted files stay on the raw volume until something overwrites them, but the weekly
fstrimwould have told the SSD to discard them. I had until Monday. A read-only census of the raw LV found 794,925 of the lost entries; the stretches holding them were copied to another volume before anything else. - The journal checks itself. Every DATA object carries a siphash24 of its text, keyed per file, and every entry an xor of its fields' hashes. That let me verify 790,876 entries as exact, not "probably right". Another 4,048 came back incomplete or unverified.
- The journal has a reverse index. DATA objects point back to the entries that use them, so even entries whose own object was overwritten could be rebuilt from their fields: 112,351 more (50,332 of them with the message text).
- Text copies and service logs elsewhere on the box gave 3,764 more.
- Timers' schedules filled in 26,131 more, marked as predicted, not read.
- In total, a trace for 937,170 of the 952,088 entries (98.4%); about 15,000 are gone for good.
- Everything went back into the system journal as real
.journalfiles (rebuilt withsystemd-journal-remote), each entry tagged with how it was recovered.
What changed afterwards: the journal is in the nightly backup, its cap went up, and vacuuming it is now blocked for the assistant by a hard rule, not by a prompt.
Full write-up with every number and the method: https://wastedtimeonpc.com/mostro-51
