beadm should be more descriptive about some errors
beadm provides extended error diagnostics with a preset environment value "BE_PRINT_ERR=true", but that does not seem to be a very known feature. Some typical failures can remain inexplicable for an average user, examples follow:
1. Why won't it mount my BE like it did a lot of times before?
root@openindiana:~# beadm mount oi_151a /a Unable to mount oi_151a. (null)
Ah, some later-added datasets (children of new root) got automounted into say "/a/opt":
root@openindiana:~# BE_PRINT_ERR=true beadm mount oi_151a /a be_mount_root: failed to mount dataset rpool/ROOT/oi_151a at /a: directory is not empty be_mount: failed to mount BE root file system Unable to mount oi_151a. (null)
The ZFS mounter error could be promoted to visibility in this case.
2. What could this be?
root@openindiana:~# beadm mount rpool/ROOT/openindiana2 /a Unable to mount rpool/ROOT/openindiana2. (null)
Ah, wrong usage - the be_mount error message could be promoted to visibility here:
root@openindiana:~# BE_PRINT_ERR=true beadm mount rpool/ROOT/openindiana2 /a be_mount: invalid BE name rpool/ROOT/openindiana2 Unable to mount rpool/ROOT/openindiana2. (null)
Perhaps there are other similar issues, but these are some I've hit today ;)
Again, the proposed fix is about writing some informative messages instead of one-liners "Unable to...".
A secondary objective might be to add a documented verbosity command-line option to do the same outout as "BE_PRINT_ERR=true".