maybe someone had this working... I couldn't :( FAILED DISK LED

Status
Not open for further replies.

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Hello :)

I have a SUPERMICRO CSE-826 2U chasis with a sas2826el1 backplane with a dell h310 IT, it works wonderfully with my MB and 6x 3TB raidz2 pool. I can turn off and on the failed leds in the chassis with sas2ircu commands which is awesome!
I saw this script for freebsd that sends you an email if a disk fails and turns on the corresponding failed disk led in the chassis but it needs sg3_utils package which freenas lacks and so its not working :( I have a couple of days trying to make it work, but I don't have the knowledge to do it, first I tried to install the missing package but later I found out that freenas wont allow me to install new packages outside a jail and then I found out that jails don't have access to status of ZFS volumes, so even after getting sg3_utils working inside a jail, the script still wont work.

so my questions boil down to:

1 is there any way to get that sg3_util package installed in the base freenas system or a way to request its install in future releases?
2 is there any way to make some kind of link between my jail and main freenas so I can supply the script the data it needs from base system? like an alias or something?

I would appreciate any info that would get me closer to making this working :)

thank you so much!
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
it needs sg3_utils package which freenas lacks
As I noted in the other thread, this isn't the issue--the only utility from that package that this script calls is sg_vpd, which is part of the base FreeNAS install. What happens when you try to run this?
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
As I noted in the other thread, this isn't the issue--the only utility from that package that this script calls is sg_vpd, which is part of the base FreeNAS install. What happens when you try to run this?
Thanks for pointing that out, you're completely right, when I run it, it sends me an email and then gives an error: "zpscan.sh 59: syntax error "fi" unexpected"
45eadcbf4f57ec0fdd64f9aad3470456.jpg


Sent from my XT1095 using Tapatalk
494e8319a16cfcd78f7f9300eee778af.jpg
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Here is the script code, maybe a kind soul will help this noob debug it using the magic word please? :)
Code:
#! /usr/local/bin/bash
if [ ! "$1" ]; then
  echo "Usage: zpscan.sh pool "
  echo "Scan a pool, send email notification and activate leds of failed drives"
  exit
fi
if [ ! -d /root/.sas2ircu ]; then
  mkdir /root/.sas2ircu
  touch /root/.sas2ircu/drives
  touch /root/.sas2ircu/locs
fi
if [ "$2" ]; then
  email="$2"
else
  email="root"
fi
condition=$(/sbin/zpool status $1 | egrep -i '(DEGRADED|FAULTED|OFFLINE|UNAVAIL|REMOVED|FAIL|DESTROYED|corrupt|cannot|unrecover)')
if [ "${condition}" ]; then
  emailSubject="`hostname` - ZFS pool - HEALTH fault"
  mailbody=$(zpool status $zpname)
  echo "Sending email notification of degraded zpool $1"
  echo "$mailbody" | mail -s "Degraded Zpool $1 on hostname" $email
  drivelist=$(zpool status $1 | grep -E $'^\t  ' | grep -vE "^\W+($POOL|NAME|mirror|logs|spares)" | sed -E $'s/^[\t ]+//;s/([a-z0-9]+).*/\\1/')
  echo "Locating failed drives."
  for drive in $drivelist;
  do
  record=$(grep -E "^$drive" /root/.sas2ircu/drives)
  location=$(echo $record | cut -f 3 -d " ")
  echo Locating: $record
  sas2ircu 0 locate $location ON
  if [ ! "$(egrep $location /root/.sas2ircu/locs)" ]; then
  echo $location >> /root/.sas2ircu/locs
  fi
  done
else
  echo "Saving drive list."
  drivelist=$(zpool status $1 | grep -E $'^\t  ' | grep -vE "^\W+($1|NAME|mirror|logs|spares)" | sed -E $'s/^[\t ]+//;s/([a-z0-9]+).*/\\1/')
  saslist=$(sas2ircu 0 display)
  printf "" > /root/.sas2ircu/drives
  for drive in $drivelist;
  do
  sasaddr=$(sg_vpd -i -q $drive 2>/dev/null | sed -E '2!d;s/,.*//;s/  0x//;s/([0-9a-f]{7})([0-9a-f])([0-9a-f]{4})([0-9a-f]{4})/\1-\2-\3-\4/')
  encaddr=$(echo "$saslist" | grep $sasaddr -B 2 | sed -E 'N;s/^.*: ([0-9]+)\n.*: ([0-9]+)/\1:\2/')
  echo $drive $sasaddr $encaddr >> /root/.sas2ircu/drives
  done

  for loc in $(cat /root/.sas2ircu/locs);
  do
  sas2ircu 0 locate $loc OFF
  done
  printf "" > /root/.sas2ircu/locs
fi

  for loc in $(cat /root/.sas2ircu/locs);
  do
  sas2ircu 0 locate $loc OFF
  done
  printf "" > /root/.sas2ircu/locs
fi


EDIT: posted code with spoiler tag, my mistake, corrected as pointed out
 
Last edited:

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Code tags, not spoiler tags, please.
My mistake! Corrected that, hope someone will see what I can't :)

Sent from my XT1095 using Tapatalk
 

Linkman

Patron
Joined
Feb 19, 2015
Messages
219
Have you edited it at all? The "fi" on line 59 does not have a matching "if" as far as I can see. Comment "#" out the "fi" on line 59 (the last one) and run it again. I can't run it here, don't have the correct environment, so that's just eyeballing it.
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Have you edited it at all? The "fi" on line 59 does not have a matching "if" as far as I can see. Comment "#" out the "fi" on line 59 (the last one) and run it again. I can't run it here, don't have the correct environment, so that's just eyeballing it.
Thanks for the reply!

After removing the "fi" it and running it apparently runs until sending me an email, after that nothing happens and the files that are supposed to be filled with data are empty.
49ddb1758c6c676442765cadfcc767aa.jpg


Sent from my XT1095 using Tapatalk
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
OK, some progress. First, the last section (the last six lines) of the script appear to be redundant. So I commented them out. Then I created a pool at the command line, so it wouldn't have any of the FreeNAS-unique stuff: zpool create fred mirror da18 da21
Code:
root@freenas2:~ # zpool status fred
  pool: fred
 state: ONLINE
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   fred  ONLINE  0  0  0
	mirror-0  ONLINE  0  0  0
	da18  ONLINE  0  0  0
	da21  ONLINE  0  0  0

errors: No known data errors


Ran the script as modified:
Code:
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Saving drive list.

The output is there:
Code:
root@freenas2:~/.sas2ircu # cat drives
da18 5003048-0-00e5-7b9e 2:18
da21 5003048-0-00e5-7ba1 2:21


So, offline a drive:
Code:
root@freenas2:/mnt/ssdpool/scripts # zpool offline fred da21
root@freenas2:/mnt/ssdpool/scripts # zpool status fred
  pool: fred
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
   Sufficient replicas exist for the pool to continue functioning in a
   degraded state.
action: Online the device using 'zpool online' or replace the device with
   'zpool replace'.
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   fred  DEGRADED  0  0  0
	mirror-0  DEGRADED  0  0  0
	da18  ONLINE  0  0  0
	4325672247514988004  OFFLINE  0  0  0  was /dev/da21

errors: No known data errors


Run the script again, but no dice:
Code:
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Sending email notification of degraded zpool fred
Locating failed drives.
Locating:
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

  sas3ircu <controller #> LOCATE <Encl:Bay> <Action> [Wait [Time]]
  where <controller #> is:
  A controller number between 0 and 255.
  where <Encl:Bay> is:
  A valid Enclosure and Bay pair to identify
  the drive
  where <Action> is:
  ON  -  turn ON the drives LED
  OFF  -  turn OFF the drives LED
  where [Wait [Time]] is:
  Minimum time location indicator blink for a particular drive
	optional option, valid only for ON action
  Time -  Waiting time between 1 to 60 seconds
   

SAS2IRCU: Error executing command LOCATE.


Running the sas2ircu command manually, however, works:
Code:
root@freenas2:~/.sas2ircu # sas2ircu 0 LOCATE 2:21 ON
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

SAS2IRCU: LOCATE command completed successfully.
SAS2IRCU: Command LOCATE Completed Successfully.
SAS2IRCU: Utility Completed Successfully.


Progress, but obviously more to do.
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
OK, some progress. First, the last section (the last six lines) of the script appear to be redundant. So I commented them out. Then I created a pool at the command line, so it wouldn't have any of the FreeNAS-unique stuff: zpool create fred mirror da18 da21
Code:
root@freenas2:~ # zpool status fred
  pool: fred
 state: ONLINE
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   fred  ONLINE  0  0  0
	mirror-0  ONLINE  0  0  0
	da18  ONLINE  0  0  0
	da21  ONLINE  0  0  0

errors: No known data errors


Ran the script as modified:
Code:
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Saving drive list.

The output is there:
Code:
root@freenas2:~/.sas2ircu # cat drives
da18 5003048-0-00e5-7b9e 2:18
da21 5003048-0-00e5-7ba1 2:21


So, offline a drive:
Code:
root@freenas2:/mnt/ssdpool/scripts # zpool offline fred da21
root@freenas2:/mnt/ssdpool/scripts # zpool status fred
  pool: fred
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
   Sufficient replicas exist for the pool to continue functioning in a
   degraded state.
action: Online the device using 'zpool online' or replace the device with
   'zpool replace'.
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   fred  DEGRADED  0  0  0
	mirror-0  DEGRADED  0  0  0
	da18  ONLINE  0  0  0
	4325672247514988004  OFFLINE  0  0  0  was /dev/da21

errors: No known data errors


Run the script again, but no dice:
Code:
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Sending email notification of degraded zpool fred
Locating failed drives.
Locating:
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

  sas3ircu <controller #> LOCATE <Encl:Bay> <Action> [Wait [Time]]
  where <controller #> is:
  A controller number between 0 and 255.
  where <Encl:Bay> is:
  A valid Enclosure and Bay pair to identify
  the drive
  where <Action> is:
  ON  -  turn ON the drives LED
  OFF  -  turn OFF the drives LED
  where [Wait [Time]] is:
  Minimum time location indicator blink for a particular drive
	optional option, valid only for ON action
  Time -  Waiting time between 1 to 60 seconds
   

SAS2IRCU: Error executing command LOCATE.


Running the sas2ircu command manually, however, works:
Code:
root@freenas2:~/.sas2ircu # sas2ircu 0 LOCATE 2:21 ON
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

SAS2IRCU: LOCATE command completed successfully.
SAS2IRCU: Command LOCATE Completed Successfully.
SAS2IRCU: Utility Completed Successfully.


Progress, but obviously more to do.
Woa! That's great!! Thank you for taking the time to debug this! Closer to a working script! This would make a good one for resources!



Sent from my XT1095 using Tapatalk
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
OK, with a few tweaks, I have it working on the test pool. Here's the script as it stands now:
Code:
#! /usr/local/bin/bash
if [ ! "$1" ]; then
  echo "Usage: zpscan.sh pool "
  echo "Scan a pool, send email notification and activate leds of failed drives"
  exit
fi
if [ ! -d /root/.sas2ircu ]; then
  mkdir /root/.sas2ircu
  touch /root/.sas2ircu/drives
  touch /root/.sas2ircu/locs
fi
pool="$1"
if [ "$2" ]; then
  email="$2"
else
  email="root"
fi
condition=$(/sbin/zpool status $pool | egrep -i '(DEGRADED|FAULTED|OFFLINE|UNAVAIL|REMOVED|FAIL|DESTROYED|corrupt|cannot|unrecover)')
if [ "${condition}" ]; then
  emailSubject="`hostname` - ZFS pool - HEALTH fault"
  mailbody=$(zpool status $pool)
  echo "Sending email notification of degraded pool $pool"
  echo "$mailbody" | mail -s "Degraded pool $pool on `hostname`" $email
  drivelist=$(zpool status $pool | grep -E "(DEGRADED|FAULTED|OFFLINE|UNAVAIL|REMOVED|FAIL|DESTROYED)" | grep -vE "^\W+($pool|NAME|mirror|logs|spares|state)" | sed -E $'s/.*was \/dev\/([0-9a-z]+)/\\1/;s/^[\t  ]+([0-9a-z]+)[\t ]+.*$/\\1/')
  echo "Locating failed drives."
  for drive in $drivelist;
  do
	record=$(grep -E "^$drive" /root/.sas2ircu/drives)
	location=$(echo $record | cut -f 3 -d " ")
	echo Locating: $record
	sas2ircu 0 locate $location ON
	if [ ! "$(egrep $location /root/.sas2ircu/locs)" ]; then
	  echo $location >> /root/.sas2ircu/locs
	fi
  done
else
  echo "Saving drive list."
  drivelist=$(zpool status $pool | grep -E $'^\t  ' | grep -vE "^\W+($pool|NAME|mirror|logs|spares)" | sed -E $'s/^[\t ]+//;s/([a-z0-9]+).*/\\1/')
  saslist=$(sas2ircu 0 display)
  printf "" > /root/.sas2ircu/drives
  for drive in $drivelist;
  do
	sasaddr=$(sg_vpd -i -q $drive 2>/dev/null | sed -E '2!d;s/,.*//;s/  0x//;s/([0-9a-f]{7})([0-9a-f])([0-9a-f]{4})([0-9a-f]{4})/\1-\2-\3-\4/')
	encaddr=$(echo "$saslist" | grep $sasaddr -B 2 | sed -E 'N;s/^.*: ([0-9]+)\n.*: ([0-9]+)/\1:\2/')
	echo $drive $sasaddr $encaddr >> /root/.sas2ircu/drives
  done

  for loc in $(cat /root/.sas2ircu/locs);
  do
	sas2ircu 0 locate $loc OFF
  done
  printf "" > /root/.sas2ircu/locs
fi
 
Last edited:

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
OK, with a few tweaks, I have it working on the test pool. Here's the script as it stands now:
Code:
#! /usr/local/bin/bash
if [ ! "$1" ]; then
  echo "Usage: zpscan.sh pool "
  echo "Scan a pool, send email notification and activate leds of failed drives"
  exit
fi
if [ ! -d /root/.sas2ircu ]; then
  mkdir /root/.sas2ircu
  touch /root/.sas2ircu/drives
  touch /root/.sas2ircu/locs
fi
pool="$1"
if [ "$2" ]; then
  email="$2"
else
  email="root"
fi
condition=$(/sbin/zpool status $pool | egrep -i '(DEGRADED|FAULTED|OFFLINE|UNAVAIL|REMOVED|FAIL|DESTROYED|corrupt|cannot|unrecover)')
if [ "${condition}" ]; then
  emailSubject="`hostname` - ZFS pool - HEALTH fault"
  mailbody=$(zpool status $pool)
  echo "Sending email notification of degraded pool $pool"
  echo "$mailbody" | mail -s "Degraded pool $pool on `hostname`" $email
  drivelist=$(zpool status $pool | grep -E "(DEGRADED|FAULTED|OFFLINE|UNAVAIL|REMOVED|FAIL|DESTROYED)" | grep -vE "^\W+($pool|NAME|mirror|logs|spares|state)" | sed -E $'s/.*was \/dev\/([0-9a-z]+)/\\1/;s/^[\t  ]+([0-9a-z]+)[\t ]+.*$/\\1/')
  echo "Locating failed drives."
  for drive in $drivelist;
  do
	record=$(grep -E "^$drive" /root/.sas2ircu/drives)
	location=$(echo $record | cut -f 3 -d " ")
	echo Locating: $record
	sas2ircu 0 locate $location ON
	if [ ! "$(egrep $location /root/.sas2ircu/locs)" ]; then
	  echo $location >> /root/.sas2ircu/locs
	fi
  done
else
  echo "Saving drive list."
  drivelist=$(zpool status $pool | grep -E $'^\t  ' | grep -vE "^\W+($pool|NAME|mirror|logs|spares)" | sed -E $'s/^[\t ]+//;s/([a-z0-9]+).*/\\1/')
  saslist=$(sas2ircu 0 display)
  printf "" > /root/.sas2ircu/drives
  for drive in $drivelist;
  do
	sasaddr=$(sg_vpd -i -q $drive 2>/dev/null | sed -E '2!d;s/,.*//;s/  0x//;s/([0-9a-f]{7})([0-9a-f])([0-9a-f]{4})([0-9a-f]{4})/\1-\2-\3-\4/')
	encaddr=$(echo "$saslist" | grep $sasaddr -B 2 | sed -E 'N;s/^.*: ([0-9]+)\n.*: ([0-9]+)/\1:\2/')
	echo $drive $sasaddr $encaddr >> /root/.sas2ircu/drives
  done

  for loc in $(cat /root/.sas2ircu/locs);
  do
	sas2ircu 0 locate $loc OFF
  done
  printf "" > /root/.sas2ircu/locs
fi
Awesome Dan!! I will try it as soon as I get home! Woooohooooo!!! Kudos to to you for making it work!

Something that could be a problem for me is that the drives attached to the backplane show with gptid id and not like daX, only the boot mirror disks wich are plugged to the motherboard shows as adaX

Sent from my XT1095 using Tapatalk
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Something that could be a problem for me is that the drives attached to the backplane show with gptid id and not like daX
Not "could be", "will be." There's going to be more work needed for this to work with a FreeNAS-generated pool. I have some ideas, but it may take a while to test them.

Edit: In case someone wants to get to it before I can, I expect it's going to involve glabel status to translate gptid to adanp2, and probably sed to get rid of the p2.
 
Last edited:

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
Not "could be", "will be." There's going to be more work needed for this to work with a FreeNAS-generated pool. I have some ideas, but it may take a while to test them.

Edit: In case someone wants to get to it before I can, I expect it's going to involve glabel status to translate gptid to adanp2, and probably sed to get rid of the p2.
Ohh well! Would this help?
 

Stux

MVP
Joined
Jun 2, 2016
Messages
4,419
glabel status | grep <gptid/deviceid>

Gets you a line with the device id in a specific column. Easy to do pull the line and column out with awk I believe
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Ohh well! Would this help?
Yes, already tracking that. Simple, but ugly, answer would be to modify the script to pipe zpool status through fixer.sh. That can't be the best answer, though.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Converting a gptid to a base drive ID without partitions:
Code:
glabel status | grep <gptid> | sed 's/p[0-9]//' | awk '{print $3}'

Excludes all partition numbers, not just p2, because if you make a pool without swap partitions, FreeNAS will still partition the disks and make the ZFS partion p1.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
OK, I think I have this working on a pool created through the GUI. Here's the current version of the script, to test at your own risk:
Code:
#! /usr/local/bin/bash
if [ ! "$1" ]; then
  echo "Usage: zpscan.sh pool "
  echo "Scan a pool, send email notification and activate leds of failed drives"
  exit
fi
pool="$1"
basedir="/root/.sas2ircu"
drivesfile=$basedir/drives-$pool
locsfile=$basedir/locs-$pool
if [ ! -d /root/.sas2ircu ]; then
  mkdir $basedir
fi
touch $drivesfile
touch $locsfile
if [ "$2" ]; then
  email="$2"
else
  email="root"
fi
condition=$(/sbin/zpool status $pool | egrep -i '(DEGRADED|FAULTED|OFFLINE|UNAVAIL|REMOVED|FAIL|DESTROYED|corrupt|cannot|unrecover)')
if [ "${condition}" ]; then
  glabel status | awk '{print "s|"$1"|"$3"\t\t\t  |g"}' > glabel-lookup.sed
  emailSubject="`hostname` - ZFS pool - HEALTH fault"
  mailbody=$(zpool status $pool)
  echo "Sending email notification of degraded pool $pool"
  echo "$mailbody" | mail -s "Degraded pool $pool on `hostname`" $email
  drivelist=$(zpool status $pool | sed -f glabel-lookup.sed | sed 's/p[0-9]//' | grep -E "(DEGRADED|FAULTED|OFFLINE|UNAVAIL|REMOVED|FAIL|DESTROYED)" | grep -vE "^\W+($pool|NAME|mirror|raidz|stripe|logs|spares|state)" | sed -E $'s/.*was \/dev\/([0-9a-z]+)/\\1/;s/^[\t  ]+([0-9a-z]+)[\t ]+.*$/\\1/')
  echo "Locating failed drives."
  for drive in $drivelist;
  do
	record=$(grep -E "^$drive" $drivesfile)
	location=$(echo $record | cut -f 3 -d " ")
	echo Locating: $record
	sas2ircu 0 locate $location ON
	if [ ! "$(egrep $location $locsfile)" ]; then
	  echo $location >> $locsfile
	fi
  done
  rm glabel-lookup.sed
else
  echo "Saving drive list."
  glabel status | awk '{print "s|"$1"|"$3"\t\t\t  |g"}' > glabel-lookup.sed
  drivelist=$(zpool status $pool  | sed -f glabel-lookup.sed | sed 's/p[0-9]//' | grep -E $'^\t  ' | grep -vE "^\W+($pool|NAME|mirror|raidz|stripe|logs|spares)" | sed -E $'s/^[\t ]+//;s/([a-z0-9]+).*/\\1/')
  saslist=$(sas2ircu 0 display)
  printf "" > $drivesfile
  for drive in $drivelist;
  do
	sasaddr=$(sg_vpd -i -q $drive 2>/dev/null | sed -E '2!d;s/,.*//;s/  0x//;s/([0-9a-f]{7})([0-9a-f])([0-9a-f]{4})([0-9a-f]{4})/\1-\2-\3-\4/')
	encaddr=$(echo "$saslist" | grep $sasaddr -B 2 | sed -E 'N;s/^.*: ([0-9]+)\n.*: ([0-9]+)/\1:\2/')
	echo $drive $sasaddr $encaddr >> $drivesfile
  done

  for loc in $(cat $locsfile);
  do
	sas2ircu 0 locate $loc OFF
  done
  printf "" > $locsfile
  rm glabel-lookup.sed
fi



Edit: slight change to code above to make it work with RAIDZn. With this change, it also appears to work with my main (3 x 6-disk RAIDZ2) pool.
 
Last edited:

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
...and here's my testing. I destroyed the pool 'fred' that I'd created from the shell before, and created a new one through the GUI.

Code:
root@freenas2:/mnt/ssdpool/scripts # zpool status fred
  pool: fred
 state: ONLINE
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   fred  ONLINE  0  0  0
	mirror-0  ONLINE  0  0  0
	  gptid/d008caa6-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0
	  gptid/d23421ec-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0

errors: No known data errors
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Saving drive list.
root@freenas2:/mnt/ssdpool/scripts # cat /root/.sas2ircu/drives-fred
da18 5003048-0-00e5-7b9e 2:18
da21 5003048-0-00e5-7ba1 2:21
root@freenas2:/mnt/ssdpool/scripts # zpool offline fred gptid/d23421ec-bbe2-11e7-9f82-002590caf340
root@freenas2:/mnt/ssdpool/scripts # zpool status fred
  pool: fred
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
   Sufficient replicas exist for the pool to continue functioning in a
   degraded state.
action: Online the device using 'zpool online' or replace the device with
   'zpool replace'.
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   fred  DEGRADED  0  0  0
	mirror-0  DEGRADED  0  0  0
	  gptid/d008caa6-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0
	  13781061251458189079  OFFLINE  0  0  0  was /dev/gptid/d23421ec-bbe2-11e7-9f82-002590caf340

errors: No known data errors
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Sending email notification of degraded pool fred
Locating failed drives.
Locating: da21 5003048-0-00e5-7ba1 2:21
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

SAS2IRCU: LOCATE command completed successfully.
SAS2IRCU: Command LOCATE Completed Successfully.
SAS2IRCU: Utility Completed Successfully.
root@freenas2:/mnt/ssdpool/scripts # zpool online fred gptid/d23421ec-bbe2-11e7-9f82-002590caf340
root@freenas2:/mnt/ssdpool/scripts # zpool status fred
  pool: fred
 state: ONLINE
  scan: resilvered 24K in 0h0m with 0 errors on Sat Oct 28 09:23:17 2017
config:

   NAME  STATE  READ WRITE CKSUM
   fred  ONLINE  0  0  0
	mirror-0  ONLINE  0  0  0
	  gptid/d008caa6-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0
	  gptid/d23421ec-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0

errors: No known data errors
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Saving drive list.
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

SAS2IRCU: LOCATE command completed successfully.
SAS2IRCU: Command LOCATE Completed Successfully.
SAS2IRCU: Utility Completed Successfully.
root@freenas2:/mnt/ssdpool/scripts #
 

carlos juan

Dabbler
Joined
Sep 12, 2014
Messages
38
...and here's my testing. I destroyed the pool 'fred' that I'd created from the shell before, and created a new one through the GUI.

Code:
root@freenas2:/mnt/ssdpool/scripts # zpool status fred
  pool: fred
 state: ONLINE
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   fred  ONLINE  0  0  0
	mirror-0  ONLINE  0  0  0
	  gptid/d008caa6-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0
	  gptid/d23421ec-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0

errors: No known data errors
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Saving drive list.
root@freenas2:/mnt/ssdpool/scripts # cat /root/.sas2ircu/drives-fred
da18 5003048-0-00e5-7b9e 2:18
da21 5003048-0-00e5-7ba1 2:21
root@freenas2:/mnt/ssdpool/scripts # zpool offline fred gptid/d23421ec-bbe2-11e7-9f82-002590caf340
root@freenas2:/mnt/ssdpool/scripts # zpool status fred
  pool: fred
 state: DEGRADED
status: One or more devices has been taken offline by the administrator.
   Sufficient replicas exist for the pool to continue functioning in a
   degraded state.
action: Online the device using 'zpool online' or replace the device with
   'zpool replace'.
  scan: none requested
config:

   NAME  STATE  READ WRITE CKSUM
   fred  DEGRADED  0  0  0
	mirror-0  DEGRADED  0  0  0
	  gptid/d008caa6-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0
	  13781061251458189079  OFFLINE  0  0  0  was /dev/gptid/d23421ec-bbe2-11e7-9f82-002590caf340

errors: No known data errors
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Sending email notification of degraded pool fred
Locating failed drives.
Locating: da21 5003048-0-00e5-7ba1 2:21
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

SAS2IRCU: LOCATE command completed successfully.
SAS2IRCU: Command LOCATE Completed Successfully.
SAS2IRCU: Utility Completed Successfully.
root@freenas2:/mnt/ssdpool/scripts # zpool online fred gptid/d23421ec-bbe2-11e7-9f82-002590caf340
root@freenas2:/mnt/ssdpool/scripts # zpool status fred
  pool: fred
 state: ONLINE
  scan: resilvered 24K in 0h0m with 0 errors on Sat Oct 28 09:23:17 2017
config:

   NAME  STATE  READ WRITE CKSUM
   fred  ONLINE  0  0  0
	mirror-0  ONLINE  0  0  0
	  gptid/d008caa6-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0
	  gptid/d23421ec-bbe2-11e7-9f82-002590caf340  ONLINE  0  0  0

errors: No known data errors
root@freenas2:/mnt/ssdpool/scripts # ./zpscan_bsd.sh fred
Saving drive list.
LSI Corporation SAS2 IR Configuration Utility.
Version 20.00.00.00 (2014.09.18)
Copyright (c) 2008-2014 LSI Corporation. All rights reserved.

SAS2IRCU: LOCATE command completed successfully.
SAS2IRCU: Command LOCATE Completed Successfully.
SAS2IRCU: Utility Completed Successfully.
root@freenas2:/mnt/ssdpool/scripts #
Amazing! Will try that as soon as I get home :D thank you so much Dan!

Sent from my XT1095 using Tapatalk
 
Status
Not open for further replies.
Top