]> pere.pagekite.me Git - homepage.git/blob - blog/tags/raid/raid.rss
92208e09287defad38264a816ec5414f1f2230a1
[homepage.git] / blog / tags / raid / raid.rss
1 <?xml version="1.0" encoding="utf-8"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries tagged raid</title>
5 <description>Entries tagged raid</description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>How to figure out which RAID disk to replace when it fail</title>
11 <link>http://people.skolelinux.org/pere/blog/How_to_figure_out_which_RAID_disk_to_replace_when_it_fail.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/How_to_figure_out_which_RAID_disk_to_replace_when_it_fail.html</guid>
13 <pubDate>Tue, 14 Feb 2012 21:25:00 +0100</pubDate>
14 <description>&lt;p&gt;Once in a while my home server have disk problems. Thanks to Linux
15 Software RAID, I have not lost data yet (but
16 &lt;a href=&quot;http://comments.gmane.org/gmane.linux.raid/34532&quot;&gt;I was
17 close&lt;/a&gt; this summer :). But once a disk is starting to behave
18 funny, a practical problem present itself. How to get from the Linux
19 device name (like /dev/sdd) to something that can be used to identify
20 the disk when the computer is turned off? In my case I have SATA
21 disks with a unique ID printed on the label. All I need is a way to
22 figure out how to query the disk to get the ID out.&lt;/p&gt;
23
24 &lt;p&gt;After fumbling a bit, I
25 &lt;a href=&quot;http://www.cyberciti.biz/faq/linux-getting-scsi-ide-harddisk-information/&quot;&gt;found
26 that hdparm -I&lt;/a&gt; will report the disk serial number, which is
27 printed on the disk label. The following (almost) one-liner can be
28 used to look up the ID of all the failed disks:&lt;/p&gt;
29
30 &lt;blockquote&gt;&lt;pre&gt;
31 for d in $(cat /proc/mdstat |grep &#39;(F)&#39;|tr &#39; &#39; &quot;\n&quot;|grep &#39;(F)&#39;|cut -d\[ -f1|sort -u);
32 do
33 printf &quot;Failed disk $d: &quot;
34 hdparm -I /dev/$d |grep &#39;Serial Num&#39;
35 done
36 &lt;/blockquote&gt;&lt;/pre&gt;
37
38 &lt;p&gt;Putting it here to make sure I do not have to search for it the
39 next time, and in case other find it useful.&lt;/p&gt;
40
41 &lt;p&gt;At the moment I have two failing disk. :(&lt;/p&gt;
42
43 &lt;blockquote&gt;&lt;pre&gt;
44 Failed disk sdd1: Serial Number: WD-WCASJ1860823
45 Failed disk sdd2: Serial Number: WD-WCASJ1860823
46 Failed disk sde2: Serial Number: WD-WCASJ1840589
47 &lt;/blockquote&gt;&lt;/pre&gt;
48
49 &lt;p&gt;The last time I had failing disks, I added the serial number on
50 labels I printed and stuck on the short sides of each disk, to be able
51 to figure out which disk to take out of the box without having to
52 remove each disk to look at the physical vendor label. The vendor
53 label is at the top of the disk, which is hidden when the disks are
54 mounted inside my box.&lt;/p&gt;
55
56 &lt;p&gt;I really wish the check_linux_raid Nagios plugin for checking Linux
57 Software RAID in the
58 &lt;a href=&quot;http://packages.qa.debian.org/n/nagios-plugins.html&quot;&gt;nagios-plugins-standard&lt;/a&gt;
59 debian package would look up this value automatically, as it would
60 make the plugin a lot more useful when my disks fail. At the moment
61 it only report a failure when there are no more spares left (it really
62 should warn as soon as a disk is failing), and it do not tell me which
63 disk(s) is failing when the RAID is running short on disks.&lt;/p&gt;
64 </description>
65 </item>
66
67 </channel>
68 </rss>