<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SupportSages &#187; RAID</title>
	<atom:link href="http://www.supportsages.com/blog/tag/raid/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Rebuilding Software RAID</title>
		<link>http://www.supportsages.com/blog/2009/12/rebuilding-software-raid/</link>
		<comments>http://www.supportsages.com/blog/2009/12/rebuilding-software-raid/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 17:01:03 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[RAID]]></category>
		<category><![CDATA[rebuild array]]></category>
		<category><![CDATA[software raid]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=592</guid>
		<description><![CDATA[One of our clients had a hard drive fail. The harddisk was marked faulty and removed as well. Client inserted new HDDs, and needed us to rebuild the array. Hot swappable HDs would have done the job real quick. But not here. There is some process involved in rebuilding the array. 

A normal array will have the output similar to below - Notice the [UU] - U could mean "Used". A fully functional RAID system would show [UU] for each slice. 

<code>
cat /proc/mdstat 
Personalities : [raid1] 
md0 : active raid1 sda1[0] sdb1[1]
      1052160 blocks [2/2] ...]]></description>
			<content:encoded><![CDATA[<p>One of our clients had a hard drive fail. The harddisk was marked faulty and removed as well. Client inserted new HDDs, and needed us to rebuild the array. Hot swappable HDs would have done the job real quick. But not here. There is some process involved in rebuilding the array. </p>
<p>A normal array will have the output similar to below &#8211; Notice the [UU] &#8211; U could mean &#8220;Used&#8221;. A fully functional RAID system would show [UU] for each slice. </p>
<p><code><br />
cat /proc/mdstat<br />
Personalities : [raid1]<br />
md0 : active raid1 sda1[0] sdb1[1]<br />
      1052160 blocks [2/2] [UU]</code></p>
<p>A degraded array will look like,</p>
<p><code>cat /proc/mdstat<br />
Personalities : [raid1]<br />
md2 : active raid1 sdb2[1]<br />
      8385856 blocks [2/1] [_U]</code></p>
<p>_ means degraded array i.e partition missing from array.</p>
<p>Use fdisk to create partitions similar to the one working in the HDD. Using fdisk, then n , p t etc  to recreate the partitions are not needed if you have sfdisk in the server.</p>
<p>sfdisk &#8211; Partition table manipulator for Linux</p>
<p>fdisk -l or cat /proc/mdstat will give you the device name which is active and the below command will give the partition table of sdb to part.sdb file</p>
<p><code>sfdisk -d /dev/sdb > part.sdb</code></p>
<p><code>sfdisk –-force /dev/sda < part.sdb</code> will copy the partition table to this new sda disk saving the time.<br />
<strong><br />
BE CAREFUL ON WHAT PARTITION TABLES ARE COPIED. Don't copy unused drive's partition table to the active one <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </strong></p>
<p>Finally, once the partition table is copied, execute this</p>
<p># mdadm --add /dev/md0 /dev/sda1<br />
# mdadm --add /dev/md1 /dev/sda3<br />
# mdadm --add /dev/md2 /dev/sda2<br />
# mdadm --add /dev/md3 /dev/sda5</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Rebuilding+Software+RAID+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F592" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Rebuilding+Software+RAID+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F592" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/12/rebuilding-software-raid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

