2012-10-05 22:53, Edward Ned Harvey (opensolarisisdeadlongliveopensolaris) wrote:

Nice writeup, thanks. Perhaps you could also post/link it on OI wiki
so the community can find it easier?

A few comments:

1) For readability I'd use "...| awk '{print $1}'" instead of sed:

- for GUID in `sudo sbdadm list-lu | grep rdsk | sed 's/ .*//'`
+ for GUID in `sudo sbdadm list-lu | grep rdsk | awk '{print $1}'`

On one hand, different implementations of sed might parse regexps
differently, on the other - column order might change and changing
a number in awk would be more straightforward.

2) Here you can just redirect stdio from /dev/null:

- sudo format -e  # Make a note of the new device names. And hit Ctrl-C.
+ sudo format -e < /dev/null

3) In iscsi-pool-ctrl.sh it is more readable to replace the
'if "$1"...elif..else' clause with 'case "$1" in ... esac'
That is also easier to expand if needed; for example, to alias
'import|start)' and 'export|stop)' for more standard method

3.1) Also you should probably do "zpool import -o cachefile ..."
or plain "zpool import -R / ..." to set a particular cachefile
or use none, to avoid auto-import upon boot via standard file
/etc/zfs/zpool.cache (which can break your filesystem/local

Also note that use of the altroot (-R) option disables the
cachefile by default, so you can use it as a shortcut.

3.2) The exit errors should be aligned with SMF status codes, so
you should include /lib/svc/share/smf_include.sh and return
one of these:


(You can validate inclusion of that file, so if it fails, you
can define these values yourself for the script, i.e. to use
it as an initscript on a system without SMF).

3.3) To catch "device busy" errors you can retry failed zpool
export runs with "zpool export -f" which tries a bit harder.

Otherwise, quite LGTM :)
//Jim Klimov

zfs-discuss mailing list
              • ... Dan Swartzendruber
              • ... Richard Elling
              • ... Dan Swartzendruber
              • ... Jim Klimov
              • ... Dan Swartzendruber
              • ... Jim Klimov
              • ... Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
              • ... Jim Klimov
              • ... Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
              • ... Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
              • ... Jim Klimov
              • ... Jim Klimov
              • ... Jim Klimov
              • ... Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
              • ... Timothy Coalson
              • ... Edward Ned Harvey (opensolarisisdeadlongliveopensolaris)
              • ... Timothy Coalson
  • Re: [zfs-discuss]... matthew patton

Reply via email to