Finally I’ve made some progress in one of my miniprojects! At least an initial version of the hammer-backup script has been pushed to the master branch upstream in the DragonFly BSD repository, see commitdiff here.
For those who don’t know, DragonFly BSD is a fork of FreeBSD 4.x. Its leader, Matthew Dillon, implemented a log structured filesystem from scratch called HAMMER. It’s divided into independent “sub filesystems” called PFS (pseudo-filesystem).
DragonFly BSD standard installation on a HAMMER filesystem provides a PFS for every typical UNIX system directory (/usr, /var), see below:
1 2 3 4 5 6 7 8 9 10 11 12 13
HAMMER is a copy-on-write filesystem that records history of every change on it. It’s also transactional and every transaction has a transaction ID associated (TID). Here’s where things get really interesting, HAMMER provides a tool to operate the filesystem itself called ‘hammer’.
It can dump the contents of every PFS to stdout and that’s what the hammer-script uses.
You can see how the script itself works here