ZFS - hot spares : automatic or not?

Freddie Cash fjwcash at gmail.com
Thu Jan 13 19:02:29 UTC 2011


On Thu, Jan 13, 2011 at 7:07 AM, Boris Kochergin <spawk at acm.poly.edu> wrote:
> Did a little research. In at least the ZFS case, it appears that events are
> available through devctl(4) and are therefore accessible through devd:
>
> http://2007.asiabsdcon.org/papers/P16-paper.pdf - section 3.7

PC-BSD has the following additions to their /etc/devd.conf file:
# Sample ZFS problem reports handling.
notify 10 {
        match "system"          "ZFS";
        match "type"            "zpool";
        action "logger -p kern.err 'ZFS: failed to load zpool $pool'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "vdev";
        action "logger -p kern.err 'ZFS: vdev failure, zpool=$pool type=$type'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "data";
        action "logger -p kern.warn 'ZFS: zpool I/O failure,
zpool=$pool error=$zio_err'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "io";
        action "logger -p kern.warn 'ZFS: vdev I/O failure,
zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size
error=$zio_err'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "checksum";
        action "logger -p kern.warn 'ZFS: checksum mismatch,
zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'";
};

So it's very (relatively) easy to configure devd to do this.

We just need some scripts to plug into the action lines above.  :)


-- 
Freddie Cash
fjwcash at gmail.com


More information about the freebsd-stable mailing list