Zfs troubleshooting

From wikinotes

Device shows UNAVAIL, but is present

This can be accidental, but generally it means that a device needs to be resilvered.
If you have permanent errors, you can't resilver, the device remains UNAVAIL.

# inform zfs device is available
zpool online tank c0t1d0

Permanent errors detected in files

In order to debug permanent errors, you need to understand the types of errors that can be present.
Each error is displayed in the format ${zpool}:${filepath}.
Errors that show memory addresses (ex: <0xf8>:<0x1f00e>) are metadata issues.

metadata errors (<0xf8>:<0x1f00e>)

These are easy (but time consuming) to resolve.

  1. destroy snashots, disable cron jobs that create snapshots
  2. zpool scrub ${zpool}
  3. once it has completed (check progress with zpool status), your pool should be error free
    (if replacing disk, manually detach replaced disk)

filepath errors (zroot:/path/file.txt)

Delete the file. Scrub if required.

zpool errors (<0xf8>:/path/file.txt)

I haven't encountered these yet

other

The official (oracle) recommendation if you cannot solve this, is to build a new zpool and recover from a backup.