<?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/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Cyberward.net &#187; server</title>
	<atom:link href="http://www.cyberward.net/blog/tag/server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyberward.net/blog</link>
	<description>The Drive Failures and Shutter Clicks of Christopher Ward</description>
	<lastBuildDate>Wed, 21 Jul 2010 12:00:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setting up Linux Software Raid</title>
		<link>http://www.cyberward.net/blog/2009/05/setting-up-linux-software-raid/</link>
		<comments>http://www.cyberward.net/blog/2009/05/setting-up-linux-software-raid/#comments</comments>
		<pubDate>Sat, 30 May 2009 12:00:55 +0000</pubDate>
		<dc:creator>Chris Ward</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.cyberward.net/blog/?p=973</guid>
		<description><![CDATA[This is part of our series on building a NAS. In this article we will get the box set up with a static IP address, and get your drives set up for RAID 1.
We are assuming that at this point you have Ubuntu installed. We are gong to install software raid in a moment. The [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1204" title="Dual Drives for Raid 1" src="http://www.cyberward.net/blog/wp-content/uploads/dualdrive.jpg" alt="Dual Drives for Raid 1" width="329" height="173" />This is part of our series on building a NAS. In this article we will get the box set up with a static IP address, and get your drives set up for RAID 1.</p>
<p>We are assuming that at this point you have Ubuntu installed. We are gong to install software raid in a moment. The first thing I want to do is make sure we have a static ip address. Usually Ubuntu will start up with a dynamic ip address. This can make it more difficult to transfer files to this box, so lets make it static.<br />
<span id="more-973"></span></p>
<h3>Setting a static IP address</h3>
<p>Type ifconfig eth0, and you will see your current address.</p>
<p>Lets make it static. Note, typing sudo in front of commands lets you assume the privileges of the administrator, or super user.</p>
<pre class="linux">sudo nano /etc/network/interfaces</pre>
<p>We will replace the text there with this text, which will assign 10.0.0.50 to our server, and assume the gateway is at 10.0.0.1:</p>
<pre class="linux">auto eth0
iface eth0 inet static
address 10.0.0.50
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1</pre>
<p>restart the network to get the new settings :</p>
<pre class="linux">sudo /etc/init.d/networking restart</pre>
<p>ifconfig eth0 and you should see the new settings.</p>
<p>If you want to see a whole lot more networking commands, see <a href="http://www.cyberciti.biz/tips/howto-ubuntu-linux-convert-dhcp-network-configuration-to-static-ip-configuration.html">here</a>.</p>
<h3>Finding out drives</h3>
<p>Great. Now before we can put two drives into a RAID 1 array, we need to tell linux what drives we are going to use for this.</p>
<p>How do we know what disks? I just type dmesg. This will scroll lots of stuff down the screen. If you are in the GUI at a terminal you can scroll. Otherwise type dmesg | less which will let you move through the text with the cursor keys.</p>
<p>This is all the hardware that was found and initialized. You will first see the ataX with X being the number of the drive. You need to look for a section after this that has letters like hda or sda. The drives I am using are SATA drives and they are <strong>sda</strong> and <strong>sdb</strong>. I could tell by the size of the drives. (press Q to exit less if you need to)</p>
<h3>Partition¬†for Raid 1</h3>
<p>Ok, lets tell Linux that we want those drives to be used for raid.</p>
<pre class="linux">sudo fdisk /dev/sda</pre>
<p>[p] will list the partitions. If you had one previously, you will see it. Remove them. Press d for delete, then give a partition number. (no need if you only had one)</p>
<p>Now add a [n]ew [p]rimary partition number [1] with default start and end (the whole disk)</p>
<pre class="linux">n [enter] p [enter] 1 [enter][enter][enter]</pre>
<p>Now [p] again to verify that the partition is there. Note the type: 83. Type [l] to see all the types. We need to set the type to fd for Linux software raid.</p>
<pre class="linux">t [enter] fd [enter]</pre>
<p>Now write the partition table and exit: w [enter]</p>
<p>Now we repeat the process with the other drive.</p>
<pre class="linux">sudo fdisk /dev/sdb</pre>
<p>And repeat the fdisk commands.</p>
<h3>Setting up mdadm for Raid1</h3>
<p>Ok, now for Linux software raid. First we need to install it.</p>
<pre class="linux">sudo apt-get install mdadm</pre>
<p>When I did this, I was prompted that citadel-server was being installed. This is what is used by default as the mail server. Mdadm is dependant on a mail server so it can mail you of failures. Pick an admin user and say no to external auth.</p>
<p>Once installed you can build an array. I am going to use two drives in a RAID 1, mirrored setup. This duplicates all the data on both drives. They are mirrored. This is the command with my drives used. You will substitute for your devices:</p>
<pre class="linux">sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1</pre>
<p>This should tell you that the array /dev/md0 has started.</p>
<p>If you would like to see when the array is built:</p>
<pre class="linux">cat /proc/mdstat</pre>
<p>This will tell you how long it will take, or if it is done.</p>
<p>Ok, that&#8217;s it for now.¬† We will look at commands to manipulate the array in a later article in the series. Next up will be creating the resizable volumes on the array using LVM.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberward.net/blog/2009/05/setting-up-linux-software-raid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Building a NAS]]></series:name>
	</item>
		<item>
		<title>I need more space.</title>
		<link>http://www.cyberward.net/blog/2008/05/i-need-more-space/</link>
		<comments>http://www.cyberward.net/blog/2008/05/i-need-more-space/#comments</comments>
		<pubDate>Fri, 30 May 2008 00:39:21 +0000</pubDate>
		<dc:creator>Chris Ward</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.cyberward.net/blog/?p=16</guid>
		<description><![CDATA[So after I talked about my backup strategy, I went and started my command to sync my pictures. I went to checkup on it, and it was stuck. I checked, and I was out of space. Oh oh. I stopped the sync. Now what? Well, the drives are sporting LVM2, and I had extra space [...]]]></description>
			<content:encoded><![CDATA[<p>So after I talked about my backup strategy, I went and started my command to sync my pictures. I went to checkup on it, and it was stuck. I checked, and I was out of space. Oh oh. I stopped the sync. Now what? Well, the drives are sporting LVM2, and I had extra space available, so I just added some.</p>
<p>First add some more space to the volume:<br />
# lvextend -L +1G /dev/vgnas/pictures</p>
<p>Then tell ext3 about the extra space.<br />
# resize2fs /dev/vgnas/pictures</p>
<p>Thats it. I did it live, without unmounting. I then went back to my rsync command, and it continued right where it left off. Sometimes I really like linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cyberward.net/blog/2008/05/i-need-more-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
