ZFS snapshots reset/restart zfs scrub on FreeBSD 7.0

April 12th, 2009

I ran in to an interesting problem that took me a little bit of digging/thinking to figure out this morning. When you do a zpool scrub on FreeBSD and then do zfs snapshot the scrub restarts from the beginning, (at least as of this writing.) I couldn’t find any references to this and FreeBSD, but did find mentions of zfs scrub resetting with OSX. The same thread claimed the issue was addressed in OpenSolairs versions past that which had been ported/integrated in to OSX, probably the same for FreeBSD. I started a scrub last night before I went to bed and woke up this morning and it had less % done than it did the last time I looked, that’s not good. I checked in on it every few minutes for a while and noticed that it was completing pretty fast, but then kicked back up after a while. It didn’t immediately occur to me that it was at the top of the hour when my snapshot script had just run, but I got there a few minutes later.

At any rate, once I knew what was going on it made perfect sense and was pretty easily addressed. As part of addressing it I’ve generalized my snapshot setup and converted it to be run by periodic. A post with that is coming as soon as I live with it for a bit and make sure the kinks are worked out. It has actually turned out really cool, hourly, daily, weekly, monthly snapshots, monthly scrubs (during which snapshots are suspected and it’s all configurable…