<?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>jon zobrist (dot) com &#187; Linux Support &#8211; Servers</title>
	<atom:link href="http://www.jonzobrist.com/category/linux/linux-server-support/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonzobrist.com</link>
	<description>Unix, Linux, IT, Cloud, Meat</description>
	<lastBuildDate>Fri, 06 Jan 2012 18:59:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Capturing users IP addresses in Apache httpd and Tomcat logs behind an ELB</title>
		<link>http://www.jonzobrist.com/2012/01/06/capturing-users-ip-addresses-in-apache-httpd-and-tomcat-logs-behind-an-elb/</link>
		<comments>http://www.jonzobrist.com/2012/01/06/capturing-users-ip-addresses-in-apache-httpd-and-tomcat-logs-behind-an-elb/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 18:59:34 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[ELB]]></category>
		<category><![CDATA[Linux Support - Servers]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://www.jonzobrist.com/?p=462</guid>
		<description><![CDATA[
Related posts:<ol>
<li><a href='http://www.jonzobrist.com/2011/09/24/reading-peecho-minimizing-downtime-on-amazon-aws/' rel='bookmark' title='Reading : Peecho Minimizing Downtime on Amazon AWS'>Reading : Peecho Minimizing Downtime on Amazon AWS</a> <small>...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2012%2F01%2F06%2Fcapturing-users-ip-addresses-in-apache-httpd-and-tomcat-logs-behind-an-elb%2F' data-shr_title='Capturing+users+IP+addresses+in+Apache+httpd+and+Tomcat+logs+behind+an+ELB'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2012%2F01%2F06%2Fcapturing-users-ip-addresses-in-apache-httpd-and-tomcat-logs-behind-an-elb%2F' data-shr_title='Capturing+users+IP+addresses+in+Apache+httpd+and+Tomcat+logs+behind+an+ELB'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>When an Elastic Load Balancer handles a connection it sends it&#8217;s own (internal/private/10.x) address instead of the clients. It sends the clients along with the request as X-Forwarded-For. To log this you need to log X-Forwarded-For instead of the source IP.</p>
<p>Here are 2 links discussing the problem, the first covers a basic Apache &amp; Tomcat setup, but the second one has a point about direct access getting not logged and has an Apache httpd specific solution.</p>
<p><a title="Amazon ELB Capturing Client IP Address" href="http://blog.kenweiner.com/2009/09/amazon-elb-capturing-client-ip-address.html">http://blog.kenweiner.com/2009/09/amazon-elb-capturing-client-ip-address.html</a></p>
<p><a title="How to log client IP in Apache behind ELB" href="http://blog.grahampoulter.com/2011/10/how-to-log-client-ip-from-apache-behind.html">http://blog.grahampoulter.com/2011/10/how-to-log-client-ip-from-apache-behind.html</a></p>
<p>Thanks @grahampoulter and @kweiner</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="shr-publisher-462"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2012%2F01%2F06%2Fcapturing-users-ip-addresses-in-apache-httpd-and-tomcat-logs-behind-an-elb%2F' data-shr_title='Capturing+users+IP+addresses+in+Apache+httpd+and+Tomcat+logs+behind+an+ELB'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2012%2F01%2F06%2Fcapturing-users-ip-addresses-in-apache-httpd-and-tomcat-logs-behind-an-elb%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2012%2F01%2F06%2Fcapturing-users-ip-addresses-in-apache-httpd-and-tomcat-logs-behind-an-elb%2F' data-shr_title='Capturing+users+IP+addresses+in+Apache+httpd+and+Tomcat+logs+behind+an+ELB'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>Related posts:<ol>
<li><a href='http://www.jonzobrist.com/2011/09/24/reading-peecho-minimizing-downtime-on-amazon-aws/' rel='bookmark' title='Reading : Peecho Minimizing Downtime on Amazon AWS'>Reading : Peecho Minimizing Downtime on Amazon AWS</a> <small>&nbsp; What the guys over at Peecho have done is...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2012/01/06/capturing-users-ip-addresses-in-apache-httpd-and-tomcat-logs-behind-an-elb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My EC2 EBS RAID-0 creation script</title>
		<link>http://www.jonzobrist.com/2011/05/04/my-ec2-ebs-raid-0-creation-script/</link>
		<comments>http://www.jonzobrist.com/2011/05/04/my-ec2-ebs-raid-0-creation-script/#comments</comments>
		<pubDate>Thu, 05 May 2011 05:53:56 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Support - Servers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[RAID-0]]></category>
		<category><![CDATA[RAID0]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=261</guid>
		<description><![CDATA[I want to write up a full howto/tutorial, but have not had the time. Here is the script that I referred to in my post at http://jonzobrist.com/2011/04/16/ec2-raid0-on-linux-with-ebs-volumes-notes/ This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR [...]
Related posts:<ol>
<li><a href='http://www.jonzobrist.com/2011/03/19/s3-du-sh-script-to-get-bucket-size-on-amazon-aws-s3/' rel='bookmark' title='S3-du.sh script to get bucket size on Amazon AWS S3'>S3-du.sh script to get bucket size on Amazon AWS S3</a> <small>Here is my script s3-du.sh that I wrote to determine...</small></li>
<li><a href='http://www.jonzobrist.com/2011/04/16/ec2-raid0-on-linux-with-ebs-volumes-notes/' rel='bookmark' title='EC2 RAID0 on Linux with EBS volumes notes'>EC2 RAID0 on Linux with EBS volumes notes</a> <small>&nbsp; I&#8217;m almost done with my publish / post of...</small></li>
<li><a href='http://www.jonzobrist.com/2011/04/21/getting-started-with-chef/' rel='bookmark' title='Getting started with Chef.'>Getting started with Chef.</a> <small>I write a lot of scripts, configure a lot of...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F05%2F04%2Fmy-ec2-ebs-raid-0-creation-script%2F' data-shr_title='My+EC2+EBS+RAID-0+creation+script'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F05%2F04%2Fmy-ec2-ebs-raid-0-creation-script%2F' data-shr_title='My+EC2+EBS+RAID-0+creation+script'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><a href="http://jonzobrist.com/wp-content/uploads/2011/05/20110504-114718.jpg"><img class="alignleft size-medium wp-image-263" title="20110504-114718.jpg" src="http://jonzobrist.com/wp-content/uploads/2011/05/20110504-114718-224x300.jpg" alt="" width="224" height="300" /></a></p>
<p>I want to write up a full howto/tutorial, but have not had the time.</p>
<p>Here is the script that I referred to in my post at <a title="EC2 RAID0 on Linux" href="http://jonzobrist.com/2011/04/16/ec2-raid0-on-linux-with-ebs-volumes-notes/">http://jonzobrist.com/2011/04/16/ec2-raid0-on-linux-with-ebs-volumes-notes/</a></p>
<p>This program  is  distributed in  the  hope that it will  be  useful but WITHOUT ANY  WARRANTY; without  even  the  implied  warranty  of MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR  PURPOSE.  See  the <a title="GNU Public License" href="http://www.gnu.org/licenses/gpl.html" target="_blank">GNU General Public License HERE </a>for more details.</p>
<p><a href="../files/setup-ec2-raid-0.zip" target="_blank">http://jonzobrist.com/files/setup-ec2-raid-0.zip</a></p>
<p><a href="http://jonzobrist.com/files/setup-ec2-raid-0.sh.gz" target="_blank">http://jonzobrist.com/files/setup-ec2-raid-0.sh.gz</a></p>
<p>This script needs an AWS command line setup, and may need some minor tweaking if you&#8217;re not running a Ubuntu server.</p>
<p>Ubuntu&#8217;s latest AMI&#8217;s are available for <a title="Ubuntu 10.04 UEC EC2 AMIs" href="http://uec-images.ubuntu.com/releases/10.04/release/" target="_blank">10.04 here.</a></p>
<p>Please feel free to submit patches, comments, or questions.</p>
<p>Thanks to everyone whose helpful posts online and in the AWS forums helped me with this script. I could not have done it with out your generous sharing of work.</p>
<p>Enjoy!</p>
<p>&nbsp;</p>
<div class="shr-publisher-261"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F05%2F04%2Fmy-ec2-ebs-raid-0-creation-script%2F' data-shr_title='My+EC2+EBS+RAID-0+creation+script'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F05%2F04%2Fmy-ec2-ebs-raid-0-creation-script%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F05%2F04%2Fmy-ec2-ebs-raid-0-creation-script%2F' data-shr_title='My+EC2+EBS+RAID-0+creation+script'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>Related posts:<ol>
<li><a href='http://www.jonzobrist.com/2011/03/19/s3-du-sh-script-to-get-bucket-size-on-amazon-aws-s3/' rel='bookmark' title='S3-du.sh script to get bucket size on Amazon AWS S3'>S3-du.sh script to get bucket size on Amazon AWS S3</a> <small>Here is my script s3-du.sh that I wrote to determine...</small></li>
<li><a href='http://www.jonzobrist.com/2011/04/16/ec2-raid0-on-linux-with-ebs-volumes-notes/' rel='bookmark' title='EC2 RAID0 on Linux with EBS volumes notes'>EC2 RAID0 on Linux with EBS volumes notes</a> <small>&nbsp; I&#8217;m almost done with my publish / post of...</small></li>
<li><a href='http://www.jonzobrist.com/2011/04/21/getting-started-with-chef/' rel='bookmark' title='Getting started with Chef.'>Getting started with Chef.</a> <small>I write a lot of scripts, configure a lot of...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2011/05/04/my-ec2-ebs-raid-0-creation-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Chef.</title>
		<link>http://www.jonzobrist.com/2011/04/21/getting-started-with-chef/</link>
		<comments>http://www.jonzobrist.com/2011/04/21/getting-started-with-chef/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 17:08:48 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[AWS]]></category>
		<category><![CDATA[Chef]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Support - Servers]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[chef]]></category>
		<category><![CDATA[knife]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=249</guid>
		<description><![CDATA[I write a lot of scripts, configure a lot of systems, and do a lot of snapshot related backup/restore/sync stuff on servers in house, and in the cloud. Chef is a Ruby-based configuration management engine. There is a good intro here. I set up a Chef Server. There&#8217;s a good overview here. I followed the [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F04%2F21%2Fgetting-started-with-chef%2F' data-shr_title='Getting+started+with+Chef.'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F04%2F21%2Fgetting-started-with-chef%2F' data-shr_title='Getting+started+with+Chef.'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I write a lot of scripts, configure a lot of systems, and do a lot of snapshot related backup/restore/sync stuff on servers in house, and in the cloud.<br />
Chef is a Ruby-based configuration management engine. There is a good intro <a title="Chef information" href="http://www.rubyinside.com/chef-tasty-server-configuraiton-2162.html">here</a>.</p>
<p>I set up a Chef Server. There&#8217;s a good overview <a title="Chef Server Setup" href="http://vagrantup.com/docs/provisioners/chef_server.html">here.</a></p>
<p>I followed the instructions to setup a Chef server from this <a title="Setup Chef with RubyGems" href="http://wiki.opscode.com/display/chef/Bootstrap+Chef+RubyGems+Installation">Wiki on Opscode.</a></p>
<p>I also referred to the information from Grig Gheorghiu&#8217;s blog <a title="Chef installation and minimal configuration" href="http://agiletesting.blogspot.com/2010/07/chef-installation-and-minimal.html">here</a>.</p>
<p>Now that my server is up, I&#8217;m hoping to port my server configurations to Chef, with heavy reliance on <a title="Amazon EC2 AWS" href="http://aws.amazon.com/ec2/">EC2</a> and hopefully <a title="Ubuntu Enterprise Cloud UEC" href="http://www.ubuntu.com/business/cloud/overview">UEC</a>.</p>
<div class="shr-publisher-249"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F04%2F21%2Fgetting-started-with-chef%2F' data-shr_title='Getting+started+with+Chef.'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F04%2F21%2Fgetting-started-with-chef%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F04%2F21%2Fgetting-started-with-chef%2F' data-shr_title='Getting+started+with+Chef.'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2011/04/21/getting-started-with-chef/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>LCOD &#8211; 7.24.10 &#8211; Get su to respect /etc/security/limits.conf</title>
		<link>http://www.jonzobrist.com/2010/07/24/lcod-7-24-10-get-su-to-respect-etcsecuritylimits-conf/</link>
		<comments>http://www.jonzobrist.com/2010/07/24/lcod-7-24-10-get-su-to-respect-etcsecuritylimits-conf/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 14:00:29 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Command of the Day]]></category>
		<category><![CDATA[Linux Support - Servers]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[pam]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=151</guid>
		<description><![CDATA[Get su to respect settings in /etc/security/limits.conf
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F24%2Flcod-7-24-10-get-su-to-respect-etcsecuritylimits-conf%2F' data-shr_title='LCOD+-+7.24.10+-+Get+su+to+respect+%2Fetc%2Fsecurity%2Flimits.conf'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F24%2Flcod-7-24-10-get-su-to-respect-etcsecuritylimits-conf%2F' data-shr_title='LCOD+-+7.24.10+-+Get+su+to+respect+%2Fetc%2Fsecurity%2Flimits.conf'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>No idea why this isn&#8217;t the default on the latest Ubuntu, as it is for every other service in /etc/pam.d/</p>
<p>Edit /etc/pam.d/su</p>
<p>Find, and uncomment the line that says</p>
<p># session    required   pam_limits.so</p>
<p>Changes take effect on use, so you&#8217;ll have to re-su to get this to take effect.</p>
<div class="shr-publisher-151"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F24%2Flcod-7-24-10-get-su-to-respect-etcsecuritylimits-conf%2F' data-shr_title='LCOD+-+7.24.10+-+Get+su+to+respect+%2Fetc%2Fsecurity%2Flimits.conf'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F24%2Flcod-7-24-10-get-su-to-respect-etcsecuritylimits-conf%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F24%2Flcod-7-24-10-get-su-to-respect-etcsecuritylimits-conf%2F' data-shr_title='LCOD+-+7.24.10+-+Get+su+to+respect+%2Fetc%2Fsecurity%2Flimits.conf'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2010/07/24/lcod-7-24-10-get-su-to-respect-etcsecuritylimits-conf/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LCOD &#8211; 7.7.10 &#8211; Rebuilding and checking a Linux software RAID array</title>
		<link>http://www.jonzobrist.com/2010/07/07/lcod-7-7-10-rebuilding-and-checking-a-linux-software-raid-array/</link>
		<comments>http://www.jonzobrist.com/2010/07/07/lcod-7-7-10-rebuilding-and-checking-a-linux-software-raid-array/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 09:26:26 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Command of the Day]]></category>
		<category><![CDATA[Linux Support - Servers]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=144</guid>
		<description><![CDATA[Recovering an unclean ext3 or reiserfs partition when it's on a software RAID array in Linux - HOWTO.
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F07%2Flcod-7-7-10-rebuilding-and-checking-a-linux-software-raid-array%2F' data-shr_title='LCOD+-+7.7.10+-+Rebuilding+and+checking+a+Linux+software+RAID+array'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F07%2Flcod-7-7-10-rebuilding-and-checking-a-linux-software-raid-array%2F' data-shr_title='LCOD+-+7.7.10+-+Rebuilding+and+checking+a+Linux+software+RAID+array'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Often times you need to recover a disk manually, as the automatic disk check (fsck) is not willing to risk data deletion. I have yet to find an instance where answering no to it&#8217;s (fsck&#8217;s) many requests to fix things has helped in getting data back, or in getting a server back up and running.</p>
<p>With that in mind, I pretty much always run fsck -y on a filesystem when it&#8217;s unwilling to mount due to an unclean mount (hard reboot/power failure/etc). This has always been done with ext3 or resierfs journaling file systems, and I&#8217;ve yet to notice any data loss, although the risk always exists.</p>
<p>As with any tip online, you proceed at your own risk.</p>
<p>So the standard procedure to recover a disk that won&#8217;t fsck on it&#8217;s own is simple, during it&#8217;s boot process it detects the drive was unmounted uncleanly (this is the default, and every ext2 or 3 drive is marked unclean when it is mounted, and only marked unclean when it is unmounted, the theory being that if it&#8217;s not unmounted then there is potentially lost or corrupt data.), and it starts running fsck on it. It will usually give you a progress indicator, and if fsck finds any problems it drops you to a shell, where you can manually repair the disk, with fsck -y /dev/XXX.</p>
<p>However, it seems, that often if the drive is a Linux software RAID partition, then it simply reboots, and trying to boot into single user mode, or with the drive in read only mode, all fail, and the system either loops a failing fsck, or reboots, or both, ad nausea m.</p>
<p>To the rescue is any Linux live CD. Lately, I prefer a Ubuntu install in live mode, but previously to that I really liked Knoppix. Boot it up, get to a command line, and follow these steps.</p>
<p>Overview is :</p>
<ol>
<li>Boot up and get a root command line, (sudo su / su / single user mode)</li>
<li>Scan the RAID devices and build mdadm.conf file</li>
<li>Assemble each RAID device</li>
<li>fsck -y each RAID device</li>
<li>Reboot into normal / non-live CD mode</li>
<li>Success!</li>
</ol>
<p>Most newer Linux store mdadm.conf in /etc/mdadm/mdadm.conf, some will have it in /etc/mdadm.conf, and some simply won&#8217;t have it.</p>
<p>Use ls to find which one your live CD is using, and then make sure to redirect the output there. This will assume it&#8217;s /etc/mdadm/mdadm.conf</p>
<p>Once booted, at the command prompt, as root, type (assuming you&#8217;re using either RAID-0 or RAID-1, and you have 3 partitions)</p>
<pre>modprobe md
modprobe raid1
modprobe raid0
mdadm --examine --scan &gt;&gt; /etc/mdadm/mdadm.conf
mdadm /dev/md2 --assemble
mdadm /dev/md1 --assemble
mdadm /dev/md0 --assemble
cat /proc/mdstat
#verify your RAID arrays are all disks complete (should show UU)
#now check each one
fsck -y /dev/md0
fsck -y /dev/md1
fsck -y /dev/md2
#now reboot and cross your fingers it all comes up good
reboot
</pre>
<p>Some notes:<br />
If the disk isn&#8217;t heavily used, or you are using ext3 or resierfs, then you stand a decent chance of not losing any data with a fsck -y of the file system.</p>
<p>If the power was lost, or the machine locked up you may lose the last little bit of data, even on a journaled file system.</p>
<p>RAID-1 is awesome, and this can be done with a software RAID-1 even if one of the drives is failed. You can also just mount the disk without RAID, and operate as if it never was in an array.</p>
<p>You can do other maintenance on the drives, such as mount them (mount /dev/md2 /mnt/md2) and modify/copy/backup data/etc instead of, or in addition to, fsck&#8217;ing them.</p>
<p>I&#8217;ve had the best luck with ext3 and resierfs. I&#8217;ve read bad things about XFS, JFS, and other file systems.</p>
<p>I would love for Linux to support ZFS, as I&#8217;ve played with it on Open Solaris, and Sun&#8217;s VM of their storage appliance, and it seems nice.</p>
<p>Enjoy!</p>
<div class="shr-publisher-144"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F07%2Flcod-7-7-10-rebuilding-and-checking-a-linux-software-raid-array%2F' data-shr_title='LCOD+-+7.7.10+-+Rebuilding+and+checking+a+Linux+software+RAID+array'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F07%2Flcod-7-7-10-rebuilding-and-checking-a-linux-software-raid-array%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F07%2F07%2Flcod-7-7-10-rebuilding-and-checking-a-linux-software-raid-array%2F' data-shr_title='LCOD+-+7.7.10+-+Rebuilding+and+checking+a+Linux+software+RAID+array'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2010/07/07/lcod-7-7-10-rebuilding-and-checking-a-linux-software-raid-array/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

