<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7661980153269039003</id><updated>2011-07-28T14:15:16.457-04:00</updated><category term='linux'/><category term='superblock'/><category term='xfs. defrag'/><category term='uuid'/><category term='raid'/><category term='hardened'/><category term='swap'/><title type='text'>Crotchety Linux - Gentoo Stuff</title><subtitle type='html'>crotchety&lt;br&gt;
&lt;i&gt;adj&lt;/i&gt; - subject to whims, crankiness, or ill temper&lt;br&gt;&lt;br&gt;

I use Gentoo Linux both at home and at work.  Every so often I hit some snag and I'd like to detail the fix here both for my benefit and to possibly help anyone else having a similar issue.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-2395521295371542636</id><published>2010-03-14T13:24:00.001-04:00</published><updated>2010-03-14T13:26:31.519-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='raid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='hardened'/><title type='text'>Migrating Linux software raid from 4 device raid5 to 6 device raid6</title><content type='html'>&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;a href="http://crotchety-linux.blogspot.com/2010/03/migrating-software-raid1-array-to-2-new.html"&gt;In a previous post&lt;/a&gt;, I discussed migrating from 2xIDE device mirror to a 2xSATA device mirror.&amp;nbsp; Since the old arrays were using 160GB and I bought 500GB drives I figured I'd use the space left over to add a couple more devices to my storage array.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Here's what I'm starting with: &lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# cat /proc/mdstat&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;md0 : active raid5 sdd1[1] sdb1[3] sdc1[2] sda1[0]&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 937705728 blocks level 5, 128k chunk, algorithm 2 [4/4] [UUUU]&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitmap: 0/150 pages [0KB], 1024KB chunk&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;It's a 4x320GB raid5 array.&amp;nbsp; I'm going to expand the array to include 2 more devices (sde4 and sdf4) and reshape it to a raid6 array at the same time.&amp;nbsp; I will end up gaining 1 device's worth of space (320GB) and 1 more drive of redundancy.&amp;nbsp; With raid6, the array will be able to survive 2 failures and still function instead of the 1 failure a raid5 array can survive.&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Unfortunately, the current, stable hardened kernel is 2.6.28-r9 and to reshape a raid5 to raid6 requires at least a 2.6.31 kernel.&amp;nbsp; Additionally mdadm &amp;gt;=3.1.0 is required and 3.0 is currently stable.&amp;nbsp; The second is reasonably easy to fix:&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# echo "=sys-fs/mdadm-3.1.1-r1" &amp;gt;&amp;gt; /etc/portage/package.keywords&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# emerge -av mdadm&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;For the kernel, I installed layman and added the hardened-development overlay (not covered here) and unmasked the minimum required kernel:&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;#  echo "=sys-kernel/hardened-sources-2.6.31-r11" &amp;gt;&amp;gt;  /etc/portage/package.keywords&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# emerge -av hardened-sources&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;I'm also not going to cover configuring/building/installing/booting to the new kernel.&amp;nbsp; If you're using Gentoo, you should know what you're doing already in that respect.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;After all the prerequisites are taken care of (I created the partitions I'm using here during the previous array muddling in the previous blog post) we can move forward.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Add the 2 new devices to the array.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mdadm /dev/md0 --add /dev/sde4 /dev/sdf4&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;At this point the new devices will be acting as "spares" as shown below (the (S) next to the device):&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# cat /proc/mdstat&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;md0 : active raid5 sdf4[4](S) sde4[5](S) sdd1[1] sdb1[3] sdc1[2] sda1[0]&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 937705728 blocks level 5, 128k chunk, algorithm 2 [4/4] [UUUU]&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitmap: 1/150 pages [4KB], 1024KB chunk&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Turn off the write-intent bitmap on the array temporarily.&amp;nbsp; This is necessary for the reshape to occur.&amp;nbsp; I originally was getting an error and Neil Brown (mdadm author &lt;a href="http://neil.brown.name/"&gt;http://neil.brown.name&lt;/a&gt;) told me I needed to remove the bitmap while reshaping:&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;# mdadm --grow /dev/md0 --bitmap  none&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;To  speed up the sync process  we're about to cause, issue the following:&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# echo  200000 &amp;gt;  /proc/sys/dev/raid/speed_limit_max&lt;br /&gt;# echo 200000 &amp;gt;  /proc/sys/dev/raid/speed_limit_min&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;Start the reshape:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="commenteven"&gt;&lt;span class="indent"&gt;&lt;span class="mono"&gt;#  mdadm --grow /dev/md0 --level=6 --raid-devices=6  --backup-file=/root/raid-backup&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="commenteven"&gt;&lt;span class="indent"&gt;&lt;span class="mono"&gt;mdadm level of /dev/md0 changed to raid6&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="commenteven" style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="indent"&gt;&lt;span class="mono"&gt;mdadm: Need to backup 1536K of critical section.. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;Watch the *extremely* slow reshape (you can literally watch it with &lt;/span&gt;&lt;/span&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;watch -n 1 cat  /proc/mdstat&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;# cat /proc/mdstat&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;md0 : active raid6 sda1[4] sdf4[0] sde4[5] sdb1[3] sdd1[1] sdc1[2]&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 937705728 blocks super 0.91 level 6, 128k chunk, algorithm 18 [6/7] [UUUUUU]&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [====&amp;gt;................]&amp;nbsp; reshape = 22.6% (70662528/312568576) finish=286.1min speed=14088K/sec&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;At this point, mdadm --detail output still shows my array as being the old size:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Array Size : 937705728 (894.27 GiB 960.21 GB)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Used Dev Size : 312568576 (298.09 GiB 320.07 GB)&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;I was curious about this as I should have gained 320GB.&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;My device size is 320GB,  raid5 capacity is n-1 devices: 320x3 = 960GB.&amp;nbsp; After the  reshape it will be n-2 devices: 320x4=1280GB. &lt;/span&gt;&lt;/span&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;So I ran a test with some loopback devices and the size of the array will be correct when the reshape is completed.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;After the reshape, turn  the write intent bitmap back on:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;# &lt;/span&gt;&lt;/span&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;mdadm --grow /dev/md0 --bitmap  internal&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;As you can see, the array now has the proper 320x4 size (and the superblock version went back 0.90):&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mdadm -D /dev/md0&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/dev/md0:&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Version : 0.90&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; Creation Time : Thu Sep&amp;nbsp; 7 18:41:05 2006&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Raid Level : raid6&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Array Size : 1250274304 (1192.35 GiB 1280.28 GB)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; Used Dev Size : 312568576 (298.09 GiB 320.07 GB)&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; Raid Devices : 6&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; Total Devices : 6&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Preferred Minor : 0&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Persistence : Superblock is persistent&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; Intent Bitmap : Internal&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Update Time : Sun Mar 14 11:40:59 2010&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; State : active&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;Active Devices : 6&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Working Devices : 6&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;Failed Devices : 0&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; Spare Devices : 0&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Layout : left-symmetric&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chunk Size : 128K&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UUID : fdc29307:ba90c91c:d9adde8d:723321bc&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Events : 0.692377&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number&amp;nbsp;&amp;nbsp; Major&amp;nbsp;&amp;nbsp; Minor&amp;nbsp;&amp;nbsp; RaidDevice State&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 84&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/sdf4&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 49&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/sdd1&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 33&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/sdc1&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 17&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/sdb1&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/sda1&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 68&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/sde4&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;Since I use LVM to chop up this array, I just need to grow my pv to make LVM aware of the new, larger, size of the underlying raid array:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;# pvresize /dev/md0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;pvdisplay now shows the full size:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&amp;nbsp; PV Size&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.16 TiB / not usable 2.81 MiB&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;Similarly, vgdisplay shows the extra space available for allocation:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="commentodd"&gt;&lt;span class="indent"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp; Free&amp;nbsp; PE / Size&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 86234 / 336.85 GiB&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;And that's about it.&amp;nbsp; Big thanks to Neil for the tip on the write-intent bitmap.&amp;nbsp; The combination of Linux kernel raid and mdadm let's you do some pretty amazing things.&amp;nbsp; I was able to do both the raid1 migrations and this raid5 -&amp;gt; raid6 extend/reshape while the system was up and running with live filesystems.&amp;nbsp; That's pretty impressive.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-2395521295371542636?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/2395521295371542636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=2395521295371542636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/2395521295371542636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/2395521295371542636'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2010/03/migrating-linux-software-raid-from-4.html' title='Migrating Linux software raid from 4 device raid5 to 6 device raid6'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-4205789637249695591</id><published>2010-03-14T12:59:00.004-04:00</published><updated>2010-03-14T13:27:45.103-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uuid'/><category scheme='http://www.blogger.com/atom/ns#' term='raid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='swap'/><title type='text'>Migrating a software raid1 array to 2 new harddrives</title><content type='html'>&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;My server currently has 2 IDE drives mirrored for the boot/root and swap partitions.&amp;nbsp; They are 160 and 250GB drives.&amp;nbsp; The 250 is a refurb sent to me by Seagate after the original matching 160 died.&amp;nbsp; So the mirror has already saved me once.&amp;nbsp; I'm going to migrate to newer/faster/larger 500GB SATA discs.&amp;nbsp; Rather than use the whole 500 for the root filesystem which I don't need.&amp;nbsp; I decided to keep the partition sizes all the same and use the leftover space on the drive to add capacity and redundancy to my storage array which is the subject for &lt;a href="http://crotchety-linux.blogspot.com/2010/03/migrating-linux-software-raid-from-4.html"&gt;another blog post&lt;/a&gt;.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;So here's what I'm starting with partition wise:&lt;/div&gt;/dev/hda1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5-&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40131&amp;nbsp;&amp;nbsp; fd&amp;nbsp; Linux raid autodetect&lt;br /&gt;/dev/hda2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 129&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 125&amp;nbsp;&amp;nbsp;&amp;nbsp; 1004062+&amp;nbsp; 82&amp;nbsp; Linux swap / Solaris&lt;br /&gt;/dev/hda3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 130&amp;nbsp;&amp;nbsp; 19456&amp;nbsp;&amp;nbsp; 19327&amp;nbsp; 155244127+&amp;nbsp; fd&amp;nbsp; Linux raid autodetect&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;hdb obviously has the exact same partition layout.&amp;nbsp;&amp;nbsp;&lt;/div&gt;/dev/hda1 and hdb1 are raid1 /dev/md1 for /boot &lt;br /&gt;/dev/hda2 and hdb2 are swap&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/dev/hda3 and hdb3 are raid1 /dev/md3 for /&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;I originally had the swap partitions mirrored as well but after reading up a bit I decided I didn't need THAT level of protection so just added the 2 partitions individually.&amp;nbsp; (They used to be /dev/md2) &lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;The first step (after adding the new drives to the system) is to partition new disks exactly like the old ones:&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sfdisk -d /dev/hda | sfdisk /dev/sde&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sfdisk -d /dev/hda | sfdisk /dev/sdf&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;At this point I added a 4th partition to sde and sdf taking up the rest of the drives.&amp;nbsp; That's in preparation for the other migration.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;set up swap:&lt;/div&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mkswap /dev/sde2&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; Setting up swapspace version 1, size = 1004056 KiB&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; no label, UUID=d9a6fd39-e768-4334-8496-2b0b5ab44bdf&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; # mkswap /dev/sdf2&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; Setting up swapspace version 1, size = 1004056 KiB&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; no label, UUID=529c0773-9a3e-434d-b6e4-16cb0e8f24a2&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Turn on the new swaps (&lt;/span&gt;&lt;a href="http://crotchety-linux.blogspot.com/2008/01/mystical-uuid.html" style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;I mount stuff almost exclusively with UUIDs&lt;/a&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;): &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# swapon UUID=d9a6fd39-e768-4334-8496-2b0b5ab44bdf&lt;/span&gt;&lt;br style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;" /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; # swapon UUID=529c0773-9a3e-434d-b6e4-16cb0e8f24a2&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Add swaps to fstab (I removed the old ones at this point before I forgot):&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;UUID=d9a6fd39-e768-4334-8496-2b0b5ab44bdf&amp;nbsp; none&amp;nbsp; swap&amp;nbsp; sw,pri=1 0 0&lt;br /&gt;UUID=529c0773-9a3e-434d-b6e4-16cb0e8f24a2&amp;nbsp; none&amp;nbsp; swap&amp;nbsp; sw,pri=1 0 0&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Add 2 new devices to md1 (/boot):&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mdadm /dev/md1 --add /dev/sde1 --add /dev/sdf1&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Add 2 new devices to md3 (/):&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mdadm /dev/md3 --add /dev/sde3 --add /dev/sdf3&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Snipped mdadm detail output shows the new devices as spares:&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mdadm --detail /dev/md1&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; Number&amp;nbsp;&amp;nbsp; Major&amp;nbsp;&amp;nbsp; Minor&amp;nbsp;&amp;nbsp; RaidDevice State&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/hda1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/hdb1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 81&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spare&amp;nbsp;&amp;nbsp; /dev/sdf1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spare&amp;nbsp;&amp;nbsp; /dev/sde1&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mdadm --detail /dev/md3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Number&amp;nbsp;&amp;nbsp; Major&amp;nbsp;&amp;nbsp; Minor&amp;nbsp;&amp;nbsp; RaidDevice State&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/hda3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 67&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; active sync&amp;nbsp;&amp;nbsp; /dev/hdb3&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 83&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spare&amp;nbsp;&amp;nbsp; /dev/sdf3&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 67&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spare&amp;nbsp;&amp;nbsp; /dev/sde3&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;To  speed up the sync process we're about to cause, issue the following:&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# echo  200000 &amp;gt; /proc/sys/dev/raid/speed_limit_max&lt;br /&gt;# echo 200000 &amp;gt;  /proc/sys/dev/raid/speed_limit_min&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Before I continue.&amp;nbsp; The next couple steps are where the system doesn't have the full redundancy.&amp;nbsp; I'm going to mark one of the 2 ide devices in the array as faulty.&amp;nbsp; The kernel will automatically grab a spare and start rebuilding the array.&amp;nbsp; Personally, I'm not worrying about this because, if something does happen, I can always re-add the drive I "failed".&amp;nbsp; Just making the point that when you manually degrade the array, you're mirror isn't redundant until the rebuild/resync is complete.&amp;nbsp; Continuing on...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Mark one of the old devices in a raid as faulty.&amp;nbsp; It's very important that you only mark one device faulty!&amp;nbsp; This will cause the array to grab a spare and start syncing the remaining good device, hdb1 in this case, to the new device .&amp;nbsp; You can watch the progress of the resync via &lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;cat /proc/mdstat&lt;/span&gt;.&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mdadm /dev/md1 -f /dev/hda1&lt;br /&gt;mdadm: set /dev/hda1 faulty in /dev/md1&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Since this raid volume is all of 40MB, it resyncs before I can even look at the mdstat output.&amp;nbsp; Still, I check and make sure it's all synced up and fault the other old partition:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mdadm /dev/md1 -f /dev/hdb1&lt;br /&gt;mdadm: set /dev/hdb1 faulty in /dev/md1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Again, check mdstat output and make sure it finishes.&amp;nbsp; It should look similar to this:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;md1 : active raid1 sdf1[2] sde1[3] hdb1[1]&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(F)&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; hda3[1](F)&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40064 blocks [2/2] [UU]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitmap: 0/5 pages [0KB], 4KB chunk&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Now all the data has been copied over to the new drives and we just need to remove the old ones from the array:&lt;/div&gt;# mdadm /dev/md1 --remove /dev/hda1 --remove /dev/hdb1&lt;br /&gt;mdadm: hot removed /dev/hda1&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mdadm: hot removed /dev/hdb1&lt;br /&gt;&lt;br /&gt;mdstat now says:&lt;br /&gt;md1 : active raid1 sdf1[0] sde1[1]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40064 blocks [2/2] [UU]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitmap: 0/5 pages [0KB], 4KB chunk&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Now do the same steps for hda3 and hdb3 for the md3 array.&lt;/div&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Fail one of the devices:&lt;/span&gt;&lt;br /&gt;# mdadm /dev/md3 -f /dev/hda3&lt;br /&gt;mdadm: set /dev/hda3 faulty in /dev/md3&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;This array is ~155GB so it takes a little longer to resync, here's the mdstat output:&lt;/div&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;md3 : active raid1 sdf3[2] sde3[3](S) hdb3[1] hda3[4](F)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 155244032 blocks [2/1] [_U]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [=====&amp;gt;...............]&amp;nbsp; recovery = 29.2% (45338816/155244032) finish=38.1min speed=48002K/sec&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitmap: 25/149 pages [100KB], 512KB chunk&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Incidentally, here's some iostat output showing why I want to get rid of the old IDE harddrives...hdb is reading 46MB/sec and it as 99.44% utilization.&amp;nbsp; Meanwhile sde is writing at 46MB/sec and is only at 38% utilization:&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; Device:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rrqm/s&amp;nbsp;&amp;nbsp; wrqm/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r/s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w/s&amp;nbsp;&amp;nbsp;&amp;nbsp; rMB/s&amp;nbsp;&amp;nbsp;&amp;nbsp; wMB/s avgrq-sz avgqu-sz&amp;nbsp;&amp;nbsp; await&amp;nbsp; svctm&amp;nbsp; %util&lt;br /&gt;hdb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 649.20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00&amp;nbsp;&amp;nbsp; 93.60&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.40&amp;nbsp;&amp;nbsp;&amp;nbsp; 46.34&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.01&amp;nbsp;&amp;nbsp; 999.07&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.45&amp;nbsp;&amp;nbsp; 36.33&amp;nbsp; 10.47&amp;nbsp; 99.44&lt;br /&gt;sdf&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00&amp;nbsp;&amp;nbsp; 646.80&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00&amp;nbsp;&amp;nbsp; 96.20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00&amp;nbsp;&amp;nbsp;&amp;nbsp; 46.44&amp;nbsp;&amp;nbsp; 988.74&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.41&amp;nbsp;&amp;nbsp;&amp;nbsp; 4.24&amp;nbsp;&amp;nbsp; 3.98&amp;nbsp; 38.32&lt;/span&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;When the array has resynced after failing the first partition, go ahead and mark the second original device as faulted:&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# mdadm /dev/md3 -f /dev/hdb3&lt;br /&gt;mdadm: set /dev/hdb3 faulty in /dev/md3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;The new drives are a little over twice as fast as the old.&amp;nbsp; It's reading off of sde to fill sdf:&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;md3 : active raid1 sdf3[0] sde3[2] hdb3[3](F) hda3[4](F)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 155244032 blocks [2/1] [U_]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [=====&amp;gt;...............]&amp;nbsp; recovery = 28.9% (44921984/155244032) finish=18.7min speed=97804K/sec&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitmap: 39/149 pages [156KB], 512KB chunk&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Once the array is finished up with the second sync, time to remove the 2, now faulty, device from the array:&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;#mdadm /dev/md3 --remove /dev/hda3 --remove /dev/hdb3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mdadm: hot removed /dev/hda3&lt;br /&gt;mdadm: hot removed /dev/hdb3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;At this point I can turn off the swaps on the old drives:&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;swapoff /dev/hda2 /dev/hdb2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;And the system is no longer "using" the old hard drives at all.&amp;nbsp;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;div&gt;I shutdown the system and remove the old IDE hard drives.&amp;nbsp; Then I boot to system rescue cd and chroot into the system (following same procedure as initially entering the chroot of your system from Gentoo Handbook) to run grub and install it into the MBR of both new drives.&amp;nbsp; Grub names drives differently than the kernel.&amp;nbsp; It uses BIOS numbering as well.&amp;nbsp; Meaning grub sees the 2 new SATA drives (on the sil3132 controller) as the 5th and 6th drives.&amp;nbsp; They are named hd4 and hd5 respectively.&amp;nbsp; The kernel, on the other hand, sees them as sde and sdf because it enumerates the 4 drives plugged into the motherboard first.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First start grub&lt;/div&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# grub&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Install to first drive's MBR (boot partition is first partition on 5th drive)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;grub&amp;gt; root (hd4,0)&lt;br /&gt;&amp;nbsp;Filesystem type is ext2fs, partition type 0xfd&lt;br /&gt;grub&amp;gt; setup (hd4)&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Install to second  drive's MBR (boot partition is first partition on 6th drive)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;grub&amp;gt;  root (hd5,0)&lt;br /&gt;&amp;nbsp;Filesystem type is ext2fs, partition type 0xfd&lt;br /&gt;grub&amp;gt; setup (hd5)&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;Now I reboot and check the BIOS settings to tell the computer to boot off of one of the 2 new SATA drives and let 'er go.&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;The arrays and swap are now running exclusively on the new SATA drives:&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# cat /proc/mdstat&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;md1 : active raid1 sdf1[0] sde1[1]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40064 blocks [2/2] [UU]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitmap: 0/5 pages [0KB], 4KB chunk&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;md3 : active raid1 sdf3[0] sde3[1]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 155244032 blocks [2/2] [UU]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bitmap: 24/149 pages [96KB], 512KB chunk&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;# cat /proc/swaps&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Filename&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&amp;nbsp;&amp;nbsp;&amp;nbsp; Used&amp;nbsp;&amp;nbsp;&amp;nbsp; Priority&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/dev/sde2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; partition&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1004052 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;/dev/sdf2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; partition&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1004052 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-4205789637249695591?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/4205789637249695591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=4205789637249695591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/4205789637249695591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/4205789637249695591'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2010/03/migrating-software-raid1-array-to-2-new.html' title='Migrating a software raid1 array to 2 new harddrives'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-2722584493160655726</id><published>2009-11-13T06:28:00.006-05:00</published><updated>2009-12-03T21:48:09.617-05:00</updated><title type='text'>How to keep Gentoo safely updated</title><content type='html'>When I first started using Gentoo, I broke the system a few times by updating it.  I've noticed that I have a lot less issues keeping the system up to date these days.  I'm sure part of it is the great job the Gentoo Devs are doing but I think the other part is following a procedure each time I update the system.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Update portage&lt;/span&gt;&lt;br /&gt;I use &lt;span style="font-family:courier new;"&gt;app-portage/eix&lt;/span&gt; so I run &lt;span style="font-family:courier new;"&gt;eix-sync&lt;/span&gt;.   This gives me a nice diff at the end of the changes.  I can quickly see if any packages I have installed have updates.  An alternative is the tried and true &lt;span style="font-family:courier new;"&gt;emerge --sync&lt;/span&gt;.  Some sample output of &lt;span style="font-family:courier new;"&gt;eix-sync&lt;/span&gt; below:&lt;br /&gt;&lt;ul&gt;&lt;li  style="font-family:courier new;"&gt;[&gt;]   == x11-themes/mythtv-themes-extra (0.21_p17416 -&gt; 0.21_p18657): A collection of themes for the MythTV project. &lt;span style="color: rgb(51, 255, 51);font-family:georgia;" &gt;(Has been updated, but I don't have it installed)&lt;/span&gt;&lt;/li&gt;&lt;li face="courier new"&gt;&lt;&lt;span style="color: rgb(51, 102, 255);font-family:georgia;" &gt; &lt;span style="color: rgb(51, 255, 51);"&gt;(Has been removed from portage)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="font-family: courier new;"&gt;[N]   &gt;&gt; dev-java/piccolo2d (~1.2.1!t): A Structured 2D Graphics Framework&lt;span style="color: rgb(51, 102, 255);font-family:georgia;" &gt; &lt;span style="color: rgb(51, 255, 51);"&gt;(A new package to portage)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;[U]   == net-libs/gnutls (2.8.3@09/22/09; 2.8.3 -&gt; 2.8.4): A TLS 1.0 and SSL 3.0 implementation for the GNU project &lt;/span&gt;&lt;span style="color: rgb(51, 255, 51);font-family:georgia;" &gt;(Has been updated to 2.8.4.  I have 2.8.3 which was installed on 9/22/09)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;Update packages&lt;/span&gt;&lt;br /&gt;I use &lt;span style="font-family:courier new;"&gt;emerge -avuND world&lt;/span&gt;.  The options are as follows:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;a means ask.  It's like doing a (p)retend but instead of calculating dependencies twice, it's only once.&lt;/li&gt;&lt;li&gt;v is verbose output.  I like to see the use flags listed.&lt;/li&gt;&lt;li&gt;u is update.&lt;/li&gt;&lt;li&gt;N is new-use.  This means rebuild any package whose use-flags have changed since it was last installed.&lt;/li&gt;&lt;li&gt;D is deep.  This looks further into the dependencies and will end up keeping more stuff up to date.  I find this still doesn't catch *every* little package update, but it's good enough for me.&lt;/li&gt;&lt;li&gt;world is the world package set.  This means potentially update any package on the system.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;Update configuration files&lt;/span&gt;&lt;br /&gt;I use &lt;span style="font-family:courier new;"&gt;dispatch-conf&lt;/span&gt; instead of &lt;span style="font-family:courier new;"&gt;etc-update&lt;/span&gt; as, over time, it saves me a lot of time.  &lt;span style="font-family:courier new;"&gt;dispatch-conf&lt;/span&gt; is a lot more powerful and you can turn on a lot of options that aren't enabled by default in it's configuration file, &lt;span style="font-family:courier new;"&gt;/etc/dispatch-conf.conf&lt;/span&gt;.  The easy ones to turn on, IMO, are the "automerge" options.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Check for broken packages&lt;/span&gt;&lt;br /&gt;This one is easy.  &lt;span style="font-family:courier new;"&gt;revdep-rebuild&lt;/span&gt;, which is a part of &lt;span style="font-family:courier new;"&gt;app-portage/gentoolkit&lt;/span&gt;.&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;Restart services referencing old versions of shared libraries&lt;/span&gt;&lt;br /&gt;I can't take credit for coming up with this little snippet, but I use it every time.  It's especially important after you've applied an update that was a security fix for a network service.&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example:&lt;pre&gt;&lt;span style="font-family:courier new;"&gt;# lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;console-k&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;hald&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;hald-addo&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;hald-runn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;syslog-ng&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# /etc/init.d/hald restart&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; * Caching service dependencies...                       [ ok ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; * Stopping Hardware Abstraction Layer daemon ...        [ ok ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; * Starting Hardware Abstraction Layer daemon ...        [ ok ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# /etc/init.d/syslog-ng restart&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; * Stopping syslog-ng ...                                [ ok ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; * Starting syslog-ng ...                                [ ok ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# /etc/init.d/consolekit restart&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; * Stopping ConsoleKit daemon ...                        [ ok ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; * Starting ConsoleKit daemon ...                        [ ok ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;# lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#&lt;/span&gt;&lt;/pre&gt;Essentially, it searches for open files that the filesystem has tagged as deleted, finds the process that has opened the deleted library and alphabetizes the list.  You need to manually restart any service that shows up in that list.  A little gotcha is that if &lt;span style="font-family:courier new;"&gt;sshd&lt;/span&gt; shows up in the list, you can restart it and you should stay connected to your session.  If you re-run the command above, &lt;span style="font-family:courier new;"&gt;sshd&lt;/span&gt; would still be listed as your current session is still using the old process/version of &lt;span style="font-family:courier new;"&gt;sshd&lt;/span&gt;.  If you log out and then log back in and run the command, all should be clear at that point.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Wrap up&lt;/span&gt;&lt;br /&gt;Something else that I use that I'm not going to cover here is portage's elog feature.  You configure this in &lt;span style="font-family:courier new;"&gt;/etc/make.conf&lt;/span&gt; and you can enable several forms of reporting errors, warnings, info, etc that ebuilds output to you.  I have it set up to mail them to me, one per package.  After an update, I look over the mails and check to make sure there isn't some important information in there about some action I have to take.  In the &lt;span style="font-family:courier new;"&gt;make.conf&lt;/span&gt; manpage it says "Please see &lt;span style="font-family:courier new;"&gt;/usr/share/portage/config/make.conf.example&lt;/span&gt; for elog documentation."&lt;br /&gt;&lt;br /&gt;So there you have it.  This is the process I follow both at home and at work and things have been running smoothly for the past few years.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-2722584493160655726?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/2722584493160655726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=2722584493160655726' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/2722584493160655726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/2722584493160655726'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2009/11/how-to-keep-gentoo-safely-updated.html' title='How to keep Gentoo safely updated'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-8466193387440134201</id><published>2009-10-09T07:55:00.002-04:00</published><updated>2009-10-09T08:09:21.127-04:00</updated><title type='text'>Upgrade to net-mail/courier-imap-4.5.0</title><content type='html'>After upgrading this package and running &lt;span style="font-family: courier new;"&gt;dispatch-conf&lt;/span&gt; I had to update&lt;span style="font-family:courier new;"&gt; /etc/courier-imap/imapd&lt;/span&gt;.  While doing so, I merged in the following new block:&lt;pre&gt;##NAME: IMAP_MAILBOX_SANITY_CHECK:0&lt;br /&gt;#&lt;br /&gt;# Sanity check -- make sure home directory and maildir's ownership matches&lt;br /&gt;# the IMAP server's effective uid and gid&lt;br /&gt;&lt;br /&gt;IMAP_MAILBOX_SANITY_CHECK=1&lt;br /&gt;&lt;/pre&gt;I was a little concerned, and sure enough after restarting courier and trying to check my mail, I couldn't get any messages.  I checked the mail log and saw the following:&lt;pre&gt;Oct  9 07:42:39 erma imapd-ssl: Connection, ip=[xxx.xxx.xxx.xxx]&lt;br /&gt;Oct  9 07:42:40 erma imapd-ssl: xxxx: Account's mailbox directory is not owned by the correct uid or gid&lt;/pre&gt;Rather than just disable the feature (I figured a "sanity check" is a good thing).  I searched around a bit and saw some discussion about people having issues when the group membership of the maildir wasn't the user's primary group.  So I checked the permissions on my maildir:&lt;pre&gt;drwx------ 29 dstutz root   486 2009-10-08 07:13 .&lt;/pre&gt;I tried &lt;span style="font-family:courier new;"&gt;chgrp -R users .maildir&lt;/span&gt; and tried to check my mail again:&lt;pre&gt;Oct  9 07:53:33 erma imapd-ssl: Connection, ip=[xxx.xxx.xxx.xxx]&lt;br /&gt;Oct  9 07:53:33 erma imapd-ssl: LOGIN, user=xxxx, ip=[xxx.xxx.xxx.xxx], port=[19177], protocol=IMAP&lt;/pre&gt;Yay!  So I did a preemptive &lt;span style="font-family: courier new;"&gt;chgrp&lt;/span&gt; for all the other users on my system and hopefully all will be well going forward.  I find it interesting that it even cares about the group membership since the maildir has 700 permissions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-8466193387440134201?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/8466193387440134201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=8466193387440134201' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/8466193387440134201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/8466193387440134201'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2009/10/upgrade-to-net-mailcourier-imap-450.html' title='Upgrade to net-mail/courier-imap-4.5.0'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-1072008794368608378</id><published>2008-09-17T07:22:00.006-04:00</published><updated>2008-09-17T07:31:11.809-04:00</updated><title type='text'>VNC-ish CLI</title><content type='html'>This isn't really Gentoo-specific, but it's a nice trick that you could use to share an ssh session with someone.  It works like VNC where both people have full control over the session at the same time.&lt;br /&gt;&lt;br /&gt;You need to have GNU screen installed:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;emerge -av app-misc/screen&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Start a screen session using:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;screen -S &lt;/span&gt;&lt;identifier&gt;&lt;span style="font-family: courier new;"&gt;&lt;identifier&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Have the other person start screen using:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;screen -x &lt;/span&gt;&lt;/identifier&gt;&lt;span style="font-family: courier new;"&gt;&lt;identifier&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-1072008794368608378?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/1072008794368608378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=1072008794368608378' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/1072008794368608378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/1072008794368608378'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2008/09/vnc-ish-cli.html' title='VNC-ish CLI'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-4069076181105117853</id><published>2008-03-14T09:31:00.002-04:00</published><updated>2008-03-14T09:42:32.294-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='xfs. defrag'/><title type='text'>XFS fragmentation</title><content type='html'>Check your fragmentation levels:&lt;br /&gt;# xfs_db -c frag -r /dev/vg/lv1&lt;br /&gt;actual 37387, ideal 35541, fragmentation factor 4.94%&lt;br /&gt;# xfs_db -c frag -r /dev/vg/lv2&lt;br /&gt;actual 688725, ideal 667471, fragmentation factor 3.09%&lt;br /&gt;# xfs_db -c frag -r /dev/md3&lt;br /&gt;actual 631947, ideal 624800, fragmentation factor 1.13%&lt;br /&gt;&lt;br /&gt;On Gentoo, &lt;span style="font-family:courier new;"&gt;xfs_db&lt;/span&gt; is in &lt;span style="font-family:courier new;"&gt;sys-fs/xfsprogs&lt;/span&gt; which, if you have an XFS filesystem, you should already have installed.&lt;br /&gt;&lt;br /&gt;If you want to run the defragger, the command is &lt;span style="font-family:courier new;"&gt;xfs_fsr&lt;/span&gt; and on Gentoo you need to install an additional package, &lt;span style="font-family:courier new;"&gt;sys-fs/xfsdump&lt;/span&gt;, to get it.  You can read the manpage on &lt;span style="font-family:courier new;"&gt;xfs_fsr&lt;/span&gt; for more info, but the gist is if you don't otherwise supply command line params it will start going through all of your xfs mountpoints and stop after either 10 passes or 7200 seconds.  It keeps track of where it was so you can just run it again and it will pick up where it left off if it didn't make it through all 10 passes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-4069076181105117853?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/4069076181105117853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=4069076181105117853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/4069076181105117853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/4069076181105117853'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2008/03/xfs-fragmentation.html' title='XFS fragmentation'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-4835187942786573230</id><published>2008-02-17T17:42:00.003-05:00</published><updated>2008-02-17T18:01:44.157-05:00</updated><title type='text'>dmraid != kernel raid</title><content type='html'>I didn't mention it in the previous post about migrating to hardened gentoo, but initially when I went to re-add the drive back to the mirror I was getting some errors and it wouldn't let me. mdadm told me this:&lt;br /&gt;&lt;pre&gt;mdadm: Cannot open /dev/hde1: Device or resource busy&lt;/pre&gt;I got similar output trying to add hde3 back to /dev/md3.  Those partitions are only used for raid so it was really bothering me that it said they were in use.  I googled around a bit and found a reference to the device mapper (which starts up on bootup for me because I use LVM) creating some devices based on a motherboard raid controller.  You can get a listing of what the device mapper has created using  &lt;span style="font-family:courier new;"&gt;dmsetup ls&lt;/span&gt;.  I ran the command and sure enough there were 4 devices listed starting with nvidia_.  I was able to remove 3 of the 4 using &lt;span style="font-family:courier new;"&gt;dmsetup -C &lt;devicename&gt;&lt;/devicename&gt;&lt;/span&gt; but one was saying it was busy and in use and I still couldn't add the partitions to the raid.  So I went back and edited grub.conf to remove &lt;span style="font-family:courier new;"&gt;dodmraid&lt;/span&gt; from the kernel line and restarted the system.  After it came back up I was able to hot add the 2 partitions  and get the mirrors back up and running in a non-degraded state.  Also, &lt;span style="font-family: courier new;"&gt;dmsetup ls&lt;/span&gt; now only shows my LVM VGs.  I went back and edited my &lt;span style="font-family: courier new;"&gt;genkernel.conf&lt;/span&gt; to tell it to stop adding dmraid support to my initrd in the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-4835187942786573230?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/4835187942786573230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=4835187942786573230' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/4835187942786573230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/4835187942786573230'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2008/02/dmraid-kernel-raid.html' title='dmraid != kernel raid'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-5501772953461230245</id><published>2008-02-16T13:15:00.006-05:00</published><updated>2008-02-17T00:48:22.101-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='raid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='hardened'/><title type='text'>Migrate an existing Gentoo system to hardened profile</title><content type='html'>This post is about migrating a system running a current amd64 profile to a hardened profile and all the things entailed in setting up a reasonably "hardened" Gentoo system.  I've been wanting to use hardened but in the past when I have looked into it, the process of switching would have required a downgrade of libc that portage doesn't want to allow.  Currently the hardened profile uses the same libc that I already have so this presents the opportunity to do the switch.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Covering my ass...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Since this is a potentially deadly operation (the general consensus in #gentoo-hardened was that some people have done it and it's probably ok, BUT Bad Things&amp;copy; could happen) so they don't really recommend doing so.  Because of this, I'm doing the following to help mitigate data loss.&lt;br /&gt;&lt;br /&gt;I shut down most of my services (switching to single user mode would be better, but I was too lazy to hook up monitor/kb/mouse to server...) and ran a backup to get a snapshot of the system.  My /boot and / partitions are mirrored using kernel raid and I told mdadm to kick the second drive out of each of the arrays:&lt;br /&gt;&lt;pre&gt;# mdadm /dev/md1 -f /dev/hde1&lt;br /&gt;# mdadm /dev/md3 -f /dev/hde3&lt;br /&gt;# cat /proc/mdstat&lt;br /&gt;Personalities : [raid1] [raid6] [raid5] [raid4]&lt;br /&gt;md1 : active raid1 hdg1[0]&lt;br /&gt;      40064 blocks [2/1] [U_]&lt;br /&gt;      bitmap: 2/5 pages [8KB], 4KB chunk&lt;br /&gt;&lt;br /&gt;md0 : active raid5 sdd1[1] sdc1[2] sdb1[0] sda1[3]&lt;br /&gt;      937705728 blocks level 5, 128k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;      bitmap: 0/150 pages [0KB], 1024KB chunk&lt;br /&gt;&lt;br /&gt;md3 : active raid1 hdg3[0]&lt;br /&gt;      155244032 blocks [2/1] [U_]&lt;br /&gt;      bitmap: 57/149 pages [228KB], 512KB chunk&lt;br /&gt;&lt;br /&gt;unused devices: &lt;none&gt;&lt;/pre&gt; So now all of my changes for hardened will be occurring on one drive, If I completely screw up the system and can't fix, I can just switch to the "faulty" drive and rebuild the array.  If all goes well, I just re-add the partitions to the 2 raids and they'll resync and all will be rosy.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Getting to the task at hand...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First, switch to the new profile.  You can do this with eselect.  Let's see what's avaialable on the system:&lt;br /&gt;&lt;pre&gt;# eselect profile list&lt;br /&gt;Available profile symlink targets:&lt;br /&gt;[1]   default-linux/amd64/2006.1&lt;br /&gt;[2]   default-linux/amd64/2006.1/desktop&lt;br /&gt;[3]   default-linux/amd64/2006.0/no-symlinks&lt;br /&gt;[4]   default-linux/amd64/2006.1/no-multilib&lt;br /&gt;[5]   default-linux/amd64/2007.0 *&lt;br /&gt;[6]   default-linux/amd64/2007.0/desktop&lt;br /&gt;[7]   default-linux/amd64/2007.0/no-multilib&lt;br /&gt;[8]   default-linux/amd64/2007.0/server&lt;br /&gt;[9]   hardened/amd64&lt;br /&gt;[10]  hardened/amd64/multilib&lt;br /&gt;[11]  selinux/2007.0/amd64&lt;br /&gt;[12]  selinux/2007.0/amd64/hardened&lt;/pre&gt;Change the profile:&lt;br /&gt;&lt;pre&gt;# eselect profile set 10&lt;/pre&gt;Next, you need to build the hardened toolchain:&lt;br /&gt;&lt;pre&gt;# emerge -av --oneshot binutils gcc virtual/libc&lt;/pre&gt; Tell the system to use the new (older) hardened gcc profile:&lt;br /&gt;&lt;pre&gt;# gcc-config -l&lt;br /&gt;[1] x86_64-pc-linux-gnu-3.4.6&lt;br /&gt;[2] x86_64-pc-linux-gnu-3.4.6-hardenednopie&lt;br /&gt;[3] x86_64-pc-linux-gnu-3.4.6-hardenednopiessp&lt;br /&gt;[4] x86_64-pc-linux-gnu-3.4.6-hardenednossp&lt;br /&gt;[5] x86_64-pc-linux-gnu-3.4.6-vanilla&lt;br /&gt;[6] x86_64-pc-linux-gnu-4.1.2 *&lt;br /&gt;# gcc-config x86_64-pc-linux-gnu-3.4.6&lt;br /&gt;* Switching native-compiler to x86_64-pc-linux-gnu-3.4.6 ...&lt;br /&gt;&gt;&gt;&gt; Regenerating /etc/ld.so.cache...                                                                                                  [ ok ]&lt;br /&gt;&lt;br /&gt;* If you intend to use the gcc from the new profile in an already&lt;br /&gt;* running shell, please remember to do:&lt;br /&gt;&lt;br /&gt;*   # source /etc/profile&lt;br /&gt;&lt;br /&gt;# source /etc/profile&lt;br /&gt;&lt;/pre&gt; Slight change to the /etc/make.conf CFLAGS (adding -fforce-addr, I don't know what it does but if you download a hardened stage tarball, it's set in the make.conf by default so I'm adding it here) Substitute my march for yours, of course:&lt;br /&gt;&lt;pre&gt;CFLAGS="-march=k8 -pipe -O2 -fforce-addr"&lt;/pre&gt; Next, I do a test emerge command and look for green (use flags that are changing state).  The reason you need to do this is each profile has a set of profile defined USE defaults.  The new hardened profile added a couple and removed a few in my case.  So basically, do an &lt;span style="font-family:courier new;"&gt;emerge -ave world&lt;/span&gt; and look for green and * which signifies a change in the use flag since the last time you merged a package.  Add or remove corresponding use flags to &lt;span style="font-family:courier new;"&gt;/etc/make.conf&lt;/span&gt; (or use app-portage/ufed as I do).  Keep running the &lt;span style="font-family:courier new;"&gt;emerge -ave world&lt;/span&gt; and saying n until you are happy with the output and then hit y to actually start merging.&lt;br /&gt;&lt;pre&gt;# emerge -ave world&lt;/pre&gt; If you run into any snags (a package fails to build), just note the package that failed and restart the emerge with "&lt;span style="font-family:courier new;"&gt;emerge -ave world --resume --skipfirst&lt;/span&gt;".  Obviously things can get a little tricky if the package with the problem is a core system library or something, but if you don't use &lt;span style="font-family:courier new;"&gt;--resume&lt;/span&gt;, it's going to start rebuilding the WHOLE system again.  In the past I've found it's relatively safe to "fix" the problem in another shell while continuing to build in the primary shell.&lt;br /&gt;&lt;br /&gt;So about 9 hours and 312 packages later it's done.  I restarted most of my network services just to make sure they wouldn't blow up right off the bat and everything seemed alright so far.  I emerged hardened-sources while the world was rebuilding so I kicked off genkernel to configure (according to the various hardened guides), build and install the new kernel with hardened sources.  After that I rebooted and everything still came up OK.&lt;br /&gt;&lt;br /&gt;After testing things out a bit, I re-added the second drive to the mirrors and let the arrays resync:&lt;br /&gt;&lt;pre&gt;# mdadm /dev/md1 -a /dev/hde1&lt;br /&gt;# mdadm /dev/md3 -a /dev/hde3&lt;/pre&gt; So those are the basic steps to switch over to hardened.  Remember, always have backups ready before you do something like this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-5501772953461230245?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/5501772953461230245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=5501772953461230245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/5501772953461230245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/5501772953461230245'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2008/02/migrate-existing-gentoo-system-to.html' title='Migrate an existing Gentoo system to hardened profile'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-9014638964849507584</id><published>2008-01-29T08:47:00.001-05:00</published><updated>2008-01-29T08:54:40.323-05:00</updated><title type='text'>keypad is wonky in nano</title><content type='html'>For a while now on multiple Gentoo boxes I've had an issue where the keypad keys function as if the NumLock was off even when it was on.  If I tried to type a 0 it would kick off "insert from file" function.  A little searching on Google revealed the following from the nano manpage:&lt;br /&gt;&lt;pre&gt; -K (--rebindkeypad)&lt;br /&gt;            Interpret  the  numeric  keypad keys so that they all work properly.  You should only need to use this option if they don't, as mouse support won't work&lt;br /&gt;            properly with this option enabled.&lt;/pre&gt;To fix this system-wide for everyone, just add the following to /etc/nanorc (or, on Gentoo, uncomment the line as it's probably already there: &lt;pre&gt;&lt;br /&gt;## Fix numeric keypad key confusion problem.&lt;br /&gt;set rebindkeypad&lt;/pre&gt;Alternatively, add the line to your ~/.nanorc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-9014638964849507584?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/9014638964849507584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=9014638964849507584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/9014638964849507584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/9014638964849507584'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2008/01/keypad-is-wonky-in-nano.html' title='keypad is wonky in nano'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-6574449434542384175</id><published>2008-01-25T20:31:00.000-05:00</published><updated>2008-01-25T21:23:27.694-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uuid'/><category scheme='http://www.blogger.com/atom/ns#' term='raid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='superblock'/><title type='text'>I can't find my UUID!</title><content type='html'>In the last post I showed how to reference a partition in /etc/fstab using a UUID and ran through a couple real-world scenarios for wanting to do so.&lt;br /&gt;&lt;br /&gt;This post is about the trouble I ran into looking for said UUIDs...&lt;br /&gt;&lt;br /&gt;I have 6 hard drives in my server, 2 have 3 partitions each (boot, swap, root) and are raid mirrored, the other 4 have 1 each and are set up as raid 5.  I'm only concerned with the first 2 for this post.   After seeing the error about mounting the swap on the last bootup I figured it would be an easy fix.  I knew how to list the UUIDs so I typed in that command and was greeted with a seriously lacking list of partitions:&lt;br /&gt;&lt;pre&gt;# ls -l /dev/disk/by-uuid/&lt;br /&gt;total 0&lt;br /&gt;lrwxrwxrwx 1 root root 10 2008-01-25 19:44 c2ceffb9-90be-4564-a946-9d37de7725ba -&gt; ../../hdg2&lt;br /&gt;lrwxrwxrwx 1 root root 22 2008-01-25 19:44 ca583626-4a25-4af7-b6c5-8e59a502dbc2 -&gt; ../../mapper/vg-ballzy&lt;br /&gt;lrwxrwxrwx 1 root root 22 2008-01-25 19:44 f5cc881f-210a-431f-8d52-f1e5b512b57b -&gt; ../../mapper/vg-backup&lt;br /&gt;&lt;/pre&gt;As you can see, none of the partitions from hde are listed, and only the one from hdg is listed.  I'm not sure how or why the other ones are not listed.&lt;br /&gt;&lt;br /&gt;Since the swap partitions weren't mounted I first tried mkswap to just "reformat" the swap:&lt;br /&gt;&lt;pre&gt;# mkswap /dev/hde2&lt;br /&gt;Setting up swapspace version 1, size = 1028153 kB&lt;br /&gt;no label, UUID=56c2f2af-86dd-4390-ae1a-c7fb71e6ed05&lt;br /&gt;&lt;/pre&gt;Ok, Looks good so far. Let's try turning it on:&lt;br /&gt;&lt;pre&gt;# swapon UUID=56c2f2af-86dd-4390-ae1a-c7fb71e6ed05&lt;br /&gt;swapon: cannot find the device for UUID=56c2f2af-86dd-4390-ae1a-c7fb71e6ed05&lt;br /&gt;&lt;/pre&gt;But...mkswap just told me the UUID...how can it not be found?!?!?&lt;br /&gt;&lt;br /&gt;After a little digging, I came up with the vol_id command and it clued me in to the problem:&lt;br /&gt;&lt;pre&gt;# vol_id /dev/hde2&lt;br /&gt;ID_FS_USAGE=raid&lt;br /&gt;ID_FS_TYPE=linux_raid_member&lt;br /&gt;ID_FS_VERSION=0.90.0&lt;br /&gt;ID_FS_UUID=5088bad5:89d678b2:c125e369:2e0dbcdd&lt;br /&gt;ID_FS_UUID_ENC=5088bad5:89d678b2:c125e369:2e0dbcdd&lt;br /&gt;ID_FS_LABEL=&lt;br /&gt;ID_FS_LABEL_ENC=&lt;br /&gt;ID_FS_LABEL_SAFE=&lt;br /&gt;&lt;/pre&gt;Raid member?  OK, I admit, I used to mirror my 2 swap partitions, but after seeing the performance I decided against the protection it afforded and just went back to adding 2 separate swap partitions.  It seems the raid superblock was still in the partition and mkswap wasn't overwriting it for whatever reason.&lt;br /&gt;&lt;br /&gt;After another quick google search for deleting a raid superblock, I found the proper command and here are the results:&lt;br /&gt;&lt;pre&gt;# mdadm --zero-superblock /dev/hde2&lt;br /&gt;# vol_id /dev/hde2&lt;br /&gt;ID_FS_USAGE=other&lt;br /&gt;ID_FS_TYPE=swap&lt;br /&gt;ID_FS_VERSION=2&lt;br /&gt;ID_FS_UUID=fe6bffd9-5b6b-4db9-8929-cf1575a72d67&lt;br /&gt;ID_FS_UUID_ENC=fe6bffd9-5b6b-4db9-8929-cf1575a72d67&lt;br /&gt;ID_FS_LABEL=&lt;br /&gt;ID_FS_LABEL_ENC=&lt;br /&gt;ID_FS_LABEL_SAFE=&lt;br /&gt;&lt;/pre&gt;Ahhh, the &lt;span style="font-weight: bold;"&gt;real&lt;/span&gt; UUID, and it sees it as swap as well.   I then proceeded to update the /etc/fstab after which swapon -a correctly enabled both swaps.  As to why the UUIDs are not listed under /dev, I don't know.  Maybe after a reboot the other swap will show up?  The other /dev/by-* listings show all the partitions properly.&lt;br /&gt;&lt;br /&gt;EDIT:  Since I'm running Gentoo, a simple udevstart causes udev to restart.  Now, &lt;pre&gt;ls -l /dev/disk/by-uuid/&lt;/pre&gt; shows both hde2 and hdg2 :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-6574449434542384175?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/6574449434542384175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=6574449434542384175' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/6574449434542384175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/6574449434542384175'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2008/01/i-cant-find-my-uuid.html' title='I can&apos;t find my UUID!'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7661980153269039003.post-6565457202601510677</id><published>2008-01-25T20:12:00.001-05:00</published><updated>2008-01-25T21:05:07.220-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uuid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='swap'/><title type='text'>The mystical UUID</title><content type='html'>Every filesystem (partition?) should have a uuid.  On modern Linux systems you can see them with the following command:&lt;br /&gt;&lt;pre&gt;# ls -l /dev/disk/by-uuid/&lt;br /&gt;total 0&lt;br /&gt;lrwxrwxrwx 1 root root 10 2008-01-25 19:44 c2ceffb9-90be-4564-a946-9d37de7725ba -&gt; ../../hdg2&lt;br /&gt;&lt;/pre&gt;UUIDs, while a bit cumbersome to look at, are extremely nice because you can use them in a lot of places instead of a normal device name (such as /dev/hdg2 in the above example).&lt;br /&gt;&lt;br /&gt;Tonight I moved the 2 hard drives I had plugged into the onboard IDE controller of my motherboard into a Promise Ultra100 card.  Because of this, the kernel renamed the partitions from /dev/hda and /dev/hdc to /dev/hde/ and /dev/hdg.  Upon booting the system I saw the following:&lt;br /&gt;&lt;pre&gt;swapon: cannot canonicalize /dev/hda2: No such file or directory&lt;br /&gt;swapon: cannot stat /dev/hda2: No such file or directory&lt;br /&gt;swapon: cannot canonicalize /dev/hdc2: No such file or directory&lt;br /&gt;swapon: cannot stat /dev/hdc2: No such file or directory&lt;br /&gt;&lt;/pre&gt;UUIDs will help this to never happen again.&lt;br /&gt;&lt;br /&gt;Here are the relevant lines from my old /etc/fstab:&lt;pre&gt;/dev/hda2   none    swap    sw,pri=1    0 0&lt;br /&gt;/dev/hdc2   none    swap    sw,pri=1    0 0&lt;br /&gt;&lt;/pre&gt;And the new lines:&lt;br /&gt;&lt;pre&gt;UUID=fe6bffd9-5b6b-4db9-8929-cf1575a72d67   none    swap    sw,pri=1    0 0&lt;br /&gt;UUID=e2992cf5-bc3a-4b3a-a920-d9dfbe7a5a9a   none    swap    sw,pri=1    0 0&lt;br /&gt;&lt;/pre&gt;As I said, it doesn't look as pretty, but look what happens with the old /etc/fstab:&lt;br /&gt;&lt;pre&gt;#swapon -a&lt;br /&gt;# cat /proc/swaps&lt;br /&gt;Filename                                Type            Size    Used    Priority&lt;br /&gt;&lt;/pre&gt;and the new:&lt;br /&gt;&lt;pre&gt;# swapon -a&lt;br /&gt;erma ~ # cat /proc/swaps&lt;br /&gt;Filename                                Type            Size    Used    Priority&lt;br /&gt;/dev/hde2                               partition       1004052 0       1&lt;br /&gt;/dev/hdg2                               partition       1004052 0       1&lt;br /&gt;&lt;/pre&gt;If you haven't figured it out by now, by specifying partitions by UUID, you remove the dependency on where they are physically plugged into the motherboard and any kernel naming conventions.  I recently had my SATA drives move around a bit after a BIOS update, so UUIDs would help out there as well. &lt;br /&gt;&lt;br /&gt;As it happens I had some trouble finding the (correct) UUID of one of my swap partitions but that's the topic of my next post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7661980153269039003-6565457202601510677?l=crotchety-linux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://crotchety-linux.blogspot.com/feeds/6565457202601510677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7661980153269039003&amp;postID=6565457202601510677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/6565457202601510677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7661980153269039003/posts/default/6565457202601510677'/><link rel='alternate' type='text/html' href='http://crotchety-linux.blogspot.com/2008/01/mystical-uuid.html' title='The mystical UUID'/><author><name>Dave</name><uri>http://www.blogger.com/profile/11455486516234217437</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
