<?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>Hard disk broken &#8211; Arun&#8217;s blog</title>
	<atom:link href="https://arunns.net/tag/hard-disk-broken/feed/" rel="self" type="application/rss+xml" />
	<link>https://arunns.net</link>
	<description>Arun&#039;s blog</description>
	<lastBuildDate>Mon, 05 Dec 2011 11:51:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.2</generator>
	<item>
		<title>Replace broken hard drive in software RAID1</title>
		<link>https://arunns.net/replace-broken-hard-drive-in-software-raid1/</link>
					<comments>https://arunns.net/replace-broken-hard-drive-in-software-raid1/#comments</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Mon, 05 Dec 2011 11:51:29 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Hard disk broken]]></category>
		<category><![CDATA[RAID1]]></category>
		<category><![CDATA[recover broken hard disk]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=574</guid>

					<description><![CDATA[This scenario assumes that you have two hard disk with RAID1 setup and one of them is broken (say sdb). To check the status of RAID: $ cat /proc/mdstat Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md2 : active raid1 sda3[1] 730202368 blocks [2/1] [U_] md1 : active raid1 sda2[1] 264960 blocks [2/1] [U_] [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This scenario assumes that you have two hard disk with RAID1 setup and one of them is broken (say sdb).</p>
<p>To check the status of RAID:</p>
<p><code>$ cat /proc/mdstat</code></p>
<p><code>Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]<br />
md2 : active raid1 sda3[1]<br />
730202368 blocks [2/1] [U_]<br />
md1 : active raid1 sda2[1]<br />
264960 blocks [2/1] [U_]<br />
md0 : active (auto-read-only) raid1 sda1[1]<br />
2102464 blocks [2/1] [U_]</code></p>
<p>you will see [_U] or [U_] if there is a broken RAID.</p>
<p>If required remove the broken hardrive from RAID from all md devices.</p>
<p><code># mdadm --manage /dev/md0 --fail /dev/sdb1</p>
<p># mdadm --manage /dev/md1 --fail /dev/sdb2</p>
<p># mdadm --manage /dev/md2 --fail /dev/sdb3</code></p>
<p>Shutdown the machine and replace the hard drive.</p>
<p>Once the server is booted, you will see the new device (either sda or sdb depends on what drive is broken)</p>
<p><code># ls -l /dev/sd*</code></p>
<p>Now we need to replicate the partition schema on the new drive.</p>
<p><code>sfdisk -d /dev/sda | sfdisk /dev/sdb</code></p>
<p>// -d     Dump the partitions of a device</p>
<p>We can add the partition to the RAID now, you could verify the partitions with fdisk -l.</p>
<p><code># mdadm --manage /dev/md0 --add /dev/sdb1</p>
<p># mdadm --manage /dev/md1 --add /dev/sdb2</p>
<p># mdadm --manage /dev/md2 --add /dev/sdb3</code></p>
<p>It will start sync the data and will be ready once completed.</p>
<p>You may verify the mdstat</p>
<p><code># cat /proc/mdstat<br />
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]<br />
md2 : active raid1 sda3[0] sdb3[1]<br />
7302023 blocks [2/2] [UU]</p>
<p>md1 : active raid1 sda2[0] sdb2[1]<br />
2649 blocks [2/2] [UU]</p>
<p>md0 : active (auto-read-only) raid1 sda1[0] sdb1[1]<br />
21024 blocks [2/2] [UU]</code></p>
<p>./arun</p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/replace-broken-hard-drive-in-software-raid1/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
