<?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>techsquare.com &#187; TechSquare Inc. Cambridge MA.</title>
	<atom:link href="http://www.techsquare.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.techsquare.com</link>
	<description>Cambridge, MA</description>
	<lastBuildDate>Fri, 07 Oct 2011 17:11:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Upgrading hard drive capacity of a linux system</title>
		<link>http://www.techsquare.com/uncategorized/upgrading-hard-drive-capacity-of-a-linux-system</link>
		<comments>http://www.techsquare.com/uncategorized/upgrading-hard-drive-capacity-of-a-linux-system#comments</comments>
		<pubDate>Thu, 02 Jun 2011 14:03:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www2.techsquare.com/?p=154</guid>
		<description><![CDATA[There is obviously more than one way to clone a linux install, but here&#8217;s the way I used most recently, when upgrading a 500G RAID1 volume on a 3ware HBA to 2T. Fortunately, we had two free slots available, so &#8230; <a href="http://www.techsquare.com/uncategorized/upgrading-hard-drive-capacity-of-a-linux-system">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There is obviously more than one way to clone a linux install, but here&#8217;s the way I used most recently, when upgrading a 500G RAID1 volume on a 3ware HBA to 2T.</p>
<p>Fortunately, we had two free slots available, so we just inserted the new 2T drives into the free slots.  </p>
<li>Insert the new drives in the free slots [4 and 5].</li>
<li>Create the RAID1 volume with the twi_cli.  You may first have to rescan the bus with the &#8216;rescan&#8217; command.
<p>    <code>maint createunit c4 rraid1 p4:5</code></p>
</li>
<li>
Create partition table on the new device, in this case,</p>
<p><code>    sdb1	  /	    25G<br />
    sdb2	  swap	    12G<br />
    sdb3	  /home	    the rest</code>
</li>
<li>make file systems, mount points, and mount the partitions
<p><code>    mke2fs -j /dev/sdb1<br />
    mke2fs -j /dev/sdb3<br />
    mkswap /dev/sdb2<br />
    mkdir -p /mnt/new/root /mnt/new/root/home<br />
    mount /dev/sdb1 /mnt/new/root<br />
    mount /dev/sdb3 /mnt/new/root/home</code>
</li>
<li>Do the initial rsync, then just before switching, quiet the system and do it again.  The one bit of magic here is to <strong>preserve hard links</strong> [H], which linux systems are full of.
<p><code>    cd /<br />
    rsync -vrpoglHDt --exclude=/proc --exclude=/sys \<br />
          --exclude=/net --exclude=/tmp --exclude=/mnt/new \<br />
          --delete . /mnt/new/root<br />
</code><br />
   Here&#8217;s a key for the flags used above:<br />
<code><br />
        -v, --verbose               increase verbosity<br />
        -r, --recursive             recurse into directories<br />
        -p, --perms                 preserve permissions<br />
        -o, --owner                 preserve owner (super-user only)<br />
        -g, --group                 preserve group<br />
        -l, --links                 copy symlinks as symlinks<br />
        -H, --hard-links            preserve hard links<br />
        -D                          same as --devices --specials<br />
            --devices               preserve device files (super-user only)<br />
            --specials              preserve special files<br />
        -t, --times                 preserve modification times</code></p>
</li>
<li>Fix the permissions on /tmp
<p><code>    chmod 1777 /mnt/new/root/tmp</code></li>
<li>Write grub
<p><code>    grub-install --recheck --root-directory=/mnt/new/root /dev/sdb</code>
</li>
<li>Fix fstab so that it doesn&#8217;t use UUIDs [we can put those back after we get it booted happily off the new drives].  It&#8217;s probable that the UUIDs won&#8217;t change when we move the drives to the first two slots, but I didn&#8217;t test this.
</li>
<li>Reboot.</li>
<li>manually set root=/dev/sda1 at the grub prompt</li>
<li>after booting, find the new uuids with &#8216;blkid&#8217;, and modify /etc/fstab accordingly.</li>
<li>run &#8216;update-grub&#8217; to fix /boot/grub/grub.conf with the right uuids.</li>
<li>reboot again.</li>
<p>We also moved the two new 2T drives into slots 0 and 1, inserted a<br />
couple of spare 2T drives and used the tw_cli utility to assign those<br />
new drives as hot spares.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techsquare.com/uncategorized/upgrading-hard-drive-capacity-of-a-linux-system/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
