<?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>/root.eu &#187; linux</title>
	<atom:link href="http://slashroot.eu/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://slashroot.eu</link>
	<description>Notepad of geeky sysadmin</description>
	<lastBuildDate>Thu, 10 May 2012 16:41:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>My tips and impression on RHCSA and RHCE exams</title>
		<link>http://slashroot.eu/2011/06/23/my-tips-and-impression-on-rhcsa-and-rhce-exams/</link>
		<comments>http://slashroot.eu/2011/06/23/my-tips-and-impression-on-rhcsa-and-rhce-exams/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 13:03:22 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[exam]]></category>
		<category><![CDATA[rhca]]></category>
		<category><![CDATA[rhce]]></category>
		<category><![CDATA[rhcsa]]></category>
		<category><![CDATA[rhel6]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=258</guid>
		<description><![CDATA[Last friday I took two exams &#8211; EX200 and EX300.  I didn`t take any courses as I was preparing by myself at home. I must say that it was more challenging that 4 years earlier when I had taken my &#8230; <a href="http://slashroot.eu/2011/06/23/my-tips-and-impression-on-rhcsa-and-rhce-exams/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last friday I took two exams &#8211; EX200 and EX300.  I didn`t take any courses as I was preparing by myself at home. I must say that it was more challenging that 4 years earlier when I had taken my previous RHCE exam. First of all <strong>RHEL6</strong> gained new features compared to<strong> RHEL4</strong>. Second thing is that they added pretty much more tasks and objectives in exam requirements. You can find them in prep guides available <a href="http://www.europe.redhat.com/training/course/guide/EX200">here</a> (for RHCSA) and <a href="http://www.europe.redhat.com/training/course/guide/EX300">here</a> (for RHCE).</p>
<p>And this is my first tip &#8211; use these guides and follow all of objectives. For example if there`s a task about iSCSI initiator then learn and make some exercises. You have to follow <strong>all</strong> of these objectives. It`s especially important to people like me who didn`t take any course before, because it`s harder to make yourself some excercises. I was using two virtual machines for this purpose &#8211; one of them was a server with some services (nfs, ldap, iscsi target, etc..) and one was a client.</p>
<p>Second thing &#8211; don`t forget about <strong>SELinux</strong>. All of services must be SELinux enabled. Do <strong>not</strong> turn this off during your study. If you`re not familiar with SELinux then read <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/index.html">this</a> documentation &#8211; it`s really good and helpful. I recommend reading it at least twice and check all of described commands/tools.</p>
<p>Documentation. I think that Red Hat guys did a really good job creating a bunch of nice docs available on their <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/">site</a>.  I recommend reading all of them as they describe most of exam objectives with nice examples. Unfortunately it`s not available during the exam and you must also know how to use manual pages (e.g. <em>man httpd_selinux</em> &#8211; describes options on selinux configuration of httpd service) and use it. Also config examples in <strong>/usr/shared/doc/*</strong> are pretty useful. That`s a very nice thing in Red Hat exams &#8211; when you forgot some detail you can always use built-in documentation. They don`t require you to remember all of options although you must know how particular services work. So my tip is this &#8211; learn how to find info on something using documentation available in you system rather than just ask google like you (probably) always do <img src='http://slashroot.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>And last but not least tip &#8211; get yourself a good sleep night before exam. I didn`t take any notes nor my laptop &#8211; try to relax and think positive. If you learn  and practice then everything will go smoothly.</p>
<p>Of course I have passed both exams and got both RHCSA and RHCE certificates <img src='http://slashroot.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  In my personal opinion I consider RHCSA to be more challenging than RHCE &#8211; just look at exam objectives. RHCE adds SElinux and some basic configuration of network services while RHCSA covers a lot of other things. I recommend taking two exams on one day &#8211; it`s not that scary as you think.</p>
<p>Good luck to all of you preparing and studying! I`m starting preparation for <strong>RHCA</strong> exams. I`ll try to write some tips on them too. Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2011/06/23/my-tips-and-impression-on-rhcsa-and-rhce-exams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RHEL6 and ldap server with ssl</title>
		<link>http://slashroot.eu/2011/06/13/rhel6-and-ldap-server-with-ssl/</link>
		<comments>http://slashroot.eu/2011/06/13/rhel6-and-ldap-server-with-ssl/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 12:03:51 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[rhel6]]></category>
		<category><![CDATA[slapd]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=252</guid>
		<description><![CDATA[During my preparation for RHCSA+RHCE exams (I have to recertificate as I passed my previous RHCE on RHEL4) I encountered some serious problems with ssl and openldap (slapd) server. I created self-signed certificate: openssl req -new -x509 -nodes -out /etc/pki/tls/certs/slapd.crt &#8230; <a href="http://slashroot.eu/2011/06/13/rhel6-and-ldap-server-with-ssl/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>During my preparation for RHCSA+RHCE exams (I have to recertificate as I passed my previous RHCE on RHEL4) I encountered some <em>serious</em> problems with ssl and openldap (slapd) server.</p>
<p>I created self-signed certificate:</p>
<pre>openssl req -new -x509 -nodes -out /etc/pki/tls/certs/slapd.crt -keyout /etc/pki/tls/certs/slapd.key -days 365</pre>
<p>and added following lines to <strong>/etc/openldap/slapd.d/cn=config/olcDatabase={1}bdb.ldif</strong></p>
<pre>olcTLSCACertificateFile: /etc/pki/tls/certs/slapd.crt
olcTLSCertificateKeyFile: /etc/pki/tls/certs/slapd.key</pre>
<p>Everything seemed to work fine, but I couldn`t query ldap using ldaps uri &#8211; I got the following error message:</p>
<pre>ldapsearch -x  -H ldaps://localhost -b 'dc=example,dc=com'
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)</pre>
<p>After short and intensive investigation, reading dozens of howto pages I founded the cause &#8211; it turned out that in RHEL6 you <strong>can`t</strong> use self-signed certificates. Well, maybe it`s not that they forbid you to do this, but it`s not as simple as it was in previous versions. Now you have to explicitly add your certificate so that is no longer unknown. There`s even more &#8211; you have to configure your <strong>Common Name</strong> field of the certificate so it matches exactly your server`s name.</p>
<p>So eventually to solve this issue I had to confgure ldap tools/clients and add path to server`s certificate to <strong>/etc/openldap/ldap.conf</strong>:</p>
<pre>TLS_CACERT /etc/pki/tls/certs/slapd.crt</pre>
<p>So nothing is the same now &#8211; RHEL6 brings new features, new tools and new problems <img src='http://slashroot.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  It`s time to learn and adapt.</p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2011/06/13/rhel6-and-ldap-server-with-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problem with grub &#8211; can`t find stage1</title>
		<link>http://slashroot.eu/2011/04/07/problem-with-grub-cant-find-stage1/</link>
		<comments>http://slashroot.eu/2011/04/07/problem-with-grub-cant-find-stage1/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 06:21:48 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[stage1]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=245</guid>
		<description><![CDATA[If you were moving system from one machine to another (e.g. physical to virtual machine) and you stuck on installing grub to mbr: root (hd0,0) setup (hd0) Checking if "/boot/grub/stage1" exists... no Checking if "/grub/stage1" exists... no then I have &#8230; <a href="http://slashroot.eu/2011/04/07/problem-with-grub-cant-find-stage1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you were moving system from one machine to another (e.g. physical to virtual machine) and you stuck on installing grub to mbr:</p>
<pre>root (hd0,0)
setup (hd0)
 Checking if "/boot/grub/stage1" exists... no
 Checking if "/grub/stage1" exists... no</pre>
<p>then I have a solution for you. If you checked dozens of pages (like I did) that say there`s a problem with your grub files and you checked them hundred times that everything is fine (files were there, you can still install grub on the source system using exactly the same set of files) then do not loose hope <img src='http://slashroot.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  You might want to check if your grub is able to read your filesystem. Maybe you created fs using newer tools. I was moving Fedora Core 3 using sysrescuecd. I created partition and filesystem using tools available on that system. It seems that probably there were minor changes between ext3 fs created on FC3 and sysrecurecd and therefore after chrooting to FC3 environment I couldn`t install grub.</p>
<p>The solution is quite simple &#8211; do it <strong>outside</strong> chroot environment!</p>
<p>Once you have mounted your root partition with /boot install mbr using grub from your livecd environment. In my case I had it mounted on <strong>/mnt/custom</strong> so I had to enter the following command to install grub on <strong>/dev/sda</strong>:</p>
<pre>grub-install --root-directory=/mnt/custom /dev/sda</pre>
<p>I didn`t find a way to do this using grub command line, but using grub-install I was able to boot my system and that was what I needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2011/04/07/problem-with-grub-cant-find-stage1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List installed dpkg and rpm packages with their size</title>
		<link>http://slashroot.eu/2010/11/03/list-installed-dpkg-and-rpm-packages-with-their-size/</link>
		<comments>http://slashroot.eu/2010/11/03/list-installed-dpkg-and-rpm-packages-with-their-size/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 11:54:04 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oneliners]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=217</guid>
		<description><![CDATA[Some time ago I found a small script dpkg-du used to list dpkg packages and size of files that belongs to them. Unfortunately I couldn`t find it now when I needed it, but few minutes with manual brought me to &#8230; <a href="http://slashroot.eu/2010/11/03/list-installed-dpkg-and-rpm-packages-with-their-size/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some time ago I found a small script <strong>dpkg-du</strong> used to list dpkg packages and size of files that belongs to them. Unfortunately I couldn`t find it now when I needed it, but few minutes with manual brought me to this trivial oneliner: </p>
<p><code>dpkg-query -W -f='${Installed-Size} ${Package}\n'</code></p>
<p>And here`s a rpm version:</p>
<p><code>rpm -qa --queryformat '%{SIZE} %{NAME}\n'</code></p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2010/11/03/list-installed-dpkg-and-rpm-packages-with-their-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Permission denied when mounting nfs share</title>
		<link>http://slashroot.eu/2010/06/10/permission-denied-when-mounting-nfs-share/</link>
		<comments>http://slashroot.eu/2010/06/10/permission-denied-when-mounting-nfs-share/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 08:40:26 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[nfs]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=205</guid>
		<description><![CDATA[I had a problem with nfs share today. I couldn`t mount it on remote server. It failed with the following error: mount: xxx:/yyy failed, reason given by server: Permission denied I checked the configuration dozens of times &#8211; it was &#8230; <a href="http://slashroot.eu/2010/06/10/permission-denied-when-mounting-nfs-share/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had a problem with nfs share today. I couldn`t mount it on remote server. It failed with the following error:</p>
<p><code><br />
mount: xxx:/yyy failed, reason given by server: Permission denied<br />
</code></p>
<p>I checked the configuration dozens of times &#8211; it was good, and the nfs server granted access to the share. The following info appeared in logs:</p>
<p><code><br />
.. authenticated mount request from 1.1.1.1 for /yyy<br />
</code></p>
<p>So everything looked ok, but it didn`t work. The problem was a pseudo filesystem <b>nfsd</b> which should be mounted in <b>/proc/fs/nfsd</b>, but for some reason it wasn`t. I`ve added the following entry to <b>/etc/fstab</b></p>
<p><code><br />
none                    /proc/fs/nfsd           nfsd    defaults        0 0<br />
</code></p>
<p></br></p>
<p>and mounted it:</p>
<p><code><br />
mount /proc/fs/nfsd<br />
</code></p>
<p>After that I was able to mount the nfs share. It took me some time to figure it out and I think that there should be more specific error messages, because the one with <i>permission denied</i> is quite confusing.</p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2010/06/10/permission-denied-when-mounting-nfs-share/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advantages of software raid</title>
		<link>http://slashroot.eu/2010/04/02/advantages-of-software-raid/</link>
		<comments>http://slashroot.eu/2010/04/02/advantages-of-software-raid/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 08:07:55 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[backup]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[linux raid backup]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=184</guid>
		<description><![CDATA[Why using software raid when there are plenty hardware raid controllers with dedicated processors for checksum calculations, dedicated memory, cache and bbu? Well there is one major advantage of software raid solutions &#8211; hardware independence. Recently we had a simultaneously &#8230; <a href="http://slashroot.eu/2010/04/02/advantages-of-software-raid/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Why using software raid when there are plenty hardware raid controllers with dedicated processors for checksum calculations, dedicated memory, cache and bbu? Well there is one major advantage of software raid solutions &#8211; hardware independence.<br />
Recently we had a simultaneously crash of two disks in <strong>raid5</strong> on <strong>3ware 9550-sxu</strong> controller. That`s a real bad luck :-&gt; Of course we recovered data from backups, but before that we tried to rebuild array. We discovered that one dik had crashed, but the other had just few bad sectors. As an experiment we cloned that disk without these few sectors and tried to rebuild the array. Unfortunatelly controller didn`t recognize that disk as a member of the array. It turned out that <strong>3ware</strong> controller appends serial numbers of all members of array at the end of disks with a checksum (we tried to replace serial number of cloned disk with no luck).<br />
So how would it look on software raid? Much easier. Linux for example writes only array identificator (UUID) so disk cloning is possible. Furthermore disks can be transfered to another hardware. With 3ware controller in case of its failure we would have to find another 3ware controller (probably the same model).<br />
So a lesson has been taught &#8211; don`t rely on hardware raid, use <strong>raid6</strong> when possible and keep your backups safe because they may save your ass someday <img src='http://slashroot.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2010/04/02/advantages-of-software-raid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO Massive virtual hosting on tomcat</title>
		<link>http://slashroot.eu/2010/01/07/howto-massive-virtual-hosting-on-tomcat/</link>
		<comments>http://slashroot.eu/2010/01/07/howto-massive-virtual-hosting-on-tomcat/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 07:33:54 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=148</guid>
		<description><![CDATA[I found out today that tomcat virtual hosts are pretty lame. I thought that these all java based tomcat`s fancy plugins are much more powerful than old, simpleapache httpd. Well they aren`t. I wasn`t able to configure massive virtual hosting &#8230; <a href="http://slashroot.eu/2010/01/07/howto-massive-virtual-hosting-on-tomcat/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I found out today that tomcat virtual hosts are pretty lame. I thought that these all java based tomcat`s fancy plugins are much more powerful than old, <em>simple</em>apache httpd. Well they aren`t. I wasn`t able to configure massive virtual hosting for servlets. I wanted to run diffrent web application based on domain name that comes in URL. For example <code>myapp1.example.com</code> would run application <code>myapp1</code>, <code>myapp2.example.com</code> would run <code>myapp2</code>, etc. And there could be hundreds of them so I didn`t want to add hundreds of entries in <code>server.xml</code> config file. I`m a lazy person <img src='http://slashroot.eu/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>In order to configure virtual hosting based on above assumptions I used apache http server as a proxy to tomcat.<br />
First you need to add wildcard records to your domain (<code>example.com</code>) so that records of all its subdomains can be resolved to IP address of your server. Following record should be added to your bind server zone config:</p>
<pre>
*   IN   A   1.2.3.4
</pre>
<p>where <code>1.2.3.4</code> is IP address of your server.</p>
<p>Next you need to configure httpd server. Please make sure that you have ajp proxy module installed on your server, as connections to tomcat are based on AJP protocol. On CentOS/RHEL 5 this module is included in standard httpd package (see <code>/etc/httpd/conf.d/proxy_ajp.conf</code>).<br />
Now you need to create configuration for your virual hosts. I created a new file <code>/etc/httpd/conf.d/tomcat-vhosting.conf</code>:</p>
<pre>
UseCanonicalName Off
RewriteEngine On

# vhost map using perl script
RewriteMap vhost prg:/usr/local/bin/apache-getvhost.pl

# do no rewrite restricted names
RewriteCond %{SERVER_NAME} !^docs\.
RewriteCond %{SERVER_NAME} !^examples\.
RewriteCond %{SERVER_NAME} !^host-manager\.
RewriteCond %{SERVER_NAME} !^ROOT\.

# rewrite it
RewriteRule ^/(.*)$ ajp://localhost:8009/${vhost:%{SERVER_NAME}}/$1 [P]
</pre>
<p>Quite simple and cool, isn`t it? <img src='http://slashroot.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I`m sure that you probably expected <code>VirtualHost</code> directives, but all you need is a powerfull rewriting feature of apache. This configuration allows to access myapp application located in tomcat`s webapps directory via <code>http://myapp.example.com</code>.<br />
I used custom rewrite map which is a simple perl script. All it does is extract subdomain from server name based on URL.</p>
<p>Put the following in <code>/usr/local/bin/apache-getvhost.pl</code></p>
<pre>
#!/usr/bin/perl

$| = 1;

while (&lt;STDIN&gt;) {
  if (/(.*?)\.example\.com/)      {
      print $1."\n";
  } else {
      print $_."\n";
  }
}
</pre>
<p>and make it executable</p>
<pre>
chmod +x /usr/local/bin/apache-getvhost.pl
</pre>
<p>Now all you need to do is provide some applications to tomcat.</p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2010/01/07/howto-massive-virtual-hosting-on-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Booting Xen paravirtualized vm in rescue mode</title>
		<link>http://slashroot.eu/2009/12/22/booting-xen-paravirtualized-vm-in-rescue-mode/</link>
		<comments>http://slashroot.eu/2009/12/22/booting-xen-paravirtualized-vm-in-rescue-mode/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 13:33:45 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=136</guid>
		<description><![CDATA[This is my first post in english. I am sorry if there are some mistakes &#8211; it is not my native language Recently I had to rename volume group in one of my virtual machines. It is based on CentOS &#8230; <a href="http://slashroot.eu/2009/12/22/booting-xen-paravirtualized-vm-in-rescue-mode/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is my first post in english. I am sorry if there are some mistakes &#8211; it is not my native language <img src='http://slashroot.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Recently I had to rename volume group in one of my virtual machines. It is based on CentOS (both dom0 and domU) and it was paravirtualized. I couldn`t do it on running system because root partition was on logical volume. I had to boot the machine in rescue mode. I had no idea how to boot from CD/DVD iso image &#8211; AFAIK it is impossible on pv guests. I had to boot vm directly from kernel and initrd used in installation (both are xen aware). So I copied  them to ﻿<strong>/tmp/xen</strong> from <strong>/images/xen/</strong> on CD/DVD installation disc.</p>
<p>Then I had to comment out the following line from vm`s config file to bypass pygrub bootloader:<br />
<code><br />
#bootloader = "/usr/bin/pygrub"<br />
</code></p>
<p>Now I needed to tell my vm to use kernel and initrd I had previously copied so I added the following lines:<br />
<code><br />
kernel = "/tmp/xen/vmlinuz"<br />
ramdisk = "/tmp/xen/initrd.img"<br />
extra = "rescue method=http://192.168.0.2/install/centos/"<br />
</code></p>
<p>The last line passes extra arguments to kernel. There is a rescue keyword and a method which tells anaconda installer to get install files from my http server.</p>
<p>After that I was able to boot vm in rescue and rename my LVM virtual group.</p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2009/12/22/booting-xen-paravirtualized-vm-in-rescue-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Klastrowy LVM i Xen</title>
		<link>http://slashroot.eu/2009/11/23/klastrowy-lvm-i-xen/</link>
		<comments>http://slashroot.eu/2009/11/23/klastrowy-lvm-i-xen/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 19:19:45 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[clvm]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=121</guid>
		<description><![CDATA[Bardzo intensywnie wykorzystuję wirtualizację jaką oferuje CentOS, czyli opensource`ową wersję Xena. W połączeniu z LVM można bardzo efektywnie zarządzać maszynami m.in. poprzez snapshoty. Dodatkowo zastosowanie LVM jako backendu storage`owego owocuje wysoką wydajnością. Xen posiada również możliwość migracji maszyn. Funkcja ta &#8230; <a href="http://slashroot.eu/2009/11/23/klastrowy-lvm-i-xen/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Bardzo intensywnie wykorzystuję wirtualizację jaką oferuje CentOS, czyli opensource`ową wersję Xena. W połączeniu z LVM można bardzo efektywnie zarządzać maszynami m.in. poprzez snapshoty. Dodatkowo zastosowanie LVM jako backendu storage`owego owocuje wysoką wydajnością.</p>
<p>Xen posiada również możliwość migracji maszyn. Funkcja ta znana jako <em>live migration</em> jest odpowiednikiem <em>vmotion</em> dla produktów VMware. Można ją wykorzystać jedynie w przypadku, gdy wszystkie serwery <em>dom0</em> mają dostęp do współdzielonego storage`u. Najłatwiej jest wykorzystać zasób NFS podmontowany na wszystkich serwerach, a maszyny wirtualne instalować na plikach (obrazy dysków) tam umieszczonych. Oczywiście tracimy na wydajności, a poza tym NFS nie wydaje się dobrym pomysłem dla większych instalacji.<br />
I tu z pomocą przychodzi klastrowa odmiana LVM (<strong>CLVM</strong>). W RHEL/CentOS demon zarządzający klastrową częścią LVM (clvmd) komunikuje się z menadżerem klastra <strong>RHCS</strong> (<em>Red Hat Cluster Suite</em>). Mi osobiście to niezbyt pasuje. Nie tylko chyba ja uważam, że twór RHCS nie jest jeszcze stabilny ani też łatwy w konfiguracji i zarządzaniu/utrzymaniu. Ale to już chyba temat na odrębny wpis. Ku czemu innemu zmierzam. Mianowicie bardzo zainteresował mnie <a href="http://www.pixelchaos.net/2009/04/23/openais-an-alternative-to-clvm-with-cman/">ten</a> wpis. Okazuje się, że jest możliwe zmuszenie CLVM do działania bez skonfigurowanego RHCS! Należy zamiast tego użyć openais, który i tak wchodzi w skład RHCS. Jako odrębna część jest jednak o wiele przyjemniejsza w zarządzaniu i konfiguracji. Zachęcony wspomnianym wpisem przystąpiłem do pracy. Udało mi się przerobić paczkę <strong>lvm2-cluster</strong>, tak aby linkowała się z openais. Wpis ten byłby chyba pierwszym howto w sieci opisującym ten proces dla systemów RHEL/CentOS. Niestety w trakcie działania pojawiają się wycieki w pamięci w demonie <strong>aisexec</strong>. Przy każdorazowym wysłaniu wiadomości do aisexec przez demon clvmd ten pierwszy rezerwuje około <strong>6MB</strong> pamięci i nie zwalnia jej poprawnie. Kilkunastogodzinne próby nie przyniosły rozwiązania. Wielka szkoda. Byłaby to świetna wiadomość i dalsze pole do eksperymentowania. Liczę, że uda mi się jeszcze powrócić do tematu, a o rezultatach postaram się niezwłocznie poinformować.</p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2009/11/23/klastrowy-lvm-i-xen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Softraid i autodetekcja</title>
		<link>http://slashroot.eu/2009/10/06/softraid-i-autodetekcja/</link>
		<comments>http://slashroot.eu/2009/10/06/softraid-i-autodetekcja/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 07:30:35 +0000</pubDate>
		<dc:creator>root</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[softraid]]></category>

		<guid isPermaLink="false">http://slashroot.eu/?p=113</guid>
		<description><![CDATA[Zdarzyło mi się niedawno dołączyć dodatkowy dysk do działającego już systemu celem utworzenia redundancji na wszystkich partycjach (lub też na wolumenach LVM). Wszystko to działo się na Ubuntu 8.04 LTS, a więc prawie na debianie Całość procesu jest dość prosta &#8230; <a href="http://slashroot.eu/2009/10/06/softraid-i-autodetekcja/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Zdarzyło mi się niedawno dołączyć dodatkowy dysk do działającego już systemu celem utworzenia redundancji na wszystkich partycjach (lub też na wolumenach LVM). Wszystko to działo się na Ubuntu 8.04 LTS, a więc <em>prawie</em> na debianie <img src='http://slashroot.eu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Całość procesu jest dość prosta i opisywana już w wielu artykułach w sieci ( m.in. <a href="http://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-lvm-system-incl-grub-configuration-debian-lenny">tutaj</a> ). Wszędzie niemalże wspomina się o ustawianiu typu partycji na <strong>fd</strong>, czyli <strong>Linux raid autodetect</strong>. Nazwa sugeruje, że ma to coś wspólnego z autowykrywaniem raidu. Otóż okazuje się, że miało w przeszłości. Parametry konfiguracyjny <strong>CONFIG_MD_AUTODETECT</strong> zniknął już jakiś czas temu z kernela i tym samym zniknęła też autodetekcja. Opisuje to <a href="http://linux-raid.osdl.org/index.php/RAID_Boot">ten</a> artykuł. Jest tam geneza usunięcia autodetekcji i rozwiązanie problemu bootowania z raidu 1. Wiąże się to z odpowiednio wygenerowanym plikiem initramfs. Ja się złapałem na tym, że system nie wstawał poprawnie, gdyż liczyłem że odpowiednio poustawiane typy partycji zrobią swoje i podczas startu wszystkie macierze samoczynnie wystartują. Krótka analiza struktury initramfs i kilka minut na googlach przyniosły rozwiązanie. Musiałem powiadomić mdadm o istnieniu macierzy, a zatem po ich utworzeniu wywołać polecenie</p>
<p><code>mdadm --examine --scan &gt;&gt; /etc/mdadm.conf</code></p>
<p>Następnie należy wygenerować plik initramfs uwzględniający te zmiany &#8211; załączy on ten plik do swojego drzewa i podczas startu odpowiednio wywołany mdadm z poziomu initramfs wystartuje podane tam macierze.<br />
W Ubuntu generujemy nowy initramfs dla obecnego kernela poleceniem</p>
<p><code>update-initramfs -u</code></p>
<p>Teraz już możemy cieszyć się mirrorowaną partycją /boot.</p>
]]></content:encoded>
			<wfw:commentRss>http://slashroot.eu/2009/10/06/softraid-i-autodetekcja/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

