diff options
author | Richard Yao <[email protected]> | 2014-05-17 09:35:10 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-05-19 10:16:29 -0700 |
commit | 1cbae971c5ef215d1036b65511a839879e446c4c (patch) | |
tree | f2be27e185a597c2621d723a100a631228a450cc /cmd/zpool | |
parent | bc25c9325b0e5ced897b9820dad239539d561ec9 (diff) |
Handle ZPOOL_STATUS_HOSTID_MISMATCH in zpool status
Verbatim imports can cause hostid mismatches, but things otherwise work. `zpool
status` does not handle this and will fail when assertions are enabled:
```
zpool: ../../cmd/zpool/zpool_main.c:4418: status_callback: Assertion `reason == ZPOOL_STATUS_OK' failed.
Program received signal SIGABRT, Aborted.
```
Lets instead add a case to display an informative message such as this:
```
pool: rpool
state: ONLINE
status: Mismatch between pool hostid and system hostid on imported pool.
This pool was previously imported into a system with a different hostid,
and then was verbatim imported into this system.
action: Export this pool on all systems on which it is imported.
Then import it to correct the mismatch.
see: http://zfsonlinux.org/msg/ZFS-8000-EY
scan: scrub repaired 0 in 0h8m with 0 errors on Thu Apr 17 19:43:57 2014
config:
NAME STATE READ WRITE CKSUM
rpool ONLINE 0 0 0
sda ONLINE 0 0 0
errors: No known data errors
```
Signed-off-by: Richard Yao <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2342
Diffstat (limited to 'cmd/zpool')
-rw-r--r-- | cmd/zpool/zpool_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index e38213c85..aa166a9c0 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -4389,6 +4389,17 @@ status_callback(zpool_handle_t *zhp, void *data) "'zpool clear'.\n")); break; + case ZPOOL_STATUS_HOSTID_MISMATCH: + (void) printf(gettext("status: Mismatch between pool hostid " + "and system hostid on imported pool.\n\tThis pool was " + "previously imported into a system with a different " + "hostid,\n\tand then was verbatim imported into this " + "system.\n")); + (void) printf(gettext("action: Export this pool on all systems " + "on which it is imported.\n" + "\tThen import it to correct the mismatch.\n")); + break; + case ZPOOL_STATUS_ERRATA: (void) printf(gettext("status: Errata #%d detected.\n"), errata); |