The Butterscotch Waterfall
Seeing “ZFS: i/o error - all block copies unavailable” at boot on your FreeBSD box?

I recently rebooted a FreeBSD box that uses a ZFS root filesystem configuration and was greeted by the error message “ZFS: i/o error - all block copies unavailable”. I was unable to boot the system or reach the loader prompt. After digging through the various forum and mailing list posts in an attempt to find a solution, I was starting to get the feeling my hard disk itself might have been the culprit. This was slightly worrying since the system in question is a non-redundant, single disk configuration.

Turns out my filesystem was almost full, at 95% capacity. So, if you’ve come across this boot error, despite making absolutely no changes to your ZFS or FreeBSD system, and you’re stuck with an installation you can’t boot, hopefully you’ve ended up here.

Here’s what to do:

  • Boot a live rescue system from either the regular installation discs or the memstick image. The 9.x series is your best bet since it has complete ZFS support without needing to faff about loading the necessary kernel modules at boot. You’ll still be able to import/mount an 8.x system’s pool.
  • Import and mount your ZFS pool with: zpool import -o mountpoint=/mnt -f poolname
  • Your filesystem(s) will now be available at /mnt
  • Free up some space by deleting things. I had around 6GB free when I hit the ZFS error and was able to successfully boot my system again once my disk had around 10-12GB free.
  • Reboot

In a situation like this, the first thing most people do is think back to anything that might have changed in their system. In my case, no changes had been made. However, I did copy several large video files on to my NFS-shared home filesystem before rebooting. Certainly not something I usually would have thought about.

So, if you’ve been hit by “ZFS: i/o error - all block copies unavailable” and you’re sure you haven’t done anything to cause it, have a think about what your filesystem usage might be. Hopefully this simple fix will do the job.