how to query if zpool is online (to get around a bug where zfs commands hang)
Posted on 2010-11-23
I want to simply see if a zpool is online in a script, but need to do it in such a way that gets around a known bug. Specifically, if I have a pool that is offline, then any call to zfs status, zpool, or zfs commands lock up and create a process which I can not terminate).
I can issue a zdb -c poolname and this enumerates the configuration of the pool, but it does not provide any information whether or not it is online.
So is there a way to see if a pool is online that doesn't require the zfs or zpool command? (Or uses the zdb command to enumerate something)?
Note that it is possible that a pool won't have any mounted file systems attached to it, but still perhaps there is a creative way I can use dd or something like that to attempt to read from a raw pool device driver?