<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Josh Olson&#039;s Blog &#187; Linux</title>
	<atom:link href="http://www.jpolson.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jpolson.com</link>
	<description>A blog about Security, Programming, and System Analysis.</description>
	<lastBuildDate>Thu, 02 Apr 2009 19:28:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Software raid 1 &#8211; Failing and recovering a disk</title>
		<link>http://www.jpolson.com/20080429/failing-a-software-raid-1-disk-with-software-raid/</link>
		<comments>http://www.jpolson.com/20080429/failing-a-software-raid-1-disk-with-software-raid/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 23:16:38 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://josh.choosechose.com/20080429/failing-a-software-raid-1-disk-with-software-raid/</guid>
		<description><![CDATA[A software raid group disk failed in one of my servers yesterday.
The kernel was spewing SCSI errors:
kernel: ata2: status=0xd0 { Busy }
kernel: SCSI error :  return code = 0&#215;8000002

# mdadm --display /dev/md0
# mdadm --display /dev/md1
both reported a failed disk sdb*
The procedure to rebuild the md groups is as follows:
Replace bad disk (sdb in this [...]]]></description>
			<content:encoded><![CDATA[<p>A software raid group disk failed in one of my servers yesterday.</p>
<p>The kernel was spewing SCSI errors:</p>
<p>kernel: ata2: status=0xd0 { Busy }<br />
kernel: SCSI error :  return code = 0&#215;8000002<br />
<code><br />
# mdadm --display /dev/md0<br />
# mdadm --display /dev/md1</code></p>
<p>both reported a failed disk sdb*</p>
<p>The procedure to rebuild the md groups is as follows:</p>
<p>Replace bad disk (sdb in this scenario.) Note that if you do not bring down the server to replace the disk, be sure to &#8220;remove&#8221; the disk from the raid groups using mdadm.</p>
<p><code># mdadm --remove /dev/md0 /dev/sdb0<br />
# mdadm --remove /dev/md1 /dev/sdb1</code></p>
<p>Read the good disk&#8217;s partition table (sda in this scenario.)<br />
<code><br />
# fdisk -l /dev/sda<br />
Disk /dev/sda: 160.0 GB, 160041885696 bytes<br />
255 heads, 63 sectors/track, 19457 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
</code><code><br />
   Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          13      104391   fd  Linux raid autodetect<br />
/dev/sda2              14       19457   156183930   fd  Linux raid autodetect<br />
</code><br />
Install identical partition table on newly replaced disk. Create partitions that start and end on the same listed cylinders and are of type &#8220;fd.&#8221; Be sure to set the boot flag, and don&#8217;t forget to write the changes.<br />
<code><br />
# fdisk /dev/sdb</code></p>
<p>Add partitions back to the appropriate raid groups.<br />
<code><br />
# mdadm --add /dev/md0 /dev/sdb0<br />
# mdadm --add /dev/md1 /dev/sdb1</code></p>
<p>Ensure the raid groups are rebuilding properly.<br />
<code><br />
# mdadm --display /dev/md0<br />
# mdadm --display /dev/md1</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpolson.com/20080429/failing-a-software-raid-1-disk-with-software-raid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching and executing with find(1)</title>
		<link>http://www.jpolson.com/20080417/the-power-of-find1/</link>
		<comments>http://www.jpolson.com/20080417/the-power-of-find1/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 01:04:49 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://josh.choosechose.com/20080417/the-power-of-find1/</guid>
		<description><![CDATA[This afternoon I was faced with searching a directory tree for large files that have rotated within the last 24 hours &#8211; a symptom of a problem we were experiencing with a service.
Here&#8217;s what I put together quickly:
# find -iname name-\*.log -mtime 0 -exec du -sh {} \;
Explanation of the switches (from the find man [...]]]></description>
			<content:encoded><![CDATA[<p>This afternoon I was faced with searching a directory tree for large files that have rotated within the last 24 hours &#8211; a symptom of a problem we were experiencing with a service.</p>
<p>Here&#8217;s what I put together quickly:</p>
<p><code># find -iname name-\*.log -mtime 0 -exec du -sh {} \;</code></p>
<p>Explanation of the switches (from the find man page):<br />
<code><br />
-iname <em>pattern</em><br />
Base  of  file  name  (the  path with the leading directories removed) matches case insensitive shell pattern <em>pattern</em><br />
</code><code><br />
-mtime <em>n</em><br />
data was last modified <em>n</em>*24 hours ago.<br />
</code><code><br />
-exec <em>command</em> {} \;<br />
run the specified <em>command</em> on the matched files<br />
</code></p>
<p>It&#8217;s not complex (and probably not post-worthy,) but someone may find it helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jpolson.com/20080417/the-power-of-find1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
