<?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>Index out of Bounds &#187; raid</title>
	<atom:link href="http://www.jonathanfritz.ca/tag/raid/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jonathanfritz.ca</link>
	<description>the personal portfolio of Jonathan Fritz</description>
	<lastBuildDate>Mon, 12 Dec 2011 03:22:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Setting up an LVM for Storage</title>
		<link>http://www.jonathanfritz.ca/linux/setting-up-an-lvm-for-storage</link>
		<comments>http://www.jonathanfritz.ca/linux/setting-up-an-lvm-for-storage#comments</comments>
		<pubDate>Sat, 02 Jan 2010 04:31:17 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[kubuntu]]></category>
		<category><![CDATA[logical volume]]></category>
		<category><![CDATA[logical volume manager]]></category>
		<category><![CDATA[lvcreate]]></category>
		<category><![CDATA[lvdisplay]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[mkfs]]></category>
		<category><![CDATA[mkfs.ext4]]></category>
		<category><![CDATA[multiple disks]]></category>
		<category><![CDATA[pvcreate]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[vgcreate]]></category>
		<category><![CDATA[vgdisplay]]></category>

		<guid isPermaLink="false">http://www.jonathanfritz.ca/?p=185</guid>
		<description><![CDATA[Recently, I installed Kubuntu on my PC. Under Windows, I had used RAID1 array to create a storage volume out of two extra 500GB hard drives that I have in my system. Under Linux, I&#8217;ve decided to try creating a 1TB LVM out of the drives instead. This should be visible as a single drive, [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, <a href="http://thelinuxexperiment.com/guinea-pigs/jon-f/going-linux-once-and-for-all/" target="_blank">I installed Kubuntu on my PC</a>. Under Windows, I had used RAID1 array to create a storage volume out of two extra 500GB hard drives that I have in my system. Under Linux, I&#8217;ve decided to try creating a 1TB LVM out of the drives instead. This should be visible as a single drive, and allow me to store non-essential media files and home partition backups on a separate physical drive, the better to recover from catastrophic failures with. The only problem with this plan: documentation detailing the process of creating an LVM is sparse at best.</p>
<p><strong>The Drive Situation</strong><br />
My machine contains the following drives, which are visible in the <strong>/dev</strong> directory:</p>
<ul>
<li> sdc: root drive that contains three partitions; 1, 2, and 5, which are my boot, root, and swap partitions respectively</li>
<li> sda: 500GB SATA candidate drive that I&#8217;d like to add to the LVM</li>
<li> sdb: 500GB SATA candidate drive that I&#8217;d like to add to the LVM</li>
</ul>
<p><strong>First Try</strong><br />
Coming from a Windows background, I began by searching out a graphical tool for the job. I found one in my repositories called system-config-lvm 1.1.4.</p>
<p style="text-align: center;"><a href="http://thelinuxexperiment.com/blog/wp-content/uploads/2009/12/Logical-Volume-Management.png"><img class="aligncenter" title="Logical Volume Management" src="http://thelinuxexperiment.com/blog/wp-content/uploads/2009/12/Logical-Volume-Management.png" alt="The graphical tool that I found to create LVMs" width="685" height="405" /></a></p>
<p>I followed the buttons in this tool and created a 1TB LVM spanning sda and sdb, then formatted it with ext3. The result of these steps was an uninitialised LVM that refused to mount at boot. In response, I wrote the following script to activate, mount, and assign permissions to the drive at boot:</p>
<blockquote><p>#!/bin/bash<br />
sudo whoami<br />
sudo lvchange -a y /dev/Storage/Storage<br />
sudo mount /dev/Storage/Storage /home/jon/Storage<br />
sudo chown jon /home/jon/Storage<br />
sudo chmod 777 /home/jon/Storage</p></blockquote>
<p>It worked about 50% of the time. Frustrated, I headed over to the #kubuntu IRC channel to find a better solution.</p>
<p><strong>Second Try<br />
</strong>On the #kubuntu channel, I got help from a fellow who walked me through the correct creation process from the command line. The steps are as follows:</p>
<ol>
<li><em>Create identical partitions on sda and sdb:</em>
<ol>
<li><strong>sudo fdisk /dev/sda</strong></li>
<li><strong>n</strong> to create a new partition on the disk</li>
<li><strong>p</strong> to make this the primary partition</li>
<li><strong>1</strong> to give the partition the number 1 as an identifier. It will then appear as sda1 under /dev</li>
<li>Assign first and last cylinders &#8211; I simply used the default values for these options, as I want the partition to span the entire drive</li>
<li><strong>t</strong> toggle the type of partition to create</li>
<li><strong>8e</strong> is the hex code for a Linux LVM</li>
<li><strong>w</strong> to write your changes to the disk. This will (obviously) overwrite any data on the disk</li>
<li>Repeat steps 1 through 8 for /dev/sdb</li>
<li>Both disks now have partition tables that span their entirety, but neither has been formatted (that step comes later).</li>
</ol>
</li>
<li><em>Make the partitions available to the LVM:</em>
<ol>
<li><strong>sudo pvcreate /dev/sda1</strong></li>
<li><strong>sudo pvcreate /dev/sdb1</strong></li>
<li>Notice that the two previous steps addressed the partitions sda1 and sdb1 that we created earlier</li>
</ol>
</li>
<li><em>Create the Volume Group that will contain our disks:</em>
<ol>
<li><strong>sudo vgcreate storage /dev/sda1 /dev/sdb1 </strong>will create the volume group that spans the two partitions sda1 and sdb1</li>
<li><strong>sudo vgdisplay /dev/storage</strong> queries the newly created volume group. In particular, we want the VG Size property. In my case, it is 931.52 GB</li>
</ol>
</li>
<li><em>Create a Logical Volume from the Volume Group:</em>
<ol>
<li><strong>sudo lvcreate -L $size(M or G) -n $name</strong> <strong>$path</strong> where <strong>$size</strong> is the value of the VG Size property from above (G for gigabytes, M for megabytes), <strong>$name</strong> is the name you&#8217;d like to give the new Logical Volume, and <strong>$path</strong> is the path to the Volume Group that we made in the previous step. My finished command looked like <strong>sudo lvcreate -L 931G -n storage dev/storage<br />
</strong></li>
<li><strong>sudo lvdisplay /dev/storage </strong>queries our new Logical Volume. Taking a look at the LV Size property shows that the &#8216;storage&#8217; is a 931GB volume.</li>
</ol>
</li>
<li><em>Put a file system on the Logical Volume &#8216;storage&#8217;:</em>
<ol>
<li><strong>sudo mkfs.ext4 -L $name -j /dev/storage/storage</strong> will put an ext4 file system onto the Logical Volume &#8216;storage&#8217; with the label <strong>$name</strong>. I used the label &#8216;storage&#8217; for mine, just to keep things simple, but you can use whatever you like. Note that this process takes a minute or two, as it has to write all of the inode tables for the new file system. You can use mkfs.ext2 or mkfs.ext3 instead of this command if you want to use a different file system.</li>
</ol>
</li>
<li><em>Add an fstab entry for &#8216;storage&#8217; so that it gets mounted on boot:</em>
<ol>
<li><strong>sudo nano /etc/fstab</strong> to open the fstab file in nano with root permissions</li>
<li>Add the line <strong>/dev/storage/storage    /home/jon/Storage       ext4    defaults        0       0</strong> at the end of the file, where all of the spaces are tabs. This will cause the system to mount the Logical Volume &#8216;storage&#8217; to the folder /home/jon/Storage on boot. Check out the <a href="http://en.wikipedia.org/wiki/Fstab" target="_blank">wikipedia article on fstab</a> for more information about specific mounting options.</li>
<li><strong>ctrl+x</strong> to exit nano</li>
<li><strong>y</strong> to write changes to disk</li>
</ol>
</li>
<li><em>Change the owner of &#8216;storage&#8217; so that you have read/write access to the LVM</em>
<ol>
<li><strong>sudo chown -R jon:jon /home/jon/Storage</strong> will give ownership to the disk mounted at /home/jon/Storage to the user &#8216;jon&#8217;</li>
</ol>
</li>
</ol>
<p><strong>Time for a Beer<br />
</strong>Whew, that was a lot of work! If all went well, we have managed to create a Logical Volume called storage that spans both sda and sdb, and is formatted with the ext4 file system. This volume will be mounted at boot to the folder Storage in my home directory, allowing me to dump non-essential media files like my music collection and system backups to a large disk that is physically separate from my system partitions.</p>
<p>The final step is to reboot the system, navigate to /home/jon/Storage (or wherever you set the boot point for the LVM in step 6), right-click, and hit <strong>properties</strong>. At the bottom of the properties dialog, beside &#8216;Device Usage,&#8217; I can see that the folder in question has 869GB free of a total size of 916GB, which means that the system correctly mounted the LVM on boot. Congratulations to me!</p>
<p>Much thanks to the user ikonia on the #kubuntu IRC channel for all the help.</p>
<p>This piece originally appeared at <a href="http://thelinuxexperiment.com/guinea-pigs/jon-f/setting-up-an-lvm-for-storage/" target="_blank">The Linux Experiment</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanfritz.ca/linux/setting-up-an-lvm-for-storage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going Linux, Once and for All</title>
		<link>http://www.jonathanfritz.ca/hardware/going-linux-once-and-for-all</link>
		<comments>http://www.jonathanfritz.ca/hardware/going-linux-once-and-for-all#comments</comments>
		<pubDate>Wed, 23 Dec 2009 17:12:01 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[amarok]]></category>
		<category><![CDATA[banshee]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dolphin]]></category>
		<category><![CDATA[fake raid]]></category>
		<category><![CDATA[gstreamer]]></category>
		<category><![CDATA[hard drive]]></category>
		<category><![CDATA[hardware raid]]></category>
		<category><![CDATA[installer]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[kubuntu]]></category>
		<category><![CDATA[kubuntu install]]></category>
		<category><![CDATA[linux experiment]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[raid1]]></category>
		<category><![CDATA[software raid]]></category>
		<category><![CDATA[virtual box]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.jonathanfritz.ca/?p=176</guid>
		<description><![CDATA[With the linux experiment coming to an end, and my Vista PC requiring a reinstall, I decided to take the leap and go all linux all the time. To that end, I&#8217;ve installed Kubuntu on my desktop PC. I would like to be able to report that the Kubuntu install experience was better than the [...]]]></description>
			<content:encoded><![CDATA[<p>With <a href="http://thelinuxexperiment.com/" target="_blank">the linux experiment</a> coming to an end, and my Vista PC requiring a reinstall, I decided to take the leap and go all linux all the time. To that end, I&#8217;ve installed <a href="http://www.kubuntu.org/" target="_blank">Kubuntu</a> on my desktop PC.</p>
<p>I would like to be able to report that the Kubuntu install experience was better than the Debian one, or even on par with a Windows install. Unfortunately, that just isn&#8217;t the case.</p>
<p>My machine contains three 500GB hard drives. One is used as the system drive, while an integrated hardware RAID controller binds the other two together as a RAID1 array. Under Windows, this setup worked perfectly. Under Kubuntu, it crashed the graphical installer, and threw the text-based installer into fits of rage.</p>
<p>With plenty of help from the #kubuntu IRC channel on freenode, I managed to complete the Kubuntu install by running it with the two RAID drives disconnected from the motherboard. After finishing the install, I shut down, reconnected the RAID drives, and booted back up. At this point, the RAID drives were visible from Dolphin, but appeared as two discrete drives.</p>
<p>It was explained to me via <a href="http://ubuntuforums.org/showthread.php?t=408461" target="_blank">this article</a> that the hardware RAID support that I had always enjoyed under windows was in fact a &#8216;fake RAID,&#8217; and is not supported on Linux. Instead, I need to reformat the two drives, and then link them together with a software RAID. More on that process in a later post, once I figure out how to actually do it.</p>
<p>At this point, I have my desktop back up and running, reasonably customized, and looking good. After trying KDE&#8217;s default <a href="http://amarok.kde.org/" target="_blank">Amarok</a> media player and failing to figure out how to properly import an m3u playlist, I opted to use <a href="http://banshee-project.org/" target="_blank">Gnome&#8217;s Banshee</a> player for the time being instead. It is a predictable yet stable iTunes clone that has proved more than capable of handling my library for the time being. I will probably look into Amarok and a few other media players in the future. On that note, if you&#8217;re having trouble playing your MP3 files on Linux, check out <a href="http://ubuntuforums.org/showpost.php?p=6312079&amp;postcount=3" target="_blank">this post</a> on the ubuntu forums for information about a few of the necessary GStreamer plugins.</p>
<p>For now, my main tasks include setting up my RAID array, getting my ergonomic bluetooth wireless mouse working, and working out folder and printer sharing on our local Windows network. In addition, I would like to set up a Windows XP image inside of <a href="http://www.virtualbox.org/" target="_blank">Sun&#8217;s Virtual Box</a> so that I can continue to use Microsoft Visual Studio, the only Windows application that I&#8217;ve yet to find a Linux replacement for.</p>
<p>This is just the beginning of the next chapter of my own personal Linux experiment; stay tuned for more excitement.</p>
<p>This post was mirrored at <a href="http://thelinuxexperiment.com/guinea-pigs/jon-f/going-linux-once-and-for-all/" target="_blank">The Linux Experiment</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanfritz.ca/hardware/going-linux-once-and-for-all/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

