<?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>unixpowered.com &#187; linux</title>
	<atom:link href="http://www.unixpowered.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.unixpowered.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 21 Jul 2010 13:42:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux multipathing</title>
		<link>http://www.unixpowered.com/blog/2009/11/27/linux-multipathing/</link>
		<comments>http://www.unixpowered.com/blog/2009/11/27/linux-multipathing/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 22:40:46 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[fibre channel]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux tips]]></category>
		<category><![CDATA[multipathing]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.unixpowered.com/blog/?p=381</guid>
		<description><![CDATA[I use MPxIO in Solaris quite often and it works very well for me. This time I needed to test out I/O multipathing in RedHat. What I really needed to do: have a server with two HBA&#8217;s manage a mirror which has submirrors on separate SAN&#8217;s; so that the server has multiple paths to each [...]]]></description>
			<content:encoded><![CDATA[<p>I use MPxIO in Solaris quite often and it works very well for me. This time I needed to test out I/O multipathing in RedHat. What I really needed to do: have a server with two HBA&#8217;s manage a mirror which has submirrors on separate SAN&#8217;s; so that the server has multiple paths to each submirror. That way, if an HBA goes the server has still connection to both submirrors through the remaining HBA. </p>
<p>Gear used in this &#8220;experiment&#8221;:</p>
<ul>
<li>Dell Poweredge server.</li>
<li>Two Qlogic QLA2310 HBA&#8217;s.</li>
<li>RHEL Server 5.3 x86.</li>
<li>Two SAN&#8217;s presenting one LUN each.</li>
</ul>
<p>Rough steps I took to get this working:</p>
<ol>
<li>Make sure device mapper package is installed.</li>
<li>Present two LUN&#8217;s from two SAN&#8217;s.</li>
<li>Probe HBA&#8217;s for presented LUN&#8217;s.</li>
<li>Configure multipathing.</li>
</ol>
<p>First and foremost, make sure <em>qla2xxx</em> driver is loaded. You also have to make sure you have <em>device-mapper-multipath-0.4.7-23.el5</em> installed. Next, configure multipathing daemon so that it starts on boot:</p>
<p><code>[root@carbon ~]# <strong>chkconfig multipathd on</strong></code></p>
<p>When that&#8217;s done you need to make the system aware of the presented LUN&#8217;s. One way to do so is to reboot the server. Another option is to force HBA scan:</p>
<p><code>[root@carbon ~]# <strong>echo "- - -" &gt; /sys/class/scsi_host/host1/scan</strong></code></p>
<p>During this you should watch <em>/var/log/messages</em> to see if your LUN&#8217;s are detected. When done, make <em>multipathd</em> aware of the LUN&#8217;s:</p>
<p><code>[root@</code><code>carbon</code><code> ~]# <strong>multipath -v2 -d</strong></code></p>
<p>The above command is a &#8220;dry run&#8221;. There will be no device map changes committed. You will only be shown device mapper changes that will be made. To commit device map changes run:</p>
<p><code>[root@carbon ~]# <strong>multipath -v2</strong></code></p>
<p>Once this is done you can see what <em>multipathd</em> is seeing:</p>
<p><code>[root@carbon ~]# <strong>multipath -ll</strong><br />
mpath2 (3600508d311100a300000f00001a90000) dm-3 COMPAQ,HSV111 (C)COMPAQ<br />
[size=15G][features=1 queue_if_no_path][hwhandler=0][rw]<br />
\_ round-robin 0 [prio=100][enabled]<br />
&nbsp;\_ 1:0:3:1 sde 8:64  [active][ready]<br />
&nbsp;\_ 2:0:3:1 sdh 8:112 [active][ready]<br />
\_ round-robin 0 [prio=20][enabled]<br />
&nbsp;\_ 1:0:2:1 sdd 8:48  [active][ready]<br />
&nbsp;\_ 2:0:2:1 sdg 8:96  [active][ready]<br />
mpath1 (3600508c362d0a1250000900001490000) dm-2 COMPAQ,HSV111 (C)COMPAQ<br />
[size=15G][features=1 queue_if_no_path][hwhandler=0][rw]<br />
\_ round-robin 0 [prio=100][enabled]<br />
&nbsp;\_ 1:0:0:1 sdb 8:16  [active][ready]<br />
&nbsp;\_ 2:0:4:1 sdi 8:128 [active][ready]<br />
\_ round-robin 0 [prio=20][enabled]<br />
&nbsp;\_ 1:0:1:1 sdc 8:32  [active][ready]<br />
&nbsp;\_ 2:0:1:1 sdf 8:80  [active][ready]</code></p>
<p>If everything looks good, you can create configuration file for <em>multipathd</em>. You will need to edit <em>/etc/multipath.conf</em> and depending on your environment, add or modify some parameters. The configuration file contains enough comments and examples to figure out what different parameters mean. When in doubt, consult the man pages.</p>
<p>First, add a <em>blacklist</em> section, which will make certain device exempt from multipathing. I have my internal drives listed in blacklist section:</p>
<p><code>blacklist&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;devnode&nbsp;"^sd[a-b].*"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;devnode&nbsp;"^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;devnode&nbsp;"^hd[a-z]"<br />
}</code></p>
<p>Next, you are going to need <em>device</em> section. This is going to be specific to your SAN. The one below is for EVA5000. I got the parameters from HP&#8217;s device mapper package:</p>
<p><code>device&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vendor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"HP|COMPAQ"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;product&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"HSV1[01]1&nbsp;\(C\)COMPAQ|HSV[2][01]0|HSV300"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path_grouping_policy&nbsp;&nbsp;&nbsp;&nbsp;group_by_prio<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getuid_callout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"/sbin/scsi_id&nbsp;-g&nbsp;-u&nbsp;-s&nbsp;/block/%n"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path_checker&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tur<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path_selector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"round-robin&nbsp;0"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prio_callout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"/sbin/mpath_prio_alua&nbsp;/dev/%n"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rr_weight&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uniform<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;failback&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;immediate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;hardware_handler&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"0"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no_path_retry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rr_min_io&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;100<br />
}</code></p>
<p>You should also look at <em>defaults</em> section to make sure it is configured for your setup. Again, the parameters in mine are specific to EVA5000:</p>
<p><code>defaults&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;udev_dir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;polling_interval&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selector&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"round-robin&nbsp;0"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path_grouping_policy&nbsp;&nbsp;&nbsp;&nbsp;failover<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;getuid_callout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"/sbin/scsi_id&nbsp;-g&nbsp;-u&nbsp;-s&nbsp;/block/%n"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prio_callout&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"/bin/true"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;path_checker&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tur<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rr_min_io&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;100<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rr_weight&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uniform<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;failback&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;immediate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no_path_retry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;12<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user_friendly_names&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bindings_file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"/var/lib/multipath/bindings"<br />
}</code></p>
<p>Finally, you will need to specify configuration for the presented LUN&#8217;s. This applies to the <em>multipaths</em> section of <em>multipath.conf</em> file:</p>
<p><code>multipath&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wwid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3600508b4001031250000900001490000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;san1data<br />
}<br />
multipath&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wwid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3600508b400011c300000f00001a90000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;san2data<br />
}</code></p>
<p>After you are done, restart multipathd and check output of <em>multipath -ll</em> command:</p>
<p><code>[root@carbon ~]# <strong>multipath -ll</strong><br />
san2data (3600508d311100a300000f00001a90000) dm-3 COMPAQ,HSV111 (C)COMPAQ<br />
[size=15G][features=1 queue_if_no_path][hwhandler=0][rw]<br />
\_ round-robin 0 [prio=100][active]<br />
&nbsp;\_ 1:0:3:1 sde 8:64  [active][ready]<br />
&nbsp;\_ 2:0:3:1 sdh 8:112 [active][ready]<br />
\_ round-robin 0 [prio=20][enabled]<br />
&nbsp;\_ 1:0:2:1 sdd 8:48  [active][ready]<br />
&nbsp;\_ 2:0:2:1 sdg 8:96  [active][ready]<br />
san1data (3600508c362d0a1250000900001490000) dm-2 COMPAQ,HSV111 (C)COMPAQ<br />
[size=15G][features=1 queue_if_no_path][hwhandler=0][rw]<br />
\_ round-robin 0 [prio=50][enabled]<br />
&nbsp;\_ 1:0:0:1 sdb 8:16  [active][ready]<br />
&nbsp;\_ 2:0:4:1 sdi 8:128 [active][ready]<br />
\_ round-robin 0 [prio=20][enabled]<br />
&nbsp;\_ 1:0:1:1 sdc 8:32  [active][ready]<br />
&nbsp;\_ 2:0:1:1 sdf 8:80  [active][ready]</code></p>
<p>That should be it. You should test the setup by disabling paths to see if your LUN&#8217;s stay up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2009/11/27/linux-multipathing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mounting Linux NFS share: Not owner</title>
		<link>http://www.unixpowered.com/blog/2009/10/11/mounting-linux-nfs-share-not-owner/</link>
		<comments>http://www.unixpowered.com/blog/2009/10/11/mounting-linux-nfs-share-not-owner/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 12:03:22 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux tips]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[solaris]]></category>
		<category><![CDATA[solaris tips]]></category>

		<guid isPermaLink="false">http://www.unixpowered.com/blog/?p=365</guid>
		<description><![CDATA[I was trying to mount a RHEL 4 NFS share in Solaris 10. But for whatever reason I just could not seem to get it mounted. It would always come back with &#8220;Not owner&#8221; error:
bash-3.00# mount -F nfs carbon:/media/cdrecorder /mnt/carbon
nfs mount: mount: /mnt/carbon: Not owner
So, I checked and rechecked my settings with no success. Then, [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to mount a <acronym title="Red Hat Enterprise Linux 4">RHEL 4</acronym> NFS share in Solaris 10. But for whatever reason I just could not seem to get it mounted. It would always come back with <em>&#8220;Not owner&#8221;</em> error:</p>
<p><code>bash-3.00# <strong>mount -F nfs carbon:/media/cdrecorder /mnt/carbon</strong><br />
nfs mount: mount: /mnt/carbon: Not owner</code></p>
<p>So, I checked and rechecked my settings with no success. Then, I remembered reading something somewhere about NFS v4 in Linux being not so great at one time. Since the Linux box was running RHEL 4 I tought  this might be my problem. So, I decided to force mount using NFS v3, since Solaris 10 will try to mount the Linux share using NFS v4 first.</p>
<p><code>bash-3.00# <strong>mount -F nfs -o vers=3 carbon:/media/cdrecorder /mnt/carbon</strong><br />
bash-3.00# <strong>cd /mnt/carbon</strong><br />
bash-3.00# </code></p>
<p>That worked well. Since this was one time mounting job, I did not bother any further. If I would be doing this on regular basis I would probably edit <em>/etc/default/nfs</em> on the Solaris box and force maximum NFS client version to be v3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2009/10/11/mounting-linux-nfs-share-not-owner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network interface bonding in Linux</title>
		<link>http://www.unixpowered.com/blog/2009/05/04/network-interface-bonding-in-linux/</link>
		<comments>http://www.unixpowered.com/blog/2009/05/04/network-interface-bonding-in-linux/#comments</comments>
		<pubDate>Mon, 04 May 2009 14:42:15 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux tips]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=194</guid>
		<description><![CDATA[Bonding Ethernet interfaces in Linux is pretty straight forward. There is bunch of articles out there on it already, but since this is where I keep some of my notes, I decided to write a post on it. Plus I do not have to bother with Google and I can come straight here for instructions.
This [...]]]></description>
			<content:encoded><![CDATA[<p>Bonding Ethernet interfaces in Linux is pretty straight forward. There is bunch of articles out there on it already, but since this is where I keep some of my notes, I decided to write a post on it. Plus I do not have to bother with Google and I can come straight here for instructions.<br />
This was done on <a title="Dell Computers" href="http://www.dell.com" target="_self">Poweredge</a> running <a title="CentOS Home Page" href="http://www.centos.org" target="_self">CentOS</a> 5.2. Here are things that need to be done to make this happen:</p>
<ul>
<li>tell OS to load <em>bonding.ko</em> module on boot</li>
<li>set up configuration files for members of the bonded interface and the bonded interface itself</li>
<li>restart networking services or reboot</li>
</ul>
<p>The following is <em>/etc/modprobe.conf</em> file. To get the OS to load bonding module on boot, you will need to add the <em>alias bond0 bonding</em> line. You can also pass some options to the bonding module. In this case I wanted the driver to check for link loss every <em>100ms</em>. I also wanted the <em>bond0</em> interface to perform <em>adaptive load balancing</em>, hence <em>mode=6</em>. Adaptive load balancing does not require any configuration on the switch side. If you choose a different mode, you might have to do additional configuration on the switch.</p>
<p><code>[root@bigfoot etc]# <strong>cat /etc/modprobe.conf</strong><br />
alias eth0 e1000<br />
alias eth1 e1000<br />
alias bond0 bonding<br />
alias scsi_hostadapter qla1280<br />
alias scsi_hostadapter1 megaraid_mbox<br />
alias scsi_hostadapter2 ata_piix<br />
options bond0 miimon=100 mode=6</code></p>
<p>Next, you need to set up configuration files for physical interfaces to be included in the <em>bond0</em> interface. In my case <em>bond0</em> consists of <em>eth0</em> and <em>eth1</em>. Configuration files for both interfaces are identical except for <em>DEVICE=</em> lines.</p>
<p><code>[root@bigfoot etc]# <strong>cat /etc/sysconfig/network-scripts/ifcfg-eth0</strong><br />
# Intel Corporation 82541GI Gigabit Ethernet Controller<br />
DEVICE=eth0<br />
BOOTPROTO=none<br />
MASTER=bond0<br />
SLAVE=yes<br />
ONBOOT=yes<br />
USERCTL=no</code></p>
<p>The last step is to configure <em>bond0</em> interface itself:</p>
<p><code>[root@bigfoot etc]# <strong>cat /etc/sysconfig/network-scripts/ifcfg-bond0</strong><br />
DEVICE=bond0<br />
BOOTPROTO=none<br />
IPADDR=192.168.11.200<br />
NETMASK=255.255.255.0<br />
NETWORK=192.168.11.0<br />
ONBOOT=yes<br />
USERCTL=no</code></p>
<p>That is all. You can now do either <em>/etc/init.d/networking restart</em> or reboot the box.</p>
<p>This time I actually ran into a problem, where the physical interfaces were not being &#8220;enslaved&#8221; properly:</p>
<p><code>May  4 11:17:40 bigfoot kernel: ADDRCONF(NETDEV_UP): bond0: link is not ready<br />
May  4 11:17:40 bigfoot kernel: bonding: bond0: Adding slave eth0.<br />
May  4 11:17:40 bigfoot kernel: bonding: bond0: enslaving eth0 as an active interface with a down link.<br />
May  4 11:17:40 bigfoot kernel: bonding: bond0: link status definitely up for interface eth0.<br />
May  4 11:17:40 bigfoot kernel: ADDRCONF(NETDEV_CHANGE): bond0: link becomes ready<br />
May  4 11:17:40 bigfoot kernel: bonding: bond0: Adding slave eth1.<br />
May  4 11:17:40 bigfoot kernel: bonding: bond0: enslaving eth1 as an active interface with a down link.<br />
May  4 11:17:45 bigfoot kernel: bonding: bond0: Removing slave eth0<br />
May  4 11:17:45 bigfoot kernel: bonding: bond0: Warning: the permanent HWaddr of eth0 - 00:11:43:D8:AF:63 - is still in use by bond0. Set the HWaddr of eth0 to a different address to avoid conflicts.<br />
May  4 11:17:45 bigfoot kernel: bonding: bond0: releasing active interface eth0<br />
May  4 11:17:47 bigfoot kernel: bonding: bond0: Adding slave eth0.<br />
May  4 11:17:48 bigfoot kernel: bonding: bond0: Warning: failed to get speed and duplex from eth0, assumed to be 100Mb/sec and Full.<br />
May  4 11:17:48 bigfoot kernel: bonding: bond0: enslaving eth0 as an active interface with an up link.</code></p>
<p>I have never had this problem before and quick googlage revealed that I am not alone. I came across <a title="Some guy's blog" href="http://planet.larrythecow.org/archives/2009-01-12.html" target="_self">this guy</a> who had the same problem. He also links to the <a title="CentOS Bugzilla" href="http://bugs.centos.org/view.php?id=2404" target="_self">solution</a>. Basically it seems <a title="Xen Home Page" href="http://www.xen.org" target="_self">Xen</a> is causing the issue and to fix it you will need to edit <em>/etc/xen/xend-config.sxp</em> and force the network device to be used for network bridge in Xen:</p>
<p><code>(network-script 'network-bridge netdev=bond0')</code></p>
<p>Once I had that in place everything worked as advertised. Oh, and for thorough documentation check out Documentation included with kernel source. The file is called <em>bonding.txt</em>. <a title="bonding.txt" href="http://www.mjmwired.net/kernel/Documentation/networking/bonding.txt" target="_self">Here</a> is an online version of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2009/05/04/network-interface-bonding-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Growing mirrored LUN in RedHat</title>
		<link>http://www.unixpowered.com/blog/2009/02/06/growing-mirrored-lun-in-redhat/</link>
		<comments>http://www.unixpowered.com/blog/2009/02/06/growing-mirrored-lun-in-redhat/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 22:52:36 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux tips]]></category>
		<category><![CDATA[linux utilities]]></category>
		<category><![CDATA[lvm2]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=118</guid>
		<description><![CDATA[I was putting a RedHat server onto a SAN and I could not find any clear instructions on how to grow a single mirrored LUN on the fly. Anyway, here are some notes on the process. First the setup: Two LUN&#8217;s mirrored across two SAN&#8217;s with LVM volume on the top of it. I could [...]]]></description>
			<content:encoded><![CDATA[<p>I was putting a <a title="Red Hat" href="http://www.redhat.com" target="_self">RedHat</a> server onto a SAN and I could not find any clear instructions on how to grow a single mirrored LUN on the fly. Anyway, here are some notes on the process. First the setup: Two LUN&#8217;s mirrored across two SAN&#8217;s with <acronym title="Logical Volume Manager">LVM</acronym> volume on the top of it. I could have easily just presented another set of mirrored LUN&#8217;s, add them to <acronym title="Volume Group">VG</acronym> and go from there. I wanted to avoid that, as that kind of setup can quickly get out of hand as the number of presented LUN&#8217;s grows. If there is a more &#8220;sensible&#8221; and flexible setup, I would most definitely want to know about it.</p>
<p>For sake of completeness, here are steps to recreate the initial setup I had:</p>
<ol>
<li>Create a mirror from two LUN&#8217;s</li>
<li>Use the mirror as <acronym title="Physical Volume">PV</acronym></li>
<li>Create a VG using the PV</li>
<li>Create <acronym title="Logical Volume">LV</acronym> on the top of the VG</li>
<li>Make ext3 filesystem on the top of LV and mount it</li>
</ol>
<p>Here are the actual steps with some output:</p>
<p><code>[root@ultra /]# <strong>mdadm --create /dev/md10 --level=1 --raid-devices=2 /dev/mapper/mpath4 /dev/mapper/mpath5</strong><br />
mdadm: array /dev/md10 started.<br />
[root@</code><code>ultra</code><code> /]# <strong>pvcreate /dev/md10</strong><br />
Physical volume "/dev/md10" successfully created<br />
[root@</code><code>ultra</code><code> /]# <strong>vgcreate testvg /dev/md10</strong><br />
Volume group "testvg" successfully created<br />
[root@</code><code>ultra</code><code> /]# <strong>lvcreate -l+100%FREE -n testlv testvg</strong><br />
Logical volume "testlv" created<br />
[root@</code><code>ultra</code><code> /]# <strong>mkfs -t ext3 /dev/testvg/testlv</strong><br />
[root@</code><code>ultra</code><code> /]# <strong>mount /dev/testvg/testlv /tmp/test</strong></code></p>
<p>Now the resizing part. There might be a few steps but the upshot is that the filesystem can stay mounted and in use. High level overview of steps to take:</p>
<ol>
<li>Grow the two LUN&#8217;s using SAN management software</li>
<li>Fail and remove one of the submirrors</li>
<li>Force the kernel to see the size increase of the submirror</li>
<li>Flush and recreate the multipath device map so multipathing sees the new size</li>
<li>Re-add the submirror to the mirror and let it sync</li>
<li>Repeat 2-4 for the second submirror</li>
<li>Resize the PV</li>
<li>Resize the LV</li>
<li>Resize the filesystem</li>
</ol>
<p>First, you fail and remove the submirror:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>mdadm /dev/md10 -f /dev/mapper/mpath4 -r /dev/mapper/mpath4</strong><br />
mdadm: set /dev/mapper/mpath4 faulty in /dev/md10<br />
mdadm: hot removed /dev/mapper/mpath4<br />
</code><br />
Now, note all paths to the LUN. Kernel sees a separate device at the end of each path to a LUN. In this case they are <em>sdj</em>, <em>sdt</em>, <em>sdg</em> and <em>sdq</em>.</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>multipath -ll mpath4</strong><br />
mpath4 (3600508b400011c300000f000008d0000)<br />
[size=12 GB][features="1 queue_if_no_path"][hwhandler="0"]<br />
_ round-robin 0 [prio=100][active]<br />
._ 1:0:3:1     sdj 8:144  [active][ready]<br />
._ 2:0:3:1     sdt 65:48  [active][ready]<br />
_ round-robin 0 [prio=20][enabled]<br />
._ 1:0:2:1     sdg 8:96   [active][ready]<br />
._ 2:0:2:1     sdq 65:0   [active][ready]</code></p>
<p>At this point the problem is to get the kernel to recognize the new size without reboot. After a lot of trying and sifting through man pages I found that <em>blockdev</em> command does the magic. Then I googled &#8220;blockdev resize&#8221; and I found <a title="Detect online disk resize" href="http://lwn.net/Articles/296401/" target="_self">this</a> confirming my finding. So, the next step is to probe all logical paths to the LUN:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>blockdev --rereadpt /dev/sdj<br />
</strong> [root@</code><code>ultra</code><code> /]# <strong>blockdev --rereadpt /dev/sdt</strong><br />
[root@</code><code>ultra</code><code> /]# <strong>blockdev --rereadpt /dev/sdg</strong><br />
[root@</code><code>ultra</code><code> /]# <strong>blockdev --rereadpt /dev/sdq</strong></code></p>
<p>You should see messages in <em>/var/log/messages</em> about kernel seeing new size on all paths. If you were to issue <em>multipath -ll</em> right now you would see that multipathing is still reporting old size. To fix that, flush the device map of the LUN and then recreate it:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>multipath -f mpath4</strong><br />
[root@</code><code>ultra</code><code> /]# <strong>multipath -v2</strong><br />
create: mpath4 (3600508b400011c300000f000008d0000)<br />
[size=13 GB][features="0"][hwhandler="0"]<br />
_ round-robin 0 [prio=100]<br />
._ 1:0:3:1     sdj 8:144  [ready]<br />
._ 2:0:3:1     sdt 65:48  [ready]<br />
_ round-robin 0 [prio=20]<br />
._ 1:0:2:1     sdg 8:96   [ready]<br />
._ 2:0:2:1     sdq 65:0   [ready]</code></p>
<p>Multipathing should be reporting the new size. Now you are ready to put back the grown submirror and let the whole mirror sync:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>mdadm /dev/md10 -a /dev/mapper/mpath4</strong><br />
mdadm: hot added /dev/mapper/mpath4</code></p>
<p>When the mirror has synced up, repeat the above process for the second submirror and wait for the sync to finish. Time to grow the mirror device itself:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>mdadm --grow /dev/md10 --size=max</strong></code></p>
<p>After the completion <em>/proc/mdstat</em> should report increase in size of <em>/dev/md10</em>. Moving on you need to grow the PV that resides on<em> /dev/md10</em>:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>pvresize /dev/md10</strong><br />
Physical volume "/dev/md10" changed<br />
1 physical volume(s) resized / 0 physical volume(s) not resized</code></p>
<p>And finally, you need to resize the LV:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>lvresize -l+100%FREE testvg/testlv</strong><br />
Extending logical volume testlv to 13.00 GB<br />
Logical volume testlv successfully resized</code></p>
<p>Of course, don&#8217;t forget to grow the filesystem itself:</p>
<p><code>[root@</code><code>ultra</code><code> /]# <strong>ext2online /dev/testvg/testlv</strong><br />
ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b<br />
[root@</code><code>ultra</code><code> /]# <strong>df</strong><br />
Filesystem           1K-blocks      Used Available Use% Mounted on<br />
/dev/mapper/VolGroup00-rootlv<br />
.                    132304280     5104976 120478588     5% /<br />
/dev/md0                               132134         32791     92521   27% /boot<br />
none                                     8202920                 0   8202920     0% /dev/shm<br />
/dev/mapper/testvg-testlv<br />
.                     13413488         63516   12668820     1% /tmp/test</code></p>
<p>That should be it. The sync time for huge volumes is going to be something to keep in mind. The whole setup is clean and neat without clutter. I could have opted to mirror using LVM, but there seems to be a strange requirement for third, log volume. It is possible to keep the log in memory, but that supposedly causes resync on boot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2009/02/06/growing-mirrored-lun-in-redhat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting started with SOL on Sun Fire V20z and V40z</title>
		<link>http://www.unixpowered.com/blog/2008/10/04/getting-started-with-sol-on-sun-fire-v20z-and-v40z/</link>
		<comments>http://www.unixpowered.com/blog/2008/10/04/getting-started-with-sol-on-sun-fire-v20z-and-v40z/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 11:40:02 +0000</pubDate>
		<dc:creator>somedude</dc:creator>
				<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux tips]]></category>
		<category><![CDATA[linux utilities]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[sun hardware]]></category>

		<guid isPermaLink="false">http://wayciak.wordpress.com/?p=58</guid>
		<description><![CDATA[SP on Sun Fire V40z can be configured so that you can access system console over the network as you would on a UltraSPARC machine with Net Management port. Here is a quick way to get started using V40z and RedHat. Before starting, connect up SP network interface to the network.
Now, edit /etc/inittab and add [...]]]></description>
			<content:encoded><![CDATA[<p><acronym title="Service Processor">SP</acronym> on Sun Fire <a title="Sun Fire V40z" href="http://sunsolve.sun.com/handbook_pub/validateUser.do?target=Systems/SunFireV40z_R/SunFireV40z_R" target="_self">V40z</a> can be configured so that you can access system console over the network as you would on a UltraSPARC machine with Net Management port. Here is a quick way to get started using V40z and RedHat. Before starting, connect up SP network interface to the network.</p>
<p>Now, edit /etc/inittab and add the following line:</p>
<p><code>co:12345:respawn:/sbin/agetty -t 60 ttyS0 9600 vt100</code></p>
<p>This will spawn <em>agetty</em> in runlevels <em>12345</em> on serial port 1 with <em>9600</em> baud rate and <em>vt100</em> emulation.</p>
<p>Next you need to edit <em>/etc/grub.conf</em> and comment out <em>splashimage</em> line so boot menu gets rendered properly. Then add following two lines:</p>
<p><code>serial --unit=0 --speed=9600<br />
terminal --timeout=10 console serial</code></p>
<p>This will initialize serial port 1 after GRUB startup. If you want to use serial port 2 you would set <em>&#8211;unit=1</em>. The terminal we will be using are <em>console</em> and <em>serial</em> in that order, with timeout of <em>10</em> seconds. Terminal gets selected depending on where keystroke is detected first, before timeout runs out. If timeout expires, first terminal specified is used.</p>
<p>Finally, append following to the kernel line: <em>console=tty0 console=ttyS0,9600n8</em>. So it will end up looking something like this:</p>
<p><code>kernel /vmlinuz-2.6.9-67.ELsmp ro root=/dev/VolGroup00/LogVol00 rhgb quiet console=tty0 console=ttyS0,9600n8</code></p>
<p>Now, you need to add serial port device name to <em>/etc/securetty</em>. This file specifies devices where root can log in. Just append <em>ttyS0</em> (serial port 1) to the end of the file.</p>
<p>Time to reboot and go to BIOS&#8217;s Advanced Settings. Select Console Redirection to Serial Port A and verify you have correct baud rate selected. Reboot the server for all changes to take effect.</p>
<p>At this point SP might not have an IP address assigned, so assign it one using V40z&#8217;s front panel. Once you configured SP with IP address, subnet mask and default gateway, ssh to the IP address, <strong>from local subnet</strong>, using the following:</p>
<p><code>bash-3.00# <strong>ssh setup@IP</strong></code></p>
<p>You will be asked to setup SP usernames and passwords. When you are done, ssh back to the SP using one of the usernames you have set up, and disable and then re-enable Serial Over LAN:</p>
<p><code>localhost $ <strong>platform set console -s platform</strong><br />
localhost $ <strong>platform set console -s sp -e -S 9600</strong></code></p>
<p>After the SP has been re-enabled, it might be a good idea to set up command prompt so you know which server you are logged into:</p>
<p><code>localhost $ <strong>sp set hostname ultra-sp</strong></code></p>
<p>Now you can access the console using:</p>
<p><code>ultra-sp $ <strong>platform console</strong></code></p>
<p>After you connect to the console you can get help by pressing <em>CTRL+E</em> followed by <em>c</em> and <em>?</em>.Here is sample output:</p>
<p><code>----<br />
ultra-sp $ <strong>platform console</strong><br />
[Enter `^Ec?' for help]<br />
Red Hat Enterprise Linux release 4<br />
Kernel 2.4.21-3.EL on an i686</code></p>
<p><code>ultra login:<br />
[help]<br />
.    disconnect                        ;    move to another console<br />
a    attach read/write                 b    send broadcast message<br />
c    toggle flow control               d    down a console<br />
e    change escape sequence            f    force attach read/write<br />
g    group info                        i    information dump<br />
L    toggle logging on/off             l?   break sequence list<br />
l0   send break per config file        l1-9 send specific break sequence<br />
m    display the message of the day    o    (re)open the tty and log file<br />
p    replay the last 60 lines          r    replay the last 20 lines<br />
s    spy read only                     u    show host status<br />
v    show version info                 w    who is on this console<br />
x    show console baud info            z    suspend the connection<br />
|    attach local command              ?    print this message<br />
&lt;cr&gt; ignore/abort command              ^R   replay the last line<br />
ooo send character by octal code<br />
----</code></p>
<p>At this point you should have a usable network console. You might want to make <a title="Sun Fire V20z and Sun Fire V40z Servers--Server Management Guide" href="http://docs.sun.com/app/docs/doc/817-5249-17?l=en" target="_self">additional setup changes </a>to the SP to fit your environment.</p>
<p>The first time I issued <em>platform console</em> command in SP I got this error:</p>
<p><code>console: connect: 59372@console: Connection refused</code></p>
<p>Rebooting SP using sp reboot fixed the issue for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.unixpowered.com/blog/2008/10/04/getting-started-with-sol-on-sun-fire-v20z-and-v40z/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
