Whamcloud - gitweb
LU-2337 scripts: init script to not use -d with zpool import
authorNed Bass <bass6@llnl.gov>
Tue, 27 Nov 2012 19:06:43 +0000 (11:06 -0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Jan 2013 06:19:14 +0000 (01:19 -0500)
commite9a8683eacd71a7f11f157b39c616e6f1169d685
tree536d94de4abaf604d569d01f4c97b7b388dddb53
parent6ecab5f514a1307c833967741003bca02dd533ff
LU-2337 scripts: init script to not use -d with zpool import

The zpool import command shipped with ZFS on Linux now searches the
following directories for devices (in order), eliminating the need for
the zpool import -d option in the lustre init script.

  /dev/disk/by-vdev   - Custom rules, use first if they exist
  /dev/disk/zpool     - Custom rules, use first if they exist
  /dev/mapper         - Use multipath devices before components
  /dev/disk/by-uuid   - Single unique entry and persistent
  /dev/disk/by-id     - May be multiple entries and persistent
  /dev/disk/by-path   - Encodes physical location and persistent
  /dev/disk/by-label  - Custom persistent labels
  /dev                - UNSAFE device names will change

The command formerly only searched /dev by default, so the init script
used the -d option to give precedence to preferred locations such as
/dev/mapper.  However this approach is error-prone on systems where
/dev/mapper exists but doesn't contain the zpool member devices.  With
this change the default script behavior should work on systems using
any of the above directories.

Also print an error message if zpool import fails, and remove an
unused variable from an unrelated function.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Change-Id: I257da17328bec84aa568a61a40cdb374535aa935
Reviewed-on: http://review.whamcloud.com/4686
Tested-by: Hudson
Reviewed-by: Prakash Surya <surya1@llnl.gov>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/scripts/lustre