<?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>Adams Bros Blog &#187; Linux</title>
	<atom:link href="http://blog.adamsbros.org/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.adamsbros.org</link>
	<description></description>
	<lastBuildDate>Sat, 14 Aug 2010 07:30:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu won&#8217;t boot raided root</title>
		<link>http://blog.adamsbros.org/2010/08/14/ubuntu-wont-boot-raided-root/</link>
		<comments>http://blog.adamsbros.org/2010/08/14/ubuntu-wont-boot-raided-root/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 07:07:44 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=281</guid>
		<description><![CDATA[Well, I've had a lot of trouble switching my system from LVM, to RAID1+LVM on ubuntu 10.04.  I got another drive for my system, created a mirror with one drive (temporarily of course) asked lvm to move my entire system over to that physical device, added the previous drive to the raid array, and rebooted [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I've had a lot of trouble switching my system from LVM, to RAID1+LVM on ubuntu 10.04.  I got another drive for my system, created a mirror with one drive (temporarily of course) asked lvm to move my entire system over to that physical device, added the previous drive to the raid array, and rebooted (oops).  I am listing a few things that are important to know when you're both new to Ubuntu, and doing raid post installation of Ubuntu.</p>
<p><span id="more-281"></span>First and foremost, it is very important that you realize the need to run both <strong>update-initramfs</strong> and <strong>update-grub</strong>.  update-grub re-configures grub based on your current system configuration.  Things like where /boot resides,  and things of that nature, will be automagically updated in the grub configuration by running update-grub.  update-initramfs takes care of any booting issues you might have post grub, such as raid.  So, any time you make a system change that might affect booting, run these commands before rebooting (thanks to Jordan_U on irc.freenode.org for tips)...</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">update-grub
update-initramfs <span style="color: #660033;">-ck</span> all <span style="color: #666666; font-style: italic;"># all kernels and create (not update) the initramfs.</span></pre></div></div>

<p>In the event of changing your /boot fs to another location, you should run the following as well.  Thanks again to Jordan_U.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">dpkg-reconfigure grub-pc</pre></div></div>

<p>This ensure that</p>
<ol>
<li>You can configure the devices that grub will install to</li>
<li>Ubuntu is aware of proper system configurations, for when upgrades occurs and what not, so that it doesn't write the improper grub.cfg</li>
<li>update-grub is run automatically</li>
<li>installs grub to the devices configured</li>
</ol>
<p>Now, the particular problem I was having, even though I was running the above commands, is that I kept getting dropped to a shell, with an error that said "<strong>ALERT! /dev/mapper/sys-ubuntu does not exist. Dropping to a shell</strong>".   So, as we can see, it was not finding my lvm root system.  So, the big question is "Why?"  Well, after poking around the system a bit, to find out what update-initramfs was doing, I found a file in<em><strong> /usr/share/initramfs-tools/hooks/mdadm</strong></em> that was copying <em><strong>/etc/mdadm/mdadm.conf</strong></em> verbatim to the initramfs.  Well, it's supposed to "auto detect" my raid arrays, with that configuration, but it doesn't.  So, the way I fixed it was to run the following commands...</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mdadm <span style="color: #660033;">--detail</span> <span style="color: #660033;">--scan</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mdadm<span style="color: #000000; font-weight: bold;">/</span>mdadm.conf
update-initramfs <span style="color: #660033;">-ck</span> all</pre></div></div>

<p>I then rebooted, and my system was very happy, and booted up very quickly. I have since filed a <a title="post installation handling of raid devices on boot - bug 617725" href="https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/617725">bug report</a> on ubuntu's launchpad.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2010/08/14/ubuntu-wont-boot-raided-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing spaces from filenames</title>
		<link>http://blog.adamsbros.org/2010/06/13/removing-spaces-from-filenames/</link>
		<comments>http://blog.adamsbros.org/2010/06/13/removing-spaces-from-filenames/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 03:38:08 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=275</guid>
		<description><![CDATA[If you use bash under unix, Linux, or Mac OS X, and you're continually forgetting how to convert filenames with spaces to filenames without spaces, then look no further.
The problem is that you can't do a simple for loop, on the results of a find command, because the delimiter for the for loop is the [...]]]></description>
			<content:encoded><![CDATA[<p>If you use bash under unix, Linux, or Mac OS X, and you're <strong>continually</strong> forgetting how to convert filenames with spaces to filenames without spaces, then look no further.<span id="more-275"></span></p>
<p>The problem is that you can't do a simple for loop, on the results of a find command, because the delimiter for the for loop is the space character.  So essentially, the task involves converting the filename to something that the for loop is happy with.  We need to replace spaces with an arbitrary character, then convert it back to the version with spaces, and the version you want.  I use '+' for the arbitrary character, because I know that I don't use spaces in my filenames.  I use dash (-) for the final space replacement, as it looks sharp IMO.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">find</span> .<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-iname</span> <span style="color: #ff0000;">'*.avi'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">' '</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/ /+/g'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(echo $file | sed 's/+/ /g')</span>&quot;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$file</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/+/-/g'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div>

<p>I figured if it takes me a couple minutes each time to figure it out, it's worth documenting.  And, if it's worth documenting, it's worth sharing with others.  I hope this was useful.  If it is, please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2010/06/13/removing-spaces-from-filenames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safe Shrinking of ext3 LVM volumes</title>
		<link>http://blog.adamsbros.org/2010/01/11/safe-shrinking-of-lvm-volumes/</link>
		<comments>http://blog.adamsbros.org/2010/01/11/safe-shrinking-of-lvm-volumes/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 08:53:55 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[LVM]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=102</guid>
		<description><![CDATA[When shrinking your LVM volumes, it is important to do it safely.  I will show you how I like to do that here.
Shrinking
Shrinking an ext3 volume is fairly straight forward, but it's important you don't mount your drive and start doing stuff, before you verify everything worked correctly.

e2fsck -f /dev/vg/lv1
resize2fs -p /dev/vg/lv1 ###G
e2fsck /dev/vg/lv1
lvresize -L [...]]]></description>
			<content:encoded><![CDATA[<p>When shrinking your LVM volumes, it is important to do it safely.  I will show you how I like to do that here.</p>
<h3><span id="more-102"></span>Shrinking</h3>
<p>Shrinking an ext3 volume is fairly straight forward, but it's important you don't mount your drive and start doing stuff, before you verify everything worked correctly.</p>
<ol>
<li>e2fsck -f /dev/vg/lv1</li>
<li>resize2fs -p /dev/vg/lv1 ###G</li>
<li>e2fsck /dev/vg/lv1</li>
<li>lvresize -L ###G /dev/vg/lv1</li>
<li>e2fsck /dev/vg/lv1</li>
</ol>
<p>Step #5 is the most important step; as steps 1-3 will not have any problems unless you have a system failure, a corrupted file system to start with, disk failure, or hardware failure.  Step 5 however, could be due to sys-admin error, from shrinking the LVM volume too much.  If you receive an error similar to the following, then you probably shrunk the volume too much, and your file system is not completely accessible.</p>
<blockquote>
<pre>e2fsck 1.41.9 (22-Aug-2009)
The filesystem size (according to the superblock) is 113634135 blocks
The physical size of the device is 112197632 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort&lt;y&gt;? cancelled!</pre>
</blockquote>
<p>If the error is due to shrinking too far, then this is easy to recover from; simply do another <strong>lvresize</strong>, with a large size specified, and do another <strong>e2fsck</strong> afterward.</p>
<p>Generally speaking, you should make the LVM maybe 2% or so larger than the file system was reduced to, so that there's room for file system overhead.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2010/01/11/safe-shrinking-of-lvm-volumes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intel WIFI 5300 AGN Unknown error 132</title>
		<link>http://blog.adamsbros.org/2009/12/20/intel-wifi-5300-agn-unknown-error-132/</link>
		<comments>http://blog.adamsbros.org/2009/12/20/intel-wifi-5300-agn-unknown-error-132/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 01:39:07 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=100</guid>
		<description><![CDATA[See comments for latest updates
Recently I started having problems with my Intel Corporation PRO/Wireless 5300 AGN card.  It simply quit working after I did a kernel upgrade.  It was giving errors like "Unknown error 132", and "deauthenticated (Reason: 9)".  The hardware switch did not seem to affect it, and the errors were the same whether [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">See comments for latest updates</span></p>
<p>Recently I started having problems with my Intel Corporation PRO/Wireless 5300 AGN card.  It simply quit working after I did a kernel upgrade.  It was giving errors like "Unknown error 132", and "deauthenticated (Reason: 9)".  The hardware switch did not seem to affect it, and the errors were the same whether I had the switch on, or off; so I'm assuming it had to do with the hardware not being initialized properly when the module loaded.</p>
<p><span id="more-100"></span>I'm using gentoo linux, and I had previously been using kernel "2.6.30-gentoo-r5".  when I upgraded to "2.6.31-gentoo-r6", my system started having trouble with the Intel Wifi.  I was getting errors like the following.</p>
<blockquote>
<pre>tdanotebook ~ # /etc/init.d/net.wlan0 restart
* Stopping wlan0
*   Bringing down wlan0
*     Shutting down wlan0 ...                                    [ ok ]
*     Stopping wpa_cli on wlan0 ...                              [ ok ]
*     Stopping wpa_supplicant on wlan0 ...                       [ ok ]
* Starting wlan0
RTNETLINK answers: Unknown error 132
RTNETLINK answers: Unknown error 132
*   Starting wpa_supplicant on wlan0 ...                         [ ok ]
*   Starting wpa_cli on wlan0 ...                                [ ok ]
*     Backgrounding ...

/var/log/messages
Dec 20 15:20:04 tdanotebook kernel: wlan0: direct probe to AP 00:1f:f3:c3:88:b4 try 1
Dec 20 15:20:04 tdanotebook kernel: wlan0 direct probe responded
Dec 20 15:20:04 tdanotebook kernel: wlan0: authenticate with AP 00:1f:f3:c3:88:b4
Dec 20 15:20:04 tdanotebook kernel: wlan0: authenticated
Dec 20 15:20:04 tdanotebook kernel: wlan0: associate with AP 00:1f:f3:c3:88:b4
Dec 20 15:20:05 tdanotebook kernel: wlan0: associate with AP 00:1f:f3:c3:88:b4
Dec 20 15:20:05 tdanotebook kernel: wlan0: deauthenticated (Reason: 9)
Dec 20 15:20:05 tdanotebook kernel: wlan0: deauthenticating by local choice (reason=3)</pre>
</blockquote>
<p>So, I decided to try the latest unmasked vanilla kernel "2.6.31.6", and everything just started working.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2009/12/20/intel-wifi-5300-agn-unknown-error-132/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gentoo Portage Python Update issues</title>
		<link>http://blog.adamsbros.org/2009/12/05/gentoo-portage-python-update-issues/</link>
		<comments>http://blog.adamsbros.org/2009/12/05/gentoo-portage-python-update-issues/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 02:47:49 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=96</guid>
		<description><![CDATA[I have been having some gentoo portage problems due to my system being out of sync.  When I finally updated a month or two later, it simply wasn't working.  I was getting an error like the following...

Performing Global Updates: /usr/portage/profiles/updates/3Q-2009
(Could take a couple of minutes if you have a lot of binary packages.)
 [...]]]></description>
			<content:encoded><![CDATA[<p>I have been having some gentoo portage problems due to my system being out of sync.  When I finally updated a month or two later, it simply wasn't working.  I was getting an error like the following...</p>
<blockquote>
<pre>Performing Global Updates: /usr/portage/profiles/updates/3Q-2009
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
 s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
 p='update /etc/portage/package.*'
......................................................                    

Performing Global Updates: /usr/portage/profiles/updates/4Q-2009
(Could take a couple of minutes if you have a lot of binary packages.)
 .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
 s='/var/db SLOT move'  %='binary move'  S='binary SLOT move'
 p='update /etc/portage/package.*'
..................
Traceback (most recent call last):
 File "/usr/bin/emerge", line 40, in &lt;module&gt;
 retval = emerge_main()
 File "/usr/lib64/portage/pym/_emerge/main.py", line 1328, in emerge_main
 return action_sync(settings, trees, mtimedb, myopts, myaction)
 File "/usr/lib64/portage/pym/_emerge/actions.py", line 2173, in action_sync
 if portage._global_updates(trees, mtimedb["updates"]):
 File "/usr/lib64/portage/pym/portage/__init__.py", line 8572, in _global_updates
 moves = bindb.move_ent(update_cmd)
 File "/usr/lib64/portage/pym/portage/dbapi/bintree.py", line 273, in move_ent
 mytbz2.recompose_mem(portage.xpak.xpak_mem(mydata))
 File "/usr/lib64/portage/pym/portage/xpak.py", line 106, in xpak_mem
 indexglob=indexglob+encodeint(len(x))+x+encodeint(datapos)+encodeint(mydatasize)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 49: ordinal not in range(128)</pre>
</blockquote>
<p><span id="more-96"></span>The solution is simple, but not necessarily easy to think of.  All that needs to be done is to move the 4Q-2009 and 3Q-2009 files somehwere else, and then update python/portage.</p>
<pre>[19:31 root@joseph updates] # eselect python list                    
Available python interpreters:                                       
 [1]   python2.4                                                    
 [2]   python2.5 *                                                  
 [3]   python2.6                                                    
[19:31 root@joseph updates] # eselect python set 3
[19:35 root@joseph updates] # emerge -1 portage</pre>
<p>Then, move the 4Q-2009 and 3Q-2009 back to the proper locations, and everything should be working.  Next, it's probably good to do a "python-updater -p", followed by your world update.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2009/12/05/gentoo-portage-python-update-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HDA Intel Alsa volume low</title>
		<link>http://blog.adamsbros.org/2009/08/23/hda-intel-alsa-volume-low/</link>
		<comments>http://blog.adamsbros.org/2009/08/23/hda-intel-alsa-volume-low/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 05:52:31 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=91</guid>
		<description><![CDATA[I've been having a problem where the volume level of my Dell Studio 17 notebook is just not loud enough when I'm running Linux.  I went to windows, to see if the problem was the same there, and I found that the volume in Windows Vista was way higher.  So, I booted back into Linux, [...]]]></description>
			<content:encoded><![CDATA[<p>I've been having a problem where the volume level of my Dell Studio 17 notebook is just not loud enough when I'm running Linux.  I went to windows, to see if the problem was the same there, and I found that the volume in Windows Vista was way higher.  So, I booted back into Linux, and started googling.</p>
<p>I quickly found a few places that talked about setting the model to 3stack, and various other options.  But, none of that worked for me.  So, I decided to search for the problem on my own.  I ended up checking out the alsamixer again, from the command line.  Last time I checked, I saw that the "Speaker" volume was set to about two thirds, but I had thought that was referring to the volume of the PC Speaker, as on many sound cards, it is actually an option.  As it is, that is actually the volume of the external speaker.  Once you pump that puppy up to 100% the volume level is good.  From there, you can simply adjust the master or PCM volumes as you choose.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2009/08/23/hda-intel-alsa-volume-low/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MMC/SDHC Card Readers and Gentoo Linux</title>
		<link>http://blog.adamsbros.org/2009/08/11/mmcsdhc-card-readers-and-gentoo-linux/</link>
		<comments>http://blog.adamsbros.org/2009/08/11/mmcsdhc-card-readers-and-gentoo-linux/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 03:21:29 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=81</guid>
		<description><![CDATA[So, I had a need to use my SDHC card in my Dell Studio 17 (1737) notebook.  So, I set out to find out why it wasn't working.  I ended up finding out that I needed to load mmc_block and sdhci-pci in order to get it to work.  Here's what I did.

Kernel Configuration
I happen to [...]]]></description>
			<content:encoded><![CDATA[<p>So, I had a need to use my SDHC card in my Dell Studio 17 (1737) notebook.  So, I set out to find out why it wasn't working.  I ended up finding out that I needed to load <strong>mmc_block</strong> and <strong>sdhci-pci</strong> in order to get it to work.  Here's what I did.</p>
<p><span id="more-81"></span></p>
<h2>Kernel Configuration</h2>
<p>I happen to be using kernel 2.6.30, so your configuration may vary.</p>
<blockquote>
<pre>&lt;M&gt; MMC/SD/SDIO card support  ---&gt;
&lt;M&gt;   MMC block device driver
[*]     Use bounce buffer for simple hosts
&lt;M&gt;   SDIO UART/GPS class support
&lt;M&gt;   Secure Digital Host Controller Interface support
&lt;M&gt;     SDHCI support on PCI bus</pre>
</blockquote>
<h2>Gentoo Module Loading</h2>
<p>Add the mmc_block and sdhci-pci modules to the configuration at /etc/modules.autoload.d/kernel-2.6<br />
Then I just loaded them by issuing...</p>
<blockquote>
<pre>
modprobe mmc_block
modprobe sdhci-pci</pre>
</blockquote>
<h2>My System</h2>
<p>For those searching on the internet, who might have the same MMC/SD chipsets as me.</p>
<blockquote>
<pre>tdamac linux # lspci -vvnn | grep Ricoh
09:01.0 FireWire (IEEE 1394) [0c00]: Ricoh Co Ltd R5C832 IEEE 1394 Controller [1180:0832] (rev 05) (prog-if 10 [OHCI])
09:01.1 SD Host controller [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter [1180:0822] (rev 22) (prog-if 01)
09:01.2 System peripheral [0880]: Ricoh Co Ltd R5C843 MMC Host Controller [1180:0843] (rev 12)
09:01.3 System peripheral [0880]: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter [1180:0592] (rev 12)
09:01.4 System peripheral [0880]: Ricoh Co Ltd xD-Picture Card Controller [1180:0852] (rev ff) (prog-if ff)</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2009/08/11/mmcsdhc-card-readers-and-gentoo-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Guide to LUKS Encrypted Home Volumes</title>
		<link>http://blog.adamsbros.org/2009/06/16/quick-guide-to-luks-encrypted-home-volumes/</link>
		<comments>http://blog.adamsbros.org/2009/06/16/quick-guide-to-luks-encrypted-home-volumes/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 05:24:03 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=48</guid>
		<description><![CDATA[If you search for information on how to do LUKS encrypted home volumes, you're likely to get these big fluffy documents on how to do it.  Well, if you're like me, you'd like to skip all that fluff, and get straight to the point.  That's what I try to do here.  If you like, you [...]]]></description>
			<content:encoded><![CDATA[<p>If you search for information on how to do LUKS encrypted home volumes, you're likely to get these big fluffy documents on how to do it.  Well, if you're like me, you'd like to skip all that fluff, and get straight to the point.  That's what I try to do here.  If you like, you can completely ignore what I'm saying here, and just use the commands; it really isn't complex.</p>
<p>Keep in mind that this will only work for a maximum of 8 users per system.  Anything more than that, and you will have to resort to either full disk encryption, or some other method of encrypting your /home files.</p>
<p>I would try this out on a 1G volume or something just for fooling around.  Then once you've got that working, do it to your actual home directory.  I use LVM with mine, but it could also be a raw partition if you prefer that.  If it is a removable drive, I HIGHLY recommend using LVM, because you will be able to reference it by lvm "name".  Using a partition for external drives becomes difficult, because you cannot name an encrypted volume.</p>
<p><span id="more-48"></span></p>
<p>The default encryption algorithm for LUKS is AES with a cipher mode of cbc-essiv:sha256.  There are essentially 2 steps to creating a LUKS based encrypted volume.</p>
<ol>
<li><a href="#luks_volume">LUKS Volume</a></li>
<li><a href="#automount">Automounting</a></li>
</ol>
<h2 id="luks_volume">LUKS Volume</h2>
<p>Tip: If you are the only user, just give your account password during luksFormat, and skip point #1.2</p>
<ol>
<li>
<pre>Create Encrypted Volume</pre>
<ol>
<li>
<pre>cryptsetup luksFormat /dev/s/home    # use CAPITAL "YES" to say yes, and enter main key</pre>
</li>
<li>
<pre>cryptsetup luksAddKey /dev/s/home    # add your account password as a key password</pre>
</li>
</ol>
</li>
<li>
<pre>Mount and Sync to Encrypted Volume</pre>
<ol>
<li>
<pre>cryptsetup luksOpen /dev/s/home home # opens to /dev/mapper/home</pre>
</li>
<li>
<pre>mkfs.whatever /dev/mapper/home</pre>
</li>
<li>
<pre>mount /dev/mapper/home /mnt/newhome</pre>
</li>
<li>
<pre>rsync -a /home/ /mnt/newhome/</pre>
</li>
</ol>
</li>
</ol>
<p>If you really want to overwrite your entire hard drive with random data, to make sure that there is no residual data on the drive somewhere, just use a dd from /dev/urandom to output to a file with no count option, and the volume will eventually run out of space, and the entire disk will then have random encrypted data; then just remove the file.</p>
<h2 id="automount">Automounting</h2>
<p>Auto mounting on login is taken care of by pam_mount.  It knows how to mount encrypted volumes.  PAM will pass your user account password to pam_mount.  pam_mount will use that as the password for decrypting the volume.  That means it's important to use the luksAddKey step above to add your user account password to the list of keys.</p>
<p>We need to setup pam by</p>
<ol>
<li>Configuring the location of the volume</li>
<li>Having KDE use pam_mount</li>
<li>Optionally having the default shell login <em>(console mode logins)</em> decrypt the volume.</li>
</ol>
<p>1. Modify /etc/security/pam_mount.conf.xml</p>
<pre>&lt;volume sgrp="users" fstype="crypt" path="/dev/mapper/s-home" mountpoint="/home/"/&gt;</pre>
<p>2. KDE pam configuration<br />
/etc/pam.d/kde</p>
<pre>auth       optional pam_mount.so try_first_pass
session    optional pam_mount.so</pre>
<p>3. Setup the default shell login to load pam_mount.<br />
/etc/pam.d/login</p>
<pre>auth       optional pam_mount.so try_first_pass
session    optional pam_mount.so</pre>
<p>I think that's all.  If you have questions, just fire away.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2009/06/16/quick-guide-to-luks-encrypted-home-volumes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux Macbook Function Key Mode &#8211; fnmode</title>
		<link>http://blog.adamsbros.org/2009/06/14/linux-macbook-function-key-mode-fnmode/</link>
		<comments>http://blog.adamsbros.org/2009/06/14/linux-macbook-function-key-mode-fnmode/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 08:15:02 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=56</guid>
		<description><![CDATA[So, I couldn't figure out how to get my Macbook function keys to default to function keys under Linux, rather than media keys such as brightness, volume control, etc.  I searched all over the net for information on this feature, and could only find stuff about pb_fnmode (which doesn't appear in the latest kernels).  So, [...]]]></description>
			<content:encoded><![CDATA[<p>So, I couldn't figure out how to get my Macbook function keys to default to function keys under Linux, rather than media keys such as brightness, volume control, etc.  I searched all over the net for information on this feature, and could only find stuff about pb_fnmode (which doesn't appear in the latest kernels).  So, I finally resorted to grepping "fnmode" out of the sources, and found the location that sets this.  Then, I noticed that the kernel module that handles Mac key mappings had a parameter that could be changed, called "fnmode".  Well, that gave me a clue that it may be in /sys/ somehwere.  So, I searched, and sure enough, it was there.  The following command will set the function keys to be the default action, rather than media keys.</p>
<pre>echo 2 &gt; /sys/module/hid_apple/parameters/fnmode</pre>
<p>The valid values are (0 = disabled, [1] = fkeyslast, 2 = fkeysfirst)</p>
<p>This effectively reverses the function key/media key mappings.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2009/06/14/linux-macbook-function-key-mode-fnmode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vmware modules 2.6.30-rc3</title>
		<link>http://blog.adamsbros.org/2009/06/03/vmware-modules-2-6-30-rc3/</link>
		<comments>http://blog.adamsbros.org/2009/06/03/vmware-modules-2-6-30-rc3/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 01:50:53 +0000</pubDate>
		<dc:creator>Trenton</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Virtual Machines]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://blog.adamsbros.org/?p=27</guid>
		<description><![CDATA[If you are using VMware-Workstation-6.5.1-126130.x86_64, you will find that it does not work on kernels greater than or equal to 2.6.29.  The vmware modules will not load.  I found one patch for vmware to work with the Linux kernel 2.6.29 on the vmware forums, and I came up with another patch for 2.6.30-rc3 on my [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using VMware-Workstation-6.5.1-126130.x86_64, you will find that it does not work on kernels greater than or equal to 2.6.29.  The vmware modules will not load.  I found one patch for vmware to work with the Linux kernel 2.6.29 on the vmware forums, and I came up with another patch for 2.6.30-rc3 on my own.  If you know who made the original patch (as I have lost the link to the forum), please let me know who that is so I can give credit where credit is due.  Below are the results.</p>
<p>I have tried these changes on 2.6.30-rc3, and 2.6.30-rc7, and they seem to work fine.  I would imagine that they would work on 2.6.30-rc3, 2.6.30-rc4, 2.6.30-rc5, 2.6.30-rc6, and 2.6.30-rc7, but I have not confirmed.  They may also work on 2.6.30 versions that are less than rc3.</p>
<p><span id="more-27"></span></p>
<p>Once you have finished installing vmware, put the following files all in the same directory and run the shell script.  It should backup and then patch the original source.</p>
<ul>
<li><a rel="attachment wp-att-31" href="http://blog.adamsbros.org/2009/06/03/vmware-modules-2-6-30-rc3/vmware-modules-2630-rc3-portable/">vmware-modules-2.6.30-rc3-portable.patch</a></li>
<li><a rel="attachment wp-att-34" href="http://blog.adamsbros.org/2009/06/03/vmware-modules-2-6-30-rc3/vmware-modules-2629-portable/">vmware-modules-2.6.29-portable.patch</a></li>
<li><a rel="attachment wp-att-30" href="http://blog.adamsbros.org/2009/06/03/vmware-modules-2-6-30-rc3/vmware-modules-2630-rc3/">vmware-modules-2.6.30-rc3.sh</a></li>
</ul>
<blockquote>
<pre>sh vmware-modules-2.6.30-rc3.sh</pre>
</blockquote>
<p>You will find backup copies of the original source in /usr/lib/vmware/modules/source-backup.</p>
<p>Once you are finished, you will be asked to run another command to install the new modules.</p>
<blockquote>
<pre>vmware-modconfig --console --install-all</pre>
</blockquote>
<p>If it fails on a newer version of the kernel, you should be able to simply find out what the problems are, and why it's incompatible with the new kernel, and then...</p>
<ol>
<li>create a new patch file</li>
<li>modify the shell script to apply the patch after the two patches above</li>
<li>move the "source" folder to a backup name</li>
<li>move the source-backup folder to the "source" folder</li>
<li>re-run the shell script</li>
</ol>
<p>I hope this is useful for someone.  If you find it useful, I would appreciate hearing about it by a comment.  Also, feel free to link to this blog.</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.adamsbros.org/2009/06/03/vmware-modules-2-6-30-rc3/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
