<?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>Frank Groeneveld &#187; striping</title>
	<atom:link href="http://frankgroeneveld.nl/tag/striping/feed/" rel="self" type="application/rss+xml" />
	<link>http://frankgroeneveld.nl</link>
	<description>Just another weblog</description>
	<lastBuildDate>Tue, 20 Dec 2011 08:59:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Howto: Live migrate to software RAID 1</title>
		<link>http://frankgroeneveld.nl/2009/09/19/howto-live-migrate-to-software-raid-1/</link>
		<comments>http://frankgroeneveld.nl/2009/09/19/howto-live-migrate-to-software-raid-1/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 14:22:54 +0000</pubDate>
		<dc:creator>Frank Groeneveld</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[degraded]]></category>
		<category><![CDATA[jaunty]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[software raid]]></category>
		<category><![CDATA[striping]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://techfield.org/?p=120</guid>
		<description><![CDATA[Feel insecure about your data? Don't trust your harddrive anymore? Use this howto to migrate your running Ubuntu Linux system to software RAID&#160;1.

Before starting off, I assume you have your running system on /dev/sda and your new harddrive is ...]]></description>
			<content:encoded><![CDATA[<p>Feel insecure about your data? Don't trust your harddrive anymore? Use this howto to migrate your running Ubuntu Linux system to software RAID&nbsp;1.</p>
<p>Before starting off, I assume you have your running system on /dev/sda and your new harddrive is called /dev/sdb.</p>
<p>Boot up your system and install the mdadm package. We now have to create partitions on sdb that are the same as sda. Because I have identical disks, I just copy the partition table from sda to sdb like so:<br />
<code>sfdisk -d /dev/sda | sfdisk /dev/sdb</code><br />
After that, I use partprobe to let the Linux kernel know I have changed the partition table.</p>
<p>Next step is to create a degraded RAID array on sdb which we can copy the files to and than add sda to the array. For every partition you have to run:<br />
<code>mdadm --create /dev/md0 --level 1 --raid-devices=2 missing /dev/sdb1<br />
</code><br />
Where you replace sdb1 with the partition you want. Now create filesystems on these new raid devices:<br />
<code>mkfs.ext3 /dev/md0</code><br />
Again, run this for all your mds.<br />
After copying all the files to your new array, we have to modify a few files.</p>
<ul>
<li>/boot/grub/menu.lst</li>
<li>/etc/fstab</li>
<li>/etc/initramfs-tools/conf/resume</li>
</ul>
<p>All these files contain references to UUIDs that are no longer correct. I simply replaced them with /dev/md0 for example. You can try to use UUIDs, but I believe that the (striped) partitions have the same UUIDs as the raid devices (the mds). If you've changed everything, run:<br />
<code>mdadm --detail --scan &gt;&gt; /etc/mdadm/mdadm.conf</code><br />
And don't forget to update your initrd:<br />
<code>initramfs -u</code></p>
<p>That's all! You can now enjoy the safety of RAID 1 without to much hassle. To check the status of your array, look in /proc/mdstat. Also make sure you setup a mail server or ssmtp, because the mdadm tools will try to send you an email if one of your RAID devices is degraded/corrupt.</p>
<p class="wp-flattr-button"></p>]]></content:encoded>
			<wfw:commentRss>http://frankgroeneveld.nl/2009/09/19/howto-live-migrate-to-software-raid-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

