Re: Trouble using smartctl with LSI megaraid controller

[email protected] Mon, 13 Feb 2017 16:44:08 -0800
Newsgroups gmane.linux.utilities.smartmontools
Message-ID <CAFY+Po-e5J9gY9hk_VCNRx9jeKmAGMLu+2AhEmKx6_pQZeXLRQ@mail.gmail.com>
--===============5940362534383564734==
Content-Type: multipart/alternative; boundary=001a114b5b489e2487054872dc7d

--001a114b5b489e2487054872dc7d
Content-Type: text/plain; charset=UTF-8

Thanks for the info David. I'll run the tests separately on each drive
then.  I thought it could be done on a partition.  I can execute most
smartctl commands from the command line but would like it monitored by
the smartd daemon instead of running a script. By the documentation at
https://linux.die.net/man/5/smartd.conf it seems the commands below
work in the smartd.conf after restart after removing the -H and
substituting it with an -a? The output from /var/log/messages is
below.

/etc/smartd.conf

/dev/sda -d sat+megaraid,30 -a -s S/../.././01
/dev/sda -d sat+megaraid,31 -a -s S/../.././02

/var/log/messages
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda
[megaraid_disk_30] [SAT], not found in smartd database.
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda
[megaraid_disk_30] [SAT], not capable of SMART Health Status check
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda
[megaraid_disk_30] [SAT], is SMART capable. Adding to "monitor" list.
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda
[megaraid_disk_31] [SAT], opened
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda
[megaraid_disk_31] [SAT], WDC WD2500BHTZ-04JCPV0, S/N:WD-WX11E23LW514,
WWN:5-0014ee-65929e323, FW:04.06A00, 250 GB
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda
[megaraid_disk_31] [SAT], not found in smartd database.
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda
[megaraid_disk_31] [SAT], not capable of SMART Health Status check
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda
[megaraid_disk_31] [SAT], is SMART capable. Adding to "monitor" list.
Feb 13 16:00:53 db011 smartd[32430]: Monitoring 2 ATA and 0 SCSI devices
Feb 13 16:00:53 db011 smartd[32444]: smartd has fork()ed into
background mode. New PID=32444.

================================================================================

Sorry, no.

> 2. There are two partitions in this system /dev/sda and /dev/sdb.  How
> do I
> know which drive Id (DID) belongs to which partition and does it matter
> if
> I assign a physical drive to the incorrect partition?

Get the "megacli" program and install it.  Then you can run things like
this:

SNAME=`hostname -s`
NOW=`date`
OFILE=/root/$SNAME.megaraid.info

echo "Megaraid information for $SNAME collected $NOW" > $OFILE
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> $OFILE
echo "General Information" >> $OFILE
megacli -AdpAllInfo      -aAll | tr -d '\r' >> $OFILE
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> $OFILE
echo "Battery backup" >> $OFILE
megacli -AdpBbuCmd       -aAll | tr -d '\r'>> $OFILE
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> $OFILE
echo "Virtual disks" >> $OFILE
megacli -LDInfo    -Lall -aALL | tr -d '\r'>> $OFILE
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> $OFILE
echo "Physical drives" >> $OFILE
megacli -PDList          -aALL | tr -d '\r'>> $OFILE
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> $OFILE
echo "Patrol read" >> $OFILE
megacli -AdpPR     -Info -aALL | tr -d '\r'>> $OFILE
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=" >> $OFILE
echo "DONE" >> $OFILE


> 3. Is there a way to check all the drives on a single partition at once
> instead of having to check them individually with the sat+megaraid,N
> syntax?  There are 20 physical drives on this system.

You mean with one "test all disks" smartctl command?  No, I don't think
that is possible.
You can certainly start all of the tests sequentially with no delay,
which is pretty
much the same thing.  Then wait however long is necessary for that disk
type and read back all the results.  In theory.  For some reason my test
script does them sequentially - I may have been worried about  what the
RAID would do if all the disks were busy self testing at the same time.
Doing them sequentially in a script (with or without delays) isn't a big
deal, something along the lines of:

/usr/sbin/smartctl -t long /dev/sda -d sat+megaraid,0
sleep 10300
logger "Done smartctl -t long  /dev/sda -d sat+megaraid,0"
/usr/sbin/smartctl -t long /dev/sda -d sat+megaraid,1
sleep 10300
logger "Done smartctl -t long  /dev/sda -d sat+megaraid,1"
etc.

then read all the results.  Use a loop if you don't want to write them
all out. It would also be fine to read the result for a disk immediately
after each long test completes.

> 4.  Once I enable smartctl on the command line for a drive is it on
> permanently or does it need to be enabled through the smartd.conf file?

Once enabled it should stay on until the system reboots.  That command
changes a state
which is stored on the drive.  The state will not survive a power cycle.

Regards,

David Mathog
mathog@...
Manager, Sequence Analysis Facility, Biology Division, Caltech

--001a114b5b489e2487054872dc7d
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><pre style=3D"margin-top:0px;margin-bottom:0px;padding:15p=
x;border-width:0px 0px 0px 1px;border-top-style:initial;border-right-style:=
initial;border-bottom-style:initial;border-left-style:solid;border-top-colo=
r:initial;border-right-color:initial;border-bottom-color:initial;border-lef=
t-color:rgb(229,229,229);outline:0px;font-size:13px;vertical-align:baseline=
;background-image:initial;background-position:initial;background-size:initi=
al;background-repeat:initial;background-origin:initial;background-clip:init=
ial;font-family:monospace,sans-serif;white-space:pre-wrap;word-wrap:break-w=
ord;overflow:auto;color:rgb(85,85,85)">Thanks for the info David. I&#39;ll =
run the tests separately on each drive then.  I thought it could be done on=
 a partition.  I can execute most smartctl commands from the command line b=
ut would like it monitored by the smartd daemon instead of running a script=
. By the documentation at <a href=3D"https://linux.die.net/man/5/smartd.con=
f">https://linux.die.net/man/5/smartd.conf</a> it seems the commands below =
work in the smartd.conf after restart after removing the -H and substitutin=
g it with an -a? The output from /var/log/messages is below.  </pre>/etc/sm=
artd.conf<div><br>/dev/sda -d sat+megaraid,30 -a -s S/../.././01<br>/dev/sd=
a -d sat+megaraid,31 -a -s S/../.././02<pre style=3D"margin-top:0px;margin-=
bottom:0px;padding:15px;border-width:0px 0px 0px 1px;border-top-style:initi=
al;border-right-style:initial;border-bottom-style:initial;border-left-style=
:solid;border-top-color:initial;border-right-color:initial;border-bottom-co=
lor:initial;border-left-color:rgb(229,229,229);outline:0px;vertical-align:b=
aseline;background-image:initial;background-position:initial;background-siz=
e:initial;background-repeat:initial;background-origin:initial;background-cl=
ip:initial;word-wrap:break-word;overflow:auto"><font color=3D"#555555" face=
=3D"monospace, sans-serif"><span style=3D"white-space:pre-wrap">/var/log/me=
ssages
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda [megaraid_disk_30] [S=
AT], not found in smartd database.
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda [megaraid_disk_30] [S=
AT], not capable of SMART Health Status check
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda [megaraid_disk_30] [S=
AT], is SMART capable. Adding to &quot;monitor&quot; list.
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda [megaraid_disk_31] [S=
AT], opened
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda [megaraid_disk_31] [S=
AT], WDC WD2500BHTZ-04JCPV0, S/N:WD-WX11E23LW514, WWN:5-0014ee-65929e323, F=
W:04.06A00, 250 GB
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda [megaraid_disk_31] [S=
AT], not found in smartd database.
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda [megaraid_disk_31] [S=
AT], not capable of SMART Health Status check
Feb 13 16:00:53 db011 smartd[32430]: Device: /dev/sda [megaraid_disk_31] [S=
AT], is SMART capable. Adding to &quot;monitor&quot; list.
Feb 13 16:00:53 db011 smartd[32430]: Monitoring 2 ATA and 0 SCSI devices
Feb 13 16:00:53 db011 smartd[32444]: smartd has fork()ed into background mo=
de. New PID=3D32444.</span></font></pre><pre style=3D"margin-top:0px;margin=
-bottom:0px;padding:15px;border-width:0px 0px 0px 1px;border-top-style:init=
ial;border-right-style:initial;border-bottom-style:initial;border-left-styl=
e:solid;border-top-color:initial;border-right-color:initial;border-bottom-c=
olor:initial;border-left-color:rgb(229,229,229);outline:0px;font-size:13px;=
vertical-align:baseline;background-image:initial;background-position:initia=
l;background-size:initial;background-repeat:initial;background-origin:initi=
al;background-clip:initial;font-family:monospace,sans-serif;white-space:pre=
-wrap;word-wrap:break-word;overflow:auto;color:rgb(85,85,85)">=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D</pre><pre style=3D"margin-top:0px;margin-bottom:0px;padding:15px;border=
-width:0px 0px 0px 1px;border-top-style:initial;border-right-style:initial;=
border-bottom-style:initial;border-left-style:solid;border-top-color:initia=
l;border-right-color:initial;border-bottom-color:initial;border-left-color:=
rgb(229,229,229);outline:0px;font-size:13px;vertical-align:baseline;backgro=
und-image:initial;background-position:initial;background-size:initial;backg=
round-repeat:initial;background-origin:initial;background-clip:initial;font=
-family:monospace,sans-serif;white-space:pre-wrap;word-wrap:break-word;over=
flow:auto;color:rgb(85,85,85)">Sorry, no.

&gt; 2. There are two partitions in this system /dev/sda and /dev/sdb.  How=
=20
&gt; do I
&gt; know which drive Id (DID) belongs to which partition and does it matte=
r=20
&gt; if
&gt; I assign a physical drive to the incorrect partition?

Get the &quot;megacli&quot; program and install it.  Then you can run thing=
s like=20
this:

SNAME=3D`hostname -s`
NOW=3D`date`
OFILE=3D/root/$<a href=3D"http://SNAME.megaraid.info" target=3D"_blank">SNA=
ME.megaraid.<wbr>info</a>

echo &quot;Megaraid information for $SNAME collected $NOW&quot; &gt; $OFILE
echo &quot;=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D<wbr>=
-=3D-=3D-=3D-=3D&quot; &gt;&gt; $OFILE
echo &quot;General Information&quot; &gt;&gt; $OFILE
megacli -AdpAllInfo      -aAll | tr -d &#39;\r&#39; &gt;&gt; $OFILE
echo &quot;=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D<wbr>=
-=3D-=3D-=3D-=3D&quot; &gt;&gt; $OFILE
echo &quot;Battery backup&quot; &gt;&gt; $OFILE
megacli -AdpBbuCmd       -aAll | tr -d &#39;\r&#39;&gt;&gt; $OFILE
echo &quot;=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D<wbr>=
-=3D-=3D-=3D-=3D&quot; &gt;&gt; $OFILE
echo &quot;Virtual disks&quot; &gt;&gt; $OFILE
megacli -LDInfo    -Lall -aALL | tr -d &#39;\r&#39;&gt;&gt; $OFILE
echo &quot;=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D<wbr>=
-=3D-=3D-=3D-=3D&quot; &gt;&gt; $OFILE
echo &quot;Physical drives&quot; &gt;&gt; $OFILE
megacli -PDList          -aALL | tr -d &#39;\r&#39;&gt;&gt; $OFILE
echo &quot;=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D<wbr>=
-=3D-=3D-=3D-=3D&quot; &gt;&gt; $OFILE
echo &quot;Patrol read&quot; &gt;&gt; $OFILE
megacli -AdpPR     -Info -aALL | tr -d &#39;\r&#39;&gt;&gt; $OFILE
echo &quot;=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D<wbr>=
-=3D-=3D-=3D-=3D&quot; &gt;&gt; $OFILE
echo &quot;DONE&quot; &gt;&gt; $OFILE


&gt; 3. Is there a way to check all the drives on a single partition at onc=
e
&gt; instead of having to check them individually with the sat+megaraid,N
&gt; syntax?  There are 20 physical drives on this system.

You mean with one &quot;test all disks&quot; smartctl command?  No, I don&#=
39;t think=20
that is possible.
You can certainly start all of the tests sequentially with no delay,=20
which is pretty
much the same thing.  Then wait however long is necessary for that disk=20
type and read back all the results.  In theory.  For some reason my test=20
script does them sequentially - I may have been worried about  what the=20
RAID would do if all the disks were busy self testing at the same time. =20
Doing them sequentially in a script (with or without delays) isn&#39;t a bi=
g=20
deal, something along the lines of:

/usr/sbin/smartctl -t long /dev/sda -d sat+megaraid,0
sleep 10300
logger &quot;Done smartctl -t long  /dev/sda -d sat+megaraid,0&quot;
/usr/sbin/smartctl -t long /dev/sda -d sat+megaraid,1
sleep 10300
logger &quot;Done smartctl -t long  /dev/sda -d sat+megaraid,1&quot;
etc.

then read all the results.  Use a loop if you don&#39;t want to write them=
=20
all out. It would also be fine to read the result for a disk immediately=20
after each long test completes.

&gt; 4.  Once I enable smartctl on the command line for a drive is it on
&gt; permanently or does it need to be enabled through the smartd.conf file=
?

Once enabled it should stay on until the system reboots.  That command=20
changes a state
which is stored on the drive.  The state will not survive a power cycle.

Regards,

David Mathog
mathog@...
Manager, Sequence Analysis Facility, Biology Division, Caltech</pre></div><=
/div>

--001a114b5b489e2487054872dc7d--


--===============5940362534383564734==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--===============5940362534383564734==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Smartmontools-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartmontools-support

--===============5940362534383564734==--