<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>The Art of Tech</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.gurulabs.com/lamont/atom.xml" />
    <id>tag:blogs.gurulabs.com,2009-02-24:/lamont//8</id>
    <updated>2008-01-28T23:05:46Z</updated>
    <subtitle>Useful tidbits from Guru Labs Instructor, Lamont Peterson.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.23-en</generator>

<entry>
    <title>Root Filesystem Conversion</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2007/03/root-filesystem.html" />
    <id>tag:blogs.gurulabs.com,2007:/lamont//7.208</id>

    <published>2007-03-07T00:23:10Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>Ed: This post was originally written on 2006/08/03, but for some reason I missed publishing it. As I believe the information is useful, I&apos;m publishing it now. On my home workstation, I used LVM for the one 160GB hard drive....</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p><i>Ed: This post was originally written on 2006/08/03, but for some reason I missed publishing it. As I believe the information is useful, I'm publishing it now.</i></p>

<p>On my home workstation, I used LVM for the one 160GB hard drive. When I first built the box (in May of 2004), I installed <a href="http://fedora.redhat.com/">Fedora Core</a> 2 for x86_64; it's a dual <a href="www.amd.com/">AMD</a> <a href="http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_8826,00.html">Opteron</a> 242 (1.6GHz). I created four partitions:</p>
<ol>
<li>100MB <code>/boot/</code></li>
<li>2GB swap (there's 1GB RAM, but I can expand to 8GB)</li>
<li>remainder (~96GB) LVM</li>
<li>60GB Windows XP Professional</li>
</ol>

<p>For a couple of weeks, I have been unable to install any updates to FC5. When I run <code>yum update</code>, I get a series of error messages telling me that yum needs additional disk space on the root partition in order to install packages. Strangely enough, almost none of those packages have files that end up in the root partition.</p>

<p>The root filesystem was a 512MB ext3 LVM logical volume. Sure, I could make it bigger, but I shouldn't have to. In fact, I should be able to have it be only about 256MB and still have a completely usable system. I have <code>/home/</code>, <code>/tmp/</code>, <code>/usr/</code>, <code>/var/</code> and even <code>/opt/</code> all split off onto their own LVs, so there's not that much stuff left on the root volume. In fact, running <code>du -sx /</code> shows that there is just barely 200MB of data present. However, running <code>df /</code> shows that it is 99% full (about 508MB used). Clearly, ext3 is not an efficient choice for a root partition when the bulky filesystems are split out like this.</p>

<p>So, I decided to "convert" to another filesystem type. I chose to use XFS for the root volume. Converting the root partition can be a little bit tricky, as the initrd needs to have the right drivers to work with it. Here's my step-by-step (assuming that the volume group is named <code>system</code>):</p>

<ol>
<li>Create a new volume and format it with the new filesystem type (the size could be smaller, if desired):
<pre>
# <b>lvcreate -L 512MB -n newroot system</b>
# <b>mkfs.xfs /dev/system/newroot</b>
</pre>
</li>
<li>Mount the new root volume and remount the current root volume read-only:
<pre>
# <b>mkdir /mnt/temp</b>
# <b>mount /dev/system/newroot /mnt/temp/</b>
# <b>mount -o remount,ro /</b>
</pre>
</li>
<li>Copy the contents of just the root volume to the new root volume (the <code>-x</code> switch is <em>very</em> important):
<pre>
# <b>cp -ax /* /mnt/temp/</b>
</pre>
</li>
<li>Unmount the new root volume:
<pre>
# <b>umount /mnt/temp/</b>
</pre>
</li>
<li>Run <code><b>uname -r</b></code> and record the value. This will be needed later when running <code>mkinitrd</code>.</li>
<li>Reboot the system into a rescue environment. In order to be able to boot with the new root partition, it is necessary to recreate the initrd. You could hand edit the existing one(s) to fix things up, but this will be quite a bit easier. Use a CD or a network bootable rescue environment for your distro (FC5 in my case).</li>
<li>If you let the setup for the rescue environment mount your partitions/volumes, that's fine, just make sure to unmount everything so you can switch root partitions. If you don't let it mount up the parts, that's fine too; just use the LVM commands for your rescue environment to activate LVM.</li>
<li>Rename the old root volume out of the way and rename the new one into place (this only works while the volumes are not mounted):
<pre>
# <b>lvrename system root oldroot</b>
# <b>lvrename system newroot root</b>
</pre>
<li>Mount the (new) root volume and at least <code>/boot/</code> and <code>/usr/</code> on top of that:</li>
<pre>
# <b>mkdir /mnt/system/</b>
# <b>mount /dev/system/root /mnt/system/</b>
# <b>mount /dev/sda1 /mnt/system/boot/</b>
# <b>mount /dev/system/usr /mnt/system/usr/</b>
</pre>
<li>It's time to recreate the initrd. This is easiest when done <code>chroot</code>'ed into the system environment found on your hard drive (assuming your new root volume was mounted at <code>/mnt/system/</code>):
<pre>
# <b>chroot /mnt/system/</b>
</pre>
</li>
<li>Run <code>mkinitrd</code>. Depending on which distribution is installed, this could require quite a different set of switches than what I'm showing you here. In my case, it was Fedora, so I used the <code>mkinitrd</code> command found in the <code>/sbin/new-kernel-pkg</code> script, which is run as part of the post-install scripts from every Red Hat kernel RPM (just open up <code>/sbin/new-kernel-pkg</code> and find the right command to run, replacing "<code><i>something</i></code>" with the correct kernel version string recorded earlier from the <code>uname -r</code> command):
<pre>
# <b>/sbin/mkinitrd --allow-missing -f /boot/initrd-2.6.<i>something</i> 2.6.<i>something</i></b>
</pre>
</li>
<li>Leave the <code>chroot</code> environment and unmount everything (yes, if you just cleanly exit the rescue environment, it should cleanly unmount everything, but let's just be sure it happens right, shall we?):
<pre>
# <b>exit</b>
# <b>umount /mnt/system/usr/</b>
# <b>umount /mnt/system/boot/</b>
# <b>umount /mnt/system/</b>
</pre>
</li>
<li>Reboot. The system should come up with your root volume in use with a new filesystem type.
</ol>

<p>That's it. That wasn't so difficult, was it?</p>

<p>The entire thing could be done from within the rescue environment, including copying the contents of the root volume to the new root volume, if you like.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Windows NTP Client</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2007/03/windows-ntp-cli.html" />
    <id>tag:blogs.gurulabs.com,2007:/lamont//7.234</id>

    <published>2007-03-06T18:06:23Z</published>
    <updated>2008-01-28T23:05:47Z</updated>

    <summary>I&apos;ve had a Network Time Protocol (NTP) server running in my home network for many years. The two workstation dual boot Windows and Linux. When running Linux, the ntpd daemon keeps them in sync with my NTP server. When running...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>I've had a <a href="http://en.wikipedia.org/wiki/Network_Time_Protocol">Network Time Protocol (NTP)</a> server running in my home network for many years. The two workstation dual boot Windows and Linux. When running Linux, the ntpd daemon keeps them in sync with my NTP server. When running Windows, I haven't bothered, as there isn't anything running under windows that cares about time at all, and since they run Linux most of the time.</p>

<p>Today, I decided to figure out how to keep Windows client's clock synchronized with NTP. A quick Google search located an <a href="http://www.nist.gov/">NIST</a> PDF document titled, "<i><a href="http://tf.nist.gov/service/pdf/win2000xp.pdf">Configuring Windows 2000 and Windows XP to use NIST Time Servers</a></i>." There is also a link in the introductory pages of that document to the freely available download from Microsoft to enable Windows NT systems to be configured as NTP clients.</p>

<p>As it turns out, it's really easy to configure Windows 2000 and Windows XP Professional, as they both have native, out-of-the-box support to run as a NTP clients. So, to boil down the NIST's 12 page document, open a "DOS prompt" command shell as a user with admin rights and run:</p>

<pre>
> <b>net /setsntp:<i>servername</i></b>
> <b>net stop w32time</b>
> <b>net start w32time</b>
</pre>

<p>That's it.</p>

<p>You could also use the Time/Date control panel. When I tried it (first) on one of my boxes, it had the default configuration of using a Microsoft time server already configured. When I changed it in that dialog box to use my time server, it griped that it wouldn't use the time I was providing as the server's stratum was <i>lower</i> than the host's. I wonder what goofy things Microsoft's time server is doing, as my time server is stratum 2. Anyway, I ran those three commands and it successfully switched over to using my NTP server.</p>

<p>You would think that the fact that Windows 2000 and Windows XP have the NTP client built-in would be one of those things that I would have already "just known." Well, I didn't, but now I do.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Adobe Flashplayer 9 for Linux Installed</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2007/02/adobe-flashplay.html" />
    <id>tag:blogs.gurulabs.com,2007:/lamont//7.232</id>

    <published>2007-02-09T17:40:39Z</published>
    <updated>2008-01-28T23:05:47Z</updated>

    <summary>About three weeks ago, I ran rug update on my notebook (II&apos;m mainly using openSUSE 10.2) and got the Adobe Flashplayer 9 for Linux update installed. That was easy. I last checked about 12 days ago, but there wasn&apos;t an...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>About three weeks ago, I ran <code>rug update</code> on my notebook (II'm mainly using <a href="http://www.opensuse.org/">openSUSE</a> 10.2) and got the <a href="http://www.adobe.com/">Adobe</a> <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW">Flashplayer</a> 9 for Linux update installed.</p>

<p>That was easy.</p>

<p>I last checked about 12 days ago, but there wasn't an RPM for <a href="http://fedora.redhat.com/">Fedora</a> Core 6 (the current release), available yet.</p>]]>
        
    </content>
</entry>

<entry>
    <title>DHCP, VoIP &amp; Updated Kernel</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/09/dhcp-voip-updat.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.224</id>

    <published>2006-09-06T04:46:52Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>Yesterday, I was working on a new DNS server I was setting up for someone, when I noticed that I hadn&apos;t setup rndc on my home DNS server. After fixing that, I added a couple of zones to my home...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>Yesterday, I was working on a new <a href="http://en.wikipedia.org/wiki/Domain_name_system">DNS</a> server I was setting up for someone, when I noticed that I hadn't setup <code>rndc</code> on my home DNS server. After fixing that, I added a couple of zones to my home DNS server to have it serve (for now) as the secondary server for some new domains, but the zone transfers weren't working. It was immediately obvious that I needed to alter the firewall configuration to allow the DNS server to initiate zone transfers, so I ended up looking at a couple parts of my firewall configuration.</p>

<p>It was an easy change, but in the course of all of this, I had made a typo that caused me a problem with one of my VLAN connections. When I tried to bring the link down so I could reinitialize it with some fixed configuration, it hung. Running <code>kill -9</code> didn't work, so I decided to just reboot. It had been several months since my last boot and there was a newer kernel that I wanted to be using, anyway, so it wasn't a big deal.</p>

<p>But then, <a href="http://en.wikipedia.org/wiki/DHCP">DHCP</a> (which is on the same box) no longer worked. I double-checked that <code>dhcpd</code> was running, did a little sniffing and discovered that the DHCP segments weren't actually getting past the firewall configuration. This is odd, since a <a href="http://www.netfilter.org/">Netfilter firewall</a> configuration that is completely locked down (i.e. a policy of <code>DROP</code> on all built-in chains and no rules) has always still permitted DHCP traffic to get through. However, I decided to add a couple of rules to the firewall, such as:</p>

<pre>-A INPUT -p udp --sport 68 --dport 67 -m state --state new -j ACCEPT</pre>

<p>With those new DHCP rules loaded up, it started working again. It would appear that the latest kernel for <a href="http://www.redhat.com/rhel/">Red Hat Enterprise Linux</a> 4 and <a href="http://www.centos.org/">CentOS</a> 4 (which that server runs), has made a change in Netfilter so that it now affects DHCP renewals.</p>

<p>Perhaps a little explanation of DHCP is order, here (skip down a little if you already know this part, in order to get the rest of the story).</p>]]>
        <![CDATA[<p>When a device has no <a href="http://en.wikipedia.org/wiki/Layer_3">Layer 3</a> configuration, a DHCP client has to form the initial <a href="http://en.wikipedia.org/wiki/User_Datagram_Protocol">UDP</a> datagram (which carries the DHCP request, itself) directly within a <a href="http://en.wikipedia.org/wiki/Layer_2">Layer 2</a> frame (usually <a href="http://en.wikipedia.org/wiki/Ethernet">Ethernet</a>). This is (obviously, to those of you who know about how the network stack works) odd, as you almost never "skip" any layers when forming a packet to send out.</p>

<p>OK. So, this initial DHCP setup works fine, even under the newer kernel. The DHCP server's firewall was allowing this in. What happened was that my notebook had reached the end of the lease time for the DHCP lease that I had, but I didn't have any rules to allow DHCP on UDP on IP, which is what happens when your DHCP client is trying to renew the lease for the IP addresses you are already using. What I experienced was that my notebook suddenly had no working network configuration, but if I stopped the DHCP client and had it start again from scratch, it worked.</p>

<p>The fix for all of that was to add rules in the firewall that allowed DHCP much like I allow web browsing, email or <a href="http://www.worldofwarcraft.com/">World of Warcraft</a> to go through.</p>

<p>"OK, Lamont; I'm following you so far, but what does that have to do with <a href="http://en.wikipedia.org/wiki/VoIP">VoIP</a>? Remember, you mentioned that in the title to this article?" "Why, yes; I remember and we're now going to connect that dot."</p>

<p>Back to our regularly scheduled programming.</p>

<p>So, in changing my firewall configuration, I did not add any rules to allow DHCP renewals from the outside interface of my firewall. That one is connected to my DSL router, which has a 4-port switch built in. My <a href="http://www.vonage.com/">Vonage</a> VoIP box is also connected to the DSL router's built-in switch. Previously, it was being configured by my DHCP server, but no more. In the early evening yesterday, I noticed that my phones were getting no dial-tone. As I was working on some other things, I only gave it a cursory look.</p>

<p>This morning was when it finally dawned on me as to what I had done that had killed the Vonage box; I had taken away it's IP configuration. Another notebook that I plugged into the Vonage box's 4-port switch in order to configure it was also unable to do DNS lookups.</p>

<p>Well, after getting home this evening (<a href="http://blog.gurulabs.com/dax/">Dax</a> and I went to the <a href="http://www.utaug.org/">Utah Asterisk User Group</a> meeting this evening), I spent a few minutes configuring static routes on my firewall, the DSL router and the Vonage device, plus setting up static networking and turning off NAT on the Vonage box, everything is working again. Perhaps you'll think I have too many subnets here at home (what? you don't use 4 subnets for 2 people with 8 computers? :) hehe), but I like it. Oh, and in case you're wondering, the only SNAT I'm doing is on the DSL router, so I'm really using routed subnets with all these devices with built-in 4-port switches.</p>

<p>To make a long story short (too late!), I learned that the newest RHEL4/C4 kernels have a change to Netfilter that affects DHCP, and I refined the configuration of my networks. Hopefully, you won't end up pulling the trigger while this particular gun is pointed at your foot. :) Good luck!</p>]]>
    </content>
</entry>

<entry>
    <title>Why Code Must be Tested</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/08/why-code-must-b.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.221</id>

    <published>2006-08-28T19:41:50Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>I received an email this morning from U.S. Airways, updating me on my mileage status. Here&apos;s a clipping from it: Account Balance Update Dear LAMONT R PETERSON, Tier Level: {% if ( = &quot; &quot; ) %}Dividend Miles{% endif %}...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Programming" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>I received an email this morning from <a href="http://www.usair.com/">U.S. Airways</a>, updating me on my mileage status. Here's a clipping from it:</p>

<blockquote>Account Balance Update

<p>Dear LAMONT R PETERSON,</p>

<p>Tier Level: {% if (  = " " ) %}Dividend Miles{% endif %} {% if (  = "S" ) %}Silver Preferred{% endif %} {% if (  = "G" ) %}Gold Preferred{% endif %} {% if (  = "P" ) %}Platinum Preferred{% endif %} {% if (  = "C" ) %}Chairman's Preferred{% endif %} <br />
Dividend Miles #: 1234567890</p>

<p>Welcome to the new Dividend Miles:</p>

<p>You now have access to over 842 worldwide destinations at your fingertips and mileage-earning opportunities with over 100 partners such as hotels, rental car and financial service companies, just to name a few.</p>

<p><code>. . . snip . . .</code><br />
</blockquote></p>

<p>Apparently, the marketing department gets more proofreading resources than the programmers.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Yum GPG Keys</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/08/yum-gpg-keys.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.210</id>

    <published>2006-08-04T16:29:12Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>I forgot to mention the use of GPG keys with yum in my recent post about using the mplug repository to install Adobe Flash Player. In the .repo file for the mplug Yum repository, there are two lines about GPG;...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>I forgot to mention the use of GPG keys with <code>yum</code> in my <a href="http://blogs.gurulabs.com/lamont/archives/2006/07/macromedia_flas.html">recent post</a> about using the <a href="http://macromedia.mplug.org/">mplug</a> repository to install <a href="http://www.adobe.com/">Adobe</a> <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Flash Player</a>.</p>

<p>In the <code>.repo</code> file for the mplug Yum repository, there are two lines about GPG; <code>gpgcheck=1</code> turns on the feature that GPG signatures must be present and valid for packages downloaded from that repo or <code>yum</code> will not install them. <code>gpgkey=http://macromedia.mplug.org/FEDORA-GPG-KEY</code> provides the location where the GPG key file can be found. Simply download the key and run <code><b>rpm --import FEDORA-GPG-KEY</b></code> (as root, of course) to install the key into RPM.</p>

<p>There is older documentation on the Internet that will tell you to run <code><b>gpg --import <i>keyfile</i></b></code> either prior to or in stead of <code><b>rpm --import <i>keyfile</i></b></code>. That's for way older versions of RPM and no longer applies; it is only necessary (and desireable) to install the key into RPM.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Macromedia Flash 9 for Linux</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/08/macromedia-flas-1.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.209</id>

    <published>2006-08-04T15:45:11Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>In a recent post of mine, I talked about using the mplug yum repository to install the Adobe Flash Player web browser plugin (Adobe bought Macromedia in 2005). I also talked a little about the future of Flash Player on...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>In a <a href="http://blogs.gurulabs.com/lamont/archives/2006/07/macromedia_flas.html">recent post of mine</a>, I talked about using the <a href="http://macromedia.mplug.org/">mplug</a> yum repository to install the <a href="http://www.adobe.com/">Adobe</a> <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Flash Player</a> web browser plugin (Adobe <a href="http://www.adobe.com/aboutadobe/invrelations/adobeandmacromedia.html">bought Macromedia</a> in 2005).</p>

<p>I also talked a little about the future of Flash Player on Linux. The main thing is that Flash 8 will probably never come to Linux, but 8.5 would. Today, I came across <a href="http://weblogs.macromedia.com/emmy/archives/2006/05/yes_virginia_th.cfm">this post</a> by <a href="http://weblogs.macromedia.com/emmy/">Emmy Huang</a> which talks about Flash Player 9 for Linux. There should be a Linux beta late this year for public testing with the final release sometime in early 2007, according to Huang.</p>

<p>Also, there is a new <a href="http://blogs.adobe.com/penguin.swf/">Penguin.SWF</a> blog at Adobe, run my "Mike M." Go there for all the latest on Flash for Linux.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Old Hard Drive: R.I.P.</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/07/old-hard-drive-1.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.206</id>

    <published>2006-07-25T16:44:34Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>the 45GB drive is now sitting in the target pile, waiting for the next target shooting outing and the 120GB drive is going to be an online backup store in the file server. That leaves me with only 299GB of storage on my file server.

How will I ever get by? :)</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Equipment" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>Well, it finally happened. Over this past weekend, while <a href="http://blogs.gurulabs.com/lamont/archives/2006/07/the_lvm_advanta.html#more">working to finish migrating data from a failing drive to a new one</a>, I found the end of the rope. I have been unable to recover enough data from the old drive to be able to do anything useful with it and since it was still part of the LVM Volume Group (or VG), the problems it was causing were just too much to deal with.</p>

<p>So, I wiped all of the hard drives for the <code>data</code> VG. I am rebuilding everything from my backups. Ha, I'm sure I got some of you. You thought that perhaps I was going through all those gyrations trying to save my data because I didn't have any backups. Well, I think I'm a little smarter than that :) .</p>

<p>Seriously, though, I had backed up all the stuff that would be difficult to replace/reconstruct as well as all the irreplaceable data. I had things like several Linux distributions' files and .iso images, to make it easy to burn discs and to do network installs (either whole installs or just to have the packages handy). There were mirrors of updates and other software. All of that is easy to replace, though, so I didn't bother backing it up.</p>

<p>The next thing I would like to do for my file server is to pick up another 320GB drive so that I can pair it with the one I have now and migrate everything into an LVM on RAID1 set. Later, I'll add more 320GB drives and convert the RAID1 to RAID5 or RAID6. In the meantime, the 45GB drive is now sitting in the target pile, waiting for the next target shooting outing and the 120GB drive is going to be an online backup store in the file server. That leaves me with only 299GB of storage on my file server.</p>

<p>How will I ever get by? :)</p>]]>
        
    </content>
</entry>

<entry>
    <title>The LVM Advantage: Migrating Data</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/07/the-lvm-advanta.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.204</id>

    <published>2006-07-18T05:15:25Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>It&apos;s very nice to have access to all of my data while I&apos;m upgrading my storage system. There isn&apos;t even a performance penalty for other I/O ...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Equipment" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>The Linux Logical Volume Management system (LVM) is a wonderful piece of technology. In a nutshell, you take disparate storage devices and place them under the control of LVM in a container called a Volume Group (or VG for short). You can then create Logical Volumes (or LV for short) in the VG, which can be formatted, mounted and used, just like any block device. The LVM code will manage everything.</p>

<p>Sometimes, when I'm first introducing students to LVM, they ask me something like, "Why would I ever want to do this? Add an extra layer of complexity and overhead, just to get some fancy looking partitions? No thanks; I'll stick to plain partitions."</p>

<p>First of all, LVM is <i>very</i> efficient, introducing almost zero overhead for most normal operations. Yes, there is a little, but it can be difficult to meassue, let alone notice. Second, there are many irritating storage management tasks that are downright child's play to accomplish with LVM in place but quite difficult with just plain partitions.</p>]]>
        <![CDATA[<p>For example, you can add additional storage and move existing data into it, clearing out old devices without having to shut anything down. Let your programs and users continue to access and manipulate the data. In most cases, they won't even be able to tell your moving stuff to a new hard drive. Of course, if your system doesn't support hot-plugging of new hard drives, you will have to power down to add the drive physically to the system and again to remove (an) old one(s).</p>

<p>This is the case with my home file server, so I shut it down to add the new drive (read my recent posts to learn about that adventure). But while I'm moving the data, the entire system is running and available as normal. I can read and write data all over my LVM LVs without worry.</p>

<p>Here's the sequence of events:<ol><br />
<li>Insert new drive into the system; If you couldn't hot-swap, boot it back up</li><br />
<li>Get to a <code>root</code> shell and create an LVM partition on the new drive (that's partition type 0x8E)</li><br />
<li>Run <code>pvcreate /dev/<i>sdb1</i></code> (change <code>/dev/sdb1</code> to the correct device, of course)</li><br />
<li>Add the new storage to the VG of your choice (they can only be in one VG) by running <code>vgextend <i>vg0</i> /dev/<i>sdb1</i></code> (change <code>vg0</code> to an appropriate value)</li><br />
<li>Enjoy your expanded storage!</li></ol></p>

<p>OK. In my case, I want to move everything from all old drives to the one new one, so I'll use a special form of the <code>pvmove</code> command. If I wasn't going to be removing all of the existing devices and was keeping more than just the one drive, I <strong>would not</strong> specify the second parameter to <code>pvmove</code>. Here is the output from my running of them: :</p>

<pre># <code><b>time pvmove /dev/hde2 /dev/sda1</b></code>
  /dev/hde2: Moved: 0.3%
  /dev/hde2: Moved: 0.7%
  /dev/hde2: Moved: 1.0%
  /dev/hde2: Moved: 1.4%
  /dev/hde2: Moved: 1.7%
  /dev/hde2: Moved: 2.1%
. . . snip . . .
real    72m23.484s
user    0m4.812s
sys     0m4.116s
# <code><b>time pvmove /dev/hdg1 /dev/sda1</b></code>
. . . snip . . .
  /dev/hdg1: Moved: 44.2%
  /dev/hdg1: Moved: 44.6%
  /dev/hdg1: Moved: 45.0%
  /dev/hdg1: read failed after 0 of 1024 at 4096: Input/output error
  /dev/hdg1: read failed after 0 of 2048 at 0: Input/output error
  Failed to read existing physical volume '/dev/hdg1'
  Physical volume /dev/hdg1 not found
  ABORTING: Can't reread PV /dev/hdg1
  ABORTING: Can't reread VG for /dev/hdg1

<p>real    31m23.484s<br />
user    0m2.072s<br />
sys     0m1.772s</pre></p>

<p>I'll talk about the errors in a minute.</p>

<p>As you can see, it can take a while to move that much data, so running them in a <code>screen</code> session is recommended.</p>

<p>With the two parameter form of <code>pvmove</code>, I'm telling LVM to migrate data off of the old drives only moving it to the new one. Again, except in these kinds of very narrow circumstances, it's better to only tell it the device to move off of and let LVM decide where to move the data to (it'll make things much more efficient that way).</p>

<p>OK, so there were some errors running <code>pvmove</code> and it bailed out. Let's see what wer're dealing with:</p>

<pre># <b>pvdisplay /dev/hdc1</b>
  /dev/hdc1: read failed after 0 of 2048 at 0: Input/output error
  No physical volume label read from /dev/hdc1
  Failed to read physical volume "/dev/hdc1"</pre>

<p>Uh, oh. Looks like I'm going to have a little difficulty getting this one fixed. I ran a few other commands looking at data LVs that are already mounted and it seems that the corrupted portion of the disk is not affecting any existing data. I did have a <code>/dev/data/up2date</code> LV which I deleted during the installation of <a href="http://www.opensuse.org/">SUSE Linux</a> 10.1 (I won't need that Red Hat specific item). Prior to the installation, it was not mountable and <code>fsck</code> couldn't recover it because of drive problems. This was one of the reasons that I decided to get the new drive in the first place.</p>

<p>Hopefully, I'll find a way to verify whether or not there is any other data on that drive that I need to worry about. Bat as it's getting late, I think I'm about to head off to bed.</p>

<p>Just to finish things off, run <code>vgreduce /dev/hde2</code> (in my case). At this point, I can remove the 120GB drive and once I fix up and finish migrating from the 45GB drive, I'll be done. In my case, that means another powering down (so I'll wait till I can pull them both), but it is a home file server, so I don't mind.</p>

<p>It's very nice to have access to all of my data while I'm upgrading my storage system. There isn't even a performance penalty for other I/O, as the LVM code will submit the <code>pvmove</code> I/O operations as low priority to the kernel's I/O scheduler.</p>]]>
    </content>
</entry>

<entry>
    <title>New Hard Drive? Test It First</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/07/new-hard-drive-1.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.203</id>

    <published>2006-07-18T02:08:44Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>As you may have read in my most recent entries, I am updating my home file server, replacing the two existing ATA data drives with a new larger, faster SATA drive. The old drives are 45GB &amp; 120GB in size,...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Equipment" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>As you may have read in my most recent entries, I am updating my home file server, replacing the two existing ATA data drives with a new larger, faster SATA drive.</p>

<p>The old drives are 45GB & 120GB in size, which works out to approximately 41GB and 111GB formatted capacity, for just over 152GB storage. The new drive is a 320GB model, which works out to just over 299GB formatted capcity.</p>

<p>Since the old drives are nearly full, I'm going to be moving a lot of data. As I'm using LVM, I can migrate the data to the new drive with ease, while I have everything online and in use, but I'll cover that later. But before I move the data over, I would like to know if the new drive is good. Although this technique won't tell you for sure (as in life, sometimes there is no certainty), but it's a good indication that things are OK and it gives the new drive a little bit of a workout.</p>

<p>I simply used the <code>badblocks</code> command to test the entire drive, like so:</p>]]>
        <![CDATA[<pre># time badblocks -b 4096 /dev/sda > sda.badblocks
real    95m41.158s
user    0m1.764s
sys     3m0.631s</pre>

<p>I ran that after connecting remotely to the server from work via SSH. I used <code>screen</code> so that I could disconnect from the session, come home and reconnect later. When I did, I saw that the entire drive was checked in under 96 minutes. Not bad.</p>

<p>Of course, it's always a good sign when there are no error messages from <code>STDERR</code>, but I'll have to check the <code>sda.badblocks</code> created by my command:</p>

<pre># ls -l sda.badblocks
-rw-r--r-- 1 root root 0 Jul 17 16:38 sda.badblocks</pre>

<p>As you can see, the file is empty. So, it looks like my new drive is just fine. That means I'm ready to copy all of my data over to it, but you'll have to read my next post to learn how I'm doing that without interfering with normal operations.</p>]]>
    </content>
</entry>

<entry>
    <title>PCI SATA Controller is Working</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/07/pci-sata-contro.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.202</id>

    <published>2006-07-17T05:23:19Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary><![CDATA[All of a sudden, there it was, on the screen ... the PCI STAT controller card's BIOS showing it had found the one drive plugged in and that there were no RAID arrays configured (it has some kind of "on-board RAID0/RAID1 capability, which I'm sure is actually FRAID). "It's ... working!?" Wow, cool. I hit &lt;CTRL&gt;+&lt;ALT&gt;+&lt;DELETE&gt; on the keyboard. "Let's see if it does that again. It did.

It's always nice when hardware starts working, but sometimes, it can be a little frustrating not knowing for certain why it suddenly started working. Oh, well, it's running! I'm not complaining one little bit.]]></summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Equipment" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>In my <a href="http://blogs.gurulabs.com/lamont/archives/2006/07/mkisofs_bootabl.html">recent post about creating bootable CD images</a>, I talked about the reasons why I was trying to build a bootable CD:  I needed to install an updated BIOS to try and get my new ($19, BTW) PCI SATA controller to show up.</p>

<p>The new card is built using a <http://www.sis.com/">Silicon Integrated Systems Corp.</a> (SiS) chip. This controller needs the "sis-sil" driver. My dual Opteron box still has <a href="http://fedora.redhat.com/">Fedora Core</a> 4 on it, which apparently either doesn't have the driver with it, or didn't try loading it. I discovered this while trying to test the card and the new <a href="http://www.westerndigital.com/">Western Digital</a> WD3200J hard drive I bought the card for in my dual Opteron workstation. The drive showed up if I connected it to the on-board SATA controller, but not on the PCI card. But, <code>lspci</code> did show and identify the PCI SATA controller.</p>

<p>I decided to try it again in the file server box, so I put the whole thing back together and fired it up, entering a rescue mode using a <a href="http://www.redhat.com/rhel">RHEL</a> 4 ES DVD that was lying close by. Nothing from <code>lspci</code>, so I decided to button up the box (I had it sitting on the back of my desk while working on it) and replace it in the server stack so that I could at least use the storage I had.</p>

<p>Boy, was I in for a pleasant surprise.</p>]]>
        <![CDATA[<p>"Oh well,: I was thinking. "I tried. It just doesn't look like it's going to work on that motherboard. I guess I'll have to start planning on building the next file server. Let's see, I want to have PCIe in it and I want it to be and <a href="hrrp://www.amd.com/">AMD</a> <a href="http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_8825,00.html">Opteron</a>, probably supporting multi core processors...2 or 4 ... or the new 8-way from <a href="http://www.tyan.com/">Tyan</a>? Yeah, that would be <i>cool</i>! Of course, RAM isn't an issue as any of the boards that I could use to build that system will support more than I need for a home file server." Wow, all that in the time it took me to get the panels back on and put in most of the screws. Then it hit me, "I forgot to put that <a href="http://www.adaptec.com/">Adaptec</a> AHA-3940UW card back in. So I pulled off one panel, remounted the "omitted" card, replaced the panel and finished putting in the screws.</p>

<p>A few moments later, I had the server snugly back it's shelf (I'm not rack mounting, yet :( ) with the LVM cables plugged back in. I powered on the monitor and switched the LVM to the file server while pressing it's power button. I needed to select the second kernel to boot (I still haven't fixed the "newest" one), so I sat and watched. That's when it happened.</p>

<p>All of a sudden, there it was, on the screen ... the PCI STAT controller card's BIOS showing it had found the one drive plugged in and that there were no RAID arrays configured (it has some kind of "on-board RAID0/RAID1 capability, which I'm sure is actually FRAID). "It's ... working!?" Wow, cool. I hit <code>&lt;CTRL&gt;+&lt;ALT&gt;+&lt;DELETE&gt;</code> on the keyboard. "Let's see if it does that again. It did.</p>

<p>It's always nice when hardware starts working, but sometimes, it can be a little frustrating not knowing for certain <i>why</i> it suddenly started working. Oh, well, it's running! I'm not complaining one little bit.</p>

<p>The only thing I could think of was that after having initialized the card for it's first time in the dual Opteron box and replacing it in the file server system, it was still in the same slot, so the BIOS didn't try to "re scan" the PCI bus fully as it saw the same device list and, therefore, skipped the card when I had tried the rescue environment and the <code>lspci</code> command didn't show it listed. But when I added the SCSI controller back in (there are no drives on it, but I sometimes hook up external devices), the BIOS did rescan everything and decided it knew what to do with the SATA controller. Well, that's the only theory I have at this point.</p>

<p>So, I rebooted with a <a href="http://www.opensuse.org">SUSE Linux</a> 10.1 CD. When I reached the partitioning, it saw all 4 drives. Yipee! So, I configured the partitioning, reformatting all the partitions that had RHEL 3 on the <code>system</code> LVM VG and creating the mount points for all the <code>data</code> VG's LVs. In fact, I started writing this post before it started installing files and it's already finished, rebooted and been sitting there for at least 5 or 10 minutes until now, when I checked on it. I finished up the installation (there's going to be some more housecleaning and services configuration to do, of course) and then returned to finishing this post.</p>]]>
    </content>
</entry>

<entry>
    <title>Creating a Bootable CD Image with mkisofs</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/07/mkisofs-bootabl.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.201</id>

    <published>2006-07-17T01:55:02Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>Perhaps I have a bad card. Maybe this BIOS will never be able to see it. Either way, the next iteration of my home file server will make use of a way cool SATA controller; the 3ware 9590SE-16ML. Oh, yeah :) !</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Equipment" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>I've been working on my home file server this weekend. It has had a little over 150GB of storage for about 2.5 years, running <a href="http://www.redhat.com/rhel/">RHEL</a>3. About 2 months ago, I picked up a 320GB SATA drive and a PCI SATA controller to upgrade the system.</p>

<p>Unfortunately, there have been a few bumps and bruises on the way to getting the new drive working in my server. To help you understand some of the issues, here are the specs on that box:</p>

<ol>
<li>700MHz <a href="http://www.amd.com/">AMD</a> <a href="http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_1260_1202,00.html">Duron</a> processor</li>
<li>Syntax SV266AD motherboard</li>
<li>1GB RAM, 1 DIMM from <a href="http://www.crucial.com/">Crucial</a></li>
<li>4GB Quantum Fireball hard drive (used for OS with separate LVM VG)</li>
<li>45GB hard drive (<a href="http://www.westerndigital.com/">Western Digital</a> WD450AA)</li>
<li>120GB hard drive (<a href="http://www.westerndigital.com/">Western Digital</a> WD1200BB</li>
</ol>

<p>In case you were wondering, it was only about $2 more to get a 1GB DIMM than a 256MB DIMM when I bought it and the 45GB &amp; 120GB drives provide the shared storage under LVM.</p>

<p>Not a bad system, but not terribly modern either. For example, my problems begin with the fact that SATA is a newer technology than the Duron boards or, for that matter, RHEL 3 (because it sports the 2.4 version of the kernel).</p>]]>
        <![CDATA[<p>I've had that Duron processor for over 6 years, but the original motherboard died in April of 2004. That's why I built my dual <a href="http://www.amd.com/us-en/Processors/ProductInformation/0,,30_118_8825,00.html">Opteron</a> workstation (in May, 2004). I let the Duron chip sit for about a year before I bought the new motherboard, which required me to get new RAM as the old one was too specific to the memory controller on the old, now dead, board. I decided the newly resurrected Duron system should be my file server and the old file server hardware now serves as a firewall/router. I was able to just move the 3 hard drives (and a couple of NICs) to the new system and everything came up just fine; no OS reinstall. Man, I love Linux.</p>

<p>Anyway, when I went to install the new SATA hard drive that I had picked up, I decided that I should rearrange the other drives so that when I pull the 120GB &amp; 45GB drives from the box, that there will still be really good airflow around the new drive. As I shuffled the 4 hard drives around in the 6 drive hanging cage (this case has room for another 5 5-1/4 inch and 1 3.5 inch drives), I realized that I was just going to have to do it again, so I arranged things such that I should be able to get the most air over the 4 drives. I'll just move the new one when I pull the old drives out.</p>

<p>But when I hooked everything back up, the system (by which I mean the BIOS) could not see the new SATA controller. To make matters worse, it could no longer see the 4GB system drive either. At that point, however, I had to leave for a few business trips and didn't get around to working on the box again until this past weekend. It turns out that I merely had to reverse the IDE ribbon cable going to the 4GB drive and all is well, with it.</p>

<p>Then, when I booted the system up with the 4GB drive back in view, I got a kernel panic. Looks like the latest kernel which I have installed for RHEL4 (2.4.22-37.0.1) can't find the root partition at all. That was quickly fixed by editing <code>/boot/grub/menu.lst</code> in a rescue environment; it turned out that there was no value for the <code>root=</code> parameter on the <code>kernel</code> line. After rebooting I get a little different kernel panic. It seems there is misconfiguration in this kernel' initrd so that it can't do the <a href="http://www.die.net/doc/linux/man/man8/pivot_root.8.html">pivot_root(8)</a> properly (seems like the <code>old_dir</code> it's trying to use doesn't exist. So, I boot into the next previous (2.4.22-37) kernel, which also fails since it can't find anything in the <code>/etc/fstab</code> file.</p>

<p>OK, another trip into the rescue environment and, sure enough, there are zero bytes of content in the <code>/etc/fstab</code> file (/me shakes head). so, I reconstruct the basic lines needed to get the OS up and running, reboot again, and viola; I finally have a running system. I still had to add a few more lines to <code>/etc/fstab</code> before everything was ready for normal operation, but that only took about 3 minutes.</p>

<p>Still, the BIOS doesn't see the new SATA controller. Perhaps a BIOS update will get things going. I'm thinking that perhaps the BIOS just doesn't have the first clue what <i>kind</i> of card it is, so it doesn't initialize it into the PCI bus. To test this theory, I booted from a handy <a href="http://www.opensuse.org/">SUSE Linux</a> 10.1 CD and checked some things out in the installer's partitioning tools and with the command line. No dice, there just is no <code>/dev/sda</code> device appearing at all.</p>

<p>All right, then, let's update the BIOS. Of course, it's a DOS program, so I decided to burn a CD as I don't even have a floppy drive installed on this box and didn't really want to dig one out. My first attempt at creating a bootable CD from a DOS floppy I have used for about a decade failed to boot. I did a little digging to find out what I needed to do to properly create a bootable CD with <code><a href="http://www.itg.uiuc.edu/help/mkisofs/mkisofs.htm">mkisofs</a></code>. I came up with this command line:</p>

<pre>mkisofs -r -b workdos95.img -c boot.cat -o SV266AD.iso SV266AD-BIOS/</pre>

<p>The trick is that the <code>workdos95.img</code> file (created by running <code>dd if=/dev/fd0 of=workdos95.img bs=512</code> with the working boot floppy in the drive) has to be placed in the <code>SV266AD-BIOS</code> (in my case, since that's what I named it on my hard drive while I was building the CD) directory. That isn't exactly clear from the <code>mkisofs(8)</code> man page.</p>

<p>Burning the resulting ISO9660 image to a blank CD-R produced a working, bootable DOS CD. The <code>oakcdrom.sys</code> DOS driver even works with my Pioneer slot loading DVD drive. I was able to change to the <code>G:\</code> drive (the CD) and run the BIOS update utility. Sadly, rebooting showed that the newest BIOS still didn't bring up the PCI SATA controller. Nuts.</p>

<p>To satisfy those scratching their heads over the <code>workdos95.img</code> file, WorkDOS is a name I have used for utility boot disks that I have built. They are simply a DOS boot floppy with almost all of the main <code>C:\DOS\</code> files, a couple of other tools and some CD-ROM &amp; NIC drivers included on a 1.44MB floppy. They have been quite useful over the years, though I haven't used one in a long time.</p>

<p>The next test is to pull out the card and drive, plug them into my dual Opteron box (which has 4 SATA ports on board) and make sure the drive is good and see if the card is visible. I'm working on that now.</p>

<p>Perhaps I have a bad card. Maybe this BIOS will never be able to see it. Either way, the next iteration of my home file server will make use of a way cool SATA controller; the <a href="http://www.3ware.com/">3ware</a> <a href="http://www.3ware.com/products/serial_ata2-9590.asp">9590SE-16ML</a>. Oh, yeah :) !</p>]]>
    </content>
</entry>

<entry>
    <title>Macromedia Flash on FC5</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/07/macromedia-flas.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.200</id>

    <published>2006-07-11T15:25:28Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>Last year, I wrote a post providing instructions on how to manually install the Macromedia Flash plugin for Linux so that it would work with all of your browsers. As my good friend Doran Barton pointed out in a comment...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>Last year, I wrote a post providing <a href="http://blogs.gurulabs.com/lamont/archives/2005/03/installing_the.html">instructions on how to manually install</a> the <a href="http://www.macromedia.com/">Macromedia</a> <a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Flash</a> plugin for Linux so that it would work with all of your browsers.</p>

<p>As my good friend <a href="http://www.fozzilinymoo.org/">Doran Barton</a> pointed out in a comment on my previous post, there are RPMs available to provide the Flash plugin. At the time I wrote that post, I had tried using that RPM for the current release of <a href="http://fedora.redhat.com/">Fedora Core</a> which I had recently installed, but it didn't work for me. Additionally, other instructions &amp; HOWTOs that I had found on the Internet didn't work for all of my browsers. As I do some web stuff, I like to keep several working browsers around for testing.</p>

<p>When Fedora Core 4 came out (in May of 2005), I continued to use the instructions I had written to make Flash available in all of my browsers. A couple of months later, I found that the <a href="http://macromedia.mplug.org">mplug</a> yum repo (which Doran had suggested using) now worked for me and that it installs the Flash plugin such that it works with all the browsers I have installed.</p>

<p>When I upgraded to FC5, I found that the same RPM works there, too. You can <a href="http://macromedia.mplug.org/macromedia-i386.repo">download the .repo file</a>, which should be placed into your <code>/etc/yum.repos.d/</code> directory, then run <code>yum install flash-plugin</code> as root.</p>

<p>I did <a href="http://blog.openbrainstem.net/peregrine/2006/07/01/review-superman-returns/">run into a website recently</a> that required Flash 8, which is not available for Linux. It's doubtful that the <a href="http://www.kaourantin.net/2005/08/porting-flash-player-to-alternative.html">complications in porting Flash Player 8 to Linux</a> will be overcome, however, it looks like <a href="http://www.kaourantin.net/2005/12/flash-player-8-for-linux-update.html">Flash Player 8.5 will be made available for Linux</a>.</p>

<p>So, I would highly recommend using the mplug Macromedia yum repository. But if it doesn't work for you, refer back to my instructions for manually setting up Flash for all of your browsers.</p>

<p>If you experience any troubles with the Flash plugin in your browsers, check out <a href="http://macromedia.mplug.org/faq.html">the FAQ</a> at mplug, which has some good tips for dealing with common issues. For those of you using FC5, there is a note in the FAQ about font issues that could apply to your situation. There are also notes regarding installing the flash plugin with other distributions.</p>]]>
        
    </content>
</entry>

<entry>
    <title>Swap Happy NICs on FC5</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/07/swap-happy-nics-on-fc5.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.199</id>

    <published>2006-07-10T21:37:25Z</published>
    <updated>2008-01-28T23:05:46Z</updated>

    <summary>When Red Hat&apos;s system-config-network or netconfig tools (on either RHEL or Fedora) create /etc/sysconfig/network-scripts/ifcfg-ethX files, they always add in the HWADDR=00:00:00:00:00:00 line. There have been a couple of times that I have run into trouble because of that line. When...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>When <a href="http://www.redhat.com/">Red Hat</a>'s <code>system-config-network</code> or <code>netconfig</code> tools (on either <a href="http://www.redhat.com/rhel/">RHEL</a> or <a href="http://fedora.redhat.com/">Fedora</a>) create <code>/etc/sysconfig/network-scripts/ifcfg-eth<i>X</i></code> files, they always add in the <code>HWADDR=<i>00:00:00:00:00:00</i></code> line. There have been a couple of times that I have run into trouble because of that line.</p>

<p>When <code>ifup</code> finds the <code>HWADDR</code> variable in an <code>ifcfg-<i>foo</i></code> file, it uses the value to verify that it is configuring the correct interface. If it doesn't match, it bails out. Because of this, I have often told students that if they expect to be swapping NICs or if they run into a problem where ifup refuses to configure the interface, to try removing (or commenting out) the <code>HWADDR</code> line entirely. I have even gotten into the habit of just removing it on my own personal servers, workstations &amp; notebooks.</p>

<p>However, not having <code>HWADDR</code> in my <code>/etc/sysconfig/network-scripts/ifcfg-eth<i>X</i></code> files on my notebook actually caused me a little bit of trouble, today.</p>]]>
        <![CDATA[<p>Running Fedora Core 5 (FC5), I saw my NICs swap places during bootup. This happened first a few weeks ago, and only happened once, so I figured it was probably a fluke. Then, <a href="http://blogs.gurulabs.com/clint/">Clint</a>'s <a href="http://blog.herlo.org/2006/06/13/my-t60p-is-here/">new notbook</a> did it several times to him. When it happened to me again this morning, I decided to dig a little deeper.</p>

<p>Looking at the changelog for the latest updated version of the <code>initscripts</code> package (which <code>/etc/rc.sysinit</code> is part of), shows:</p>

<blockquote>
* Fri Jul 07 2006 Bill Nottingham &lt;HIDDEN EMAIL&gt; 8.31.5-1<br/>
- backport cups startup fix (#189168)<br/>
<br/>
* Fri Jun 30 2006 Bill Nottingham &lt;HIDDEN EMAIL&gt; 8.31.4-1<br/>
- backport bridge fixes (#187100)<br/>
- ignore alias devices in rename_device (#186355)<br/>
<br/>
* Fri Mar 17 2006 Bill Nottingham &lt;HIDDEN EMAIL&gt; 8.31.2-1<br/>
- add udev helper to rename network devices on device creation
</blockquote>

<p>So, I checked out <a href="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=186355">https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=186355</a>. Although the issues that bug's reporter (and others) were having was related to the use of Virtual Interfaces, it touched on things that could help explain the error I was seeing. A little more digging around on Bugzilla didn't produce any useful results right away, however, and as I'm <a href="http://www.gurulabs.com/training/">teaching</a> <a href="http://www.gurulabs.com/">Guru Labs</a>' <a href="http://www.gurulabs.com/training/GL510-Network_Security.php">GL510 Network Security course</a> (which is rather in-depth), I didn't have time to do any more digging right then. So, I sent a quick little email to <a href="http://people.redhat.com/notting/">Bill Nottingham</a> at Red Hat, asking if he's been seeing this problem. This was his response:</p>

<blockquote>
Lamont R. Peterson said:<br/>
&gt; A couple of weeks ago, my notebook's two interfaces (eth0 3C920, eth1 IPW2915)<br/>
&gt; came up swapped (wireless eth0 wired eth1).  It only happened the once, until<br/>
&gt; today, to me.  One of my co-workers saw it several times last week.  A couple<br/>
&gt; of other people I know have seen this happen once in the last month or so,<br/>
&gt; like I did.<br/>
&gt;<br/>
&gt; Looking at the changelog for initscripts, I see that /etc/rc.sysinit has seen<br/>
&gt; some changes regarding udev and device renaming for NICs.<br/>
<br/>
Yep. Stock answer is to make sure you have HWADDR= correct in all your<br/>
ifcfg-XXXX files, and upgrade to the current FC5 update (8.31.5) initscripts.<br/>
<br/>
Basically, udev can load/initialize interfaces in random order, so we<br/>
need code to try and get them back in the order they're configured.<br/>
<br/>
Bill
</blockquote>

<p>So, I've added the <code>HWADDR</code> lines back in on my notebook. Unfortunately, it'll be hard to test if that fixes such an intermittent issue, but, I think that this is the "right" fix for my notebook.</p>

<p>I'm also amending my advice to students in the future. Thanks to udev and the way things now work, it doesn't matter very much what <code>alias</code> lines you have in your <code>/etc/modprobe.conf</code> file; udev will start things up however seems fit.</p>]]>
    </content>
</entry>

<entry>
    <title>Encrypting Partitions on a Fedora Core Notebook</title>
    <link rel="alternate" type="text/html" href="http://blogs.gurulabs.com/lamont/2006/07/encrypting-part.html" />
    <id>tag:blogs.gurulabs.com,2006:/lamont//7.132</id>

    <published>2006-07-07T17:45:32Z</published>
    <updated>2008-01-28T23:05:45Z</updated>

    <summary>(Ed. I originally wrote this in August of 2005, but never published it, planning on reworking it to use dm-crypt instead. Unfortunately, with all the traveling and other things keeping me busy here at Guru Labs, I&apos;ve still not gotten...</summary>
    <author>
        <name>Lamont R. Peterson</name>
        <uri>http://blog.OpenBrainstem.net/peregrine/</uri>
    </author>
    
        <category term="Guru Labs" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.gurulabs.com/lamont/">
        <![CDATA[<p>(Ed. <i>I originally wrote this in August of 2005, but never published it, planning on reworking it to use dm-crypt instead. Unfortunately, with all the traveling and other things keeping me busy here at <a href="http://www.gurulabs.com">Guru Labs</a>, I've still not gotten around to it, so, I decided to publish this version as is. I should have the dm-crypt version written as a new <a href="http://www.gurulabs.com/goodies/guru+guides.php">Guru Guide</a>, soon.</i></p>

<p>Working for <a href="http://www.GuruLabs.com/">Guru Labs</a>, I travel many tens of thousands of miles per year.  I go through airports and fly all over North America.  In all this traveling, I have never had to deal with the loss or theft of a notebook computer. Hopefully, my luck will hold for many years (decades?) to come.</p>

<p>Of course, I'm not going to just say, "Well, I'll never have to worry about that!," and call it "security".  I have data on my notebook that I would not want to lose.  If my notebook was lost or stolen, I have all that data on other system and could reconstruct it (well, <i>almost</i> all that data).</p>

<p>However, some of it should never be allowed to fall into the "wrong" hands, either.  Encryption is a good answer to this problem.</p>]]>
        <![CDATA[<p>There are several different ways that one could use encryption to protect files on a system.  Individual files could be encrypted and decrypted, as needed.  This approach, while relatively simple to implement, is rather tedious for the user and error-prone; important files must be re-encrypted after each use in order to ensure they remain protected.</p>

<p>A better approach is to have the filesystem encrypt individual files, transparently.  A user would "mark" those files that should be encrypted and the filesystem would provide transparent access.  This approach would be ideal for many reasons, including the fact that only the important data is being encrypted, therefore minimizing the load on the system required to deal with encryption.  Unfortunately, this approach also requires filesystem support, which is not very common.  Also, other tools like standard file open/save dialog boxes would have to be altered to support this capability so users could (un)mark files for encryption.</p>

<p>The approach I have taken is to create a special, encrypted partition and place a filesystem on top of that.  The <a href="http://www.kernel.org/">Linux kernel</a> has supported encrypted filesystems through a mechanism called <a href="http://www.tldp.org/HOWTO/Cryptoloop-HOWTO/">cryptoloop</a> for many years now.  However, cryptoloop is deprecated and will be removed at some future point (of course, we've know this for quite some time and cryptoloop is still around, so it may or may not be a while before it is removed).  The replacement is called <a href="http://www.saout.de/misc/dm-crypt/">dm-crypt</a>, which is a devmapper module.</p>

<p>Before I get into how to add support for boot-time cryptoloop mounting to <a href=http://fedora.redhat.com/">Fedora Core</a>, it is important to note that there are some weaknesses in cryptoloop.  These weaknesses are not in the encryption algorithms used. As far as I am aware, they have not lead to any exploits which could compromise the encrypted data.  However, <b>one should not trust classified data to cryptoloop</b>.</p>

<p>First, you will need to create a cryptoloop encrypted filesystem.  This is done using the <b>losetup</b> command (see <i>losetup(8)</i> for full details).  Before <b>losetup</b> can be used to create an encrypted filesystem, you will need to load a couple of kernel modules:</p>

<pre>
# <b>modprobe cryptoloop</b>
# <b>modprobe aes</b>
</pre>

<p>After these modules are loaded, use <b>losetup</b> to create an encrypted partition (note, in this example, I am using an LVM logical volume; you can use any block device you like):</p>

<pre>
# <b>losetup -e aes /dev/loop0 /dev/vg0/secure</b>
Password: <b><i>Enter a passphrase here</i></b>
</pre>

<p>Of course, I do <i>not</i> want you to tell me what passphrase you use.  More importantly, it is recommended that your passphrase be at least 20 characters long.  Cryptographically strong passwords are always a good idea.</p>

<p>Now you have a loopback device (<code>/dev/loop0</code>, in this example) that is encrypted on disk.  The cryptoloop driver presents a standard block device on the loop<i>X</i> device node.  This device can be formated and mounted just like any other block device:</p>

<pre>
# <b>mkreiserfs /dev/loop0</b>
mkreiserfs 3.6.13 (2003 www.namesys.com)
. . . snip . . .
ATTENTION: YOU SHOULD REBOOT AFTER FDISK!
        ALL DATA WILL BE LOST ON '/dev/loop0'!
Continue (y/n):<b>y<ENTER></b>
Initializing journal - 0%....20%....40%....60%....80%....100%
Syncing..ok
ReiserFS is successfully created on /dev/loop0.
</pre>

<p>The encrypted filesystem is ready to use. Simply mount and use the new filesystem (create the mountpoint with the <b>mkdir</b> command first, as needed):</p>

<pre>
# <b>mkdir /secure</b>
# <b>mount /dev/loop0 /secure/</b>
</pre>

<p>After you have copied/moved some data over to your new encrypted filesystem, unmount it and remove the cryptoloop device, thus "locking" the partition:</p>

<pre>
# <b>umount /secure/</b>
# <b>losetup -d /dev/loop0</b>
</pre>

<p>Until you run the losetup command, the partition will be available for mounting without having to enter the passphrase.</p>

<p>To mount existing encrypted partitions, simply run losetup to setup the loop device and mount it:</p>

<pre>
# <b>losetup -e aes /dev/loop0 /dev/vg0/secure</b>
Password: <b><i>Enter the correct passphrase here</i></b>
# <b>mount /dev/loop0 /secure/</b>
</pre>

<p>(<i>NOTE:  If the mount command fails, it is usually due to a mistyped passphrase; run <b>losetup -d /dev/loop0</b> to delete the device and try again, in that case.</i>)</p>

<p>It is not necessary to run these commands when shutting down the system, as the normal system shutdown process will take care of umount'ing the partition and the reboot (or system halt) itself will close the cryptoloop device.</p>

<p>"OK.  So now I have this encrypted partition and I know these commands to run to manually mount it, but I want this thing to be taken care of when I boot my notebook."  Well, I'm glad you mentioned that; here is how I solved that problem:</p>

<p>First, I edited <i>/etc/rc.sysinit</i> and made this addition (in bold, the rest is for context and the line numbers are for the version of this file on FC4 for x86):</p>

<pre>
483 # Mount all other filesystems (except for NFS and /proc, which is already
484 # mounted). Contrary to standard usage,
485 # filesystems are NOT unmounted in single user mode.
486 action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs -O no_netdev
487<b>
488 # Mount cryptoloop filesystems
489 if [ -r /etc/cryptotab ]; then
490     action $"Mounting encrypted filesystems: " /sbin/cryptomount
491 fi
492</b>
493 if [ -x /sbin/quotaon ]; then
494     action $"Enabling local filesystem quotas: " /sbin/quotaon -aug
495 fi
496
497 # Check to see if a full relabel is needed
</pre>

<p>Next, I created the <b>/sbin/cryptomount</b> script, which can be downloaded from the <a href="http://www.GuruLabs.com/goodies/downloads.php">Guru Labs Downloads</a> page. I wrote that script, basing it on the one shipped by <a href="http://www.suse.com/">SUSE</a> with their distributions (which have supported encrypted filesystems out of the box for years).</p>

<p>The last thing to do is to create the /etc/cryptotab file.  In this file, each line describes one encrypted filesystem that should be mounted when the <b>cryptomount</b> command is run.  The format of this file is (which is identical to that used by SUSE's built in encrypted filesystem support):</p>

<pre>
# Loop device   Physical device         Mountpoint      fs-type         Algorithm       fs-options
/dev/loop0      /dev/vg0/secure         /secure         reiserfs        aes             defaults
</pre>

<p>That's it.  With these changes, the system will prompt for the passphrase for each encrypted filesystem described in your <i>/etc/cryptoloop</i> file during bootup.</p>

<p>Note: It looks like at least <a href="http://www.opensuse.org/">SUSE Linux</a> 10.1 (and probably OpenSUSE 10.0) have switched to using dm-crypt in a way that is now slightly incompatible with the technique described here. (<i>Ed. They are actually using cryptoloop still, but don't load the aes kernel module which is why the SUSE 10.1 tools can't just setup access to the cryptoloop encrypted filesystem on my notebook, which was created for Fedora using the technique found here.</i>)</p>]]>
    </content>
</entry>

</feed>
