Fsck, power surges, journaling, FreeBSD
By nearly all accounts my decision last year to adopt FreeBSD over Linux (and Windows… haha) on my non-Apple computers has been a damned good one. Installing, maintaining and updating FreeBSD boxes is so simple compared to Linux, the documentation is second to none, the FreeBSD Ports System is simple and easy to optimise, and I've really come to appreciate the clean drive layout.
There's just one problem! Living in Malaysia power spikes tend to happen more often than in Singapore and Australia, and while it's great that my surge protectors do a fine job of preventing any real damage (touch wood) I find myself turning computers back on that have been automatically switched off every couple of weeks. Let's just say I've become fairly well aquainted with fsck.
And therein lies the problem: FreeBSD's UFS doesn't have native journaling, so hard disk failures are far more of a pain in the arse to recover from. In comparison, Linux, Solaris and Mac OS X all have journaling meaning that if they ever fail it's a breeze to get them back up again after restarting.
Fortunately a cursory search on Google and Yahoo revealed a project called GJournal created by Pawel Jakub Dawidek during the Summer of Code 2005, which seems to be implementing journaling over exiting disk labels.
From the Journaling UFS with gjournal entries on the FreeBSD mailing list:
GJournal was designed to journal GEOM providers, so it actually works
below file system layer, but it has hooks which allow to work with
file systems. In other words, gjournal is not file system-depended,
it can work probably with any file system with minimum knowledge
about it. I implemented only UFS support.
And from the (outdated) article on the FreeBSD wiki:
Gjournal is a layer in the GEOM hierarchy that consumes two lower-layer devices and produces one device. The two lower-layer devices are called data disk and journal disk. The data disk is self-sufficient and (eventually) contains verbatim data that’s handled to the layer, so after the journal is disconnected it in itself can be used as a normal storage device. The journal disk contains linear records for every write request handled to the layer
From what I can tell it has been released to the -CURRENT branch which doesn't help me sitting on -STABLE (and -RELEASE on my firewall box), but it appears it will be released in FreeBSD 7. Good to see this is happening; perhaps I'll install it seperately myself and give it a shot.
Has anyone had any success with this? It would seriously save me a lot of trouble.