Here's a script that uses LVM snapshots to online-check your filesystems.
It helps you to quickly become aware of filesystem bugs and monitor for them using Nagios/Check_MK or whatever you prefer.
What you need is not much:
- You need to use LVM (otherwise no snapshot, d'oh)
- You need a little free space in the VG. I just reserve 100M, and basically, that'll be enough in almost all cases
- ext3/ext4 filesystem
Thin pools alleviate the space requirement, but I don't use them in prod yet.
XFS until recently still had online fsck (they broke it), but I didn't see it break as much as ext. Hand me output of a broken one and I'll add it to the script.
The script is run like this:
And such a check only takes a few seconds (it does go via the filesystem journal, this is not meant to track deeply buried filesystem rot)
no warranties, bsd license.
I didn't know where to put it, so right now the script resides here on the wiki.