<?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>SysAdmin Adventures &#187; network</title>
	<atom:link href="http://blog.tpa.me.uk/tag/network/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tpa.me.uk</link>
	<description>Tech notes from a Systems Administrator</description>
	<lastBuildDate>Mon, 31 Oct 2011 11:09:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Slackware trying to mount NFS shares before the network is ready</title>
		<link>http://blog.tpa.me.uk/2010/06/14/slackware-trying-to-mount-nfs-shares-before-the-network-is-ready/</link>
		<comments>http://blog.tpa.me.uk/2010/06/14/slackware-trying-to-mount-nfs-shares-before-the-network-is-ready/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 12:31:15 +0000</pubDate>
		<dc:creator>Zordrak</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[remote]]></category>

		<guid isPermaLink="false">http://blog.tpa.me.uk/?p=382</guid>
		<description><![CDATA[I have a right pain of a problem in this network in that individual machines are slow to get network access at boot. I haven&#8217;t had the opportunity to properly find out why, but my instinct says the blame lies with the Allied Telesyn switches. The big problem this causes is that any machines with [...]]]></description>
			<content:encoded><![CDATA[<p>I have a right pain of a problem in this network in that individual machines are slow to get network access at boot. I haven&#8217;t had the opportunity to properly find out why, but my instinct says the blame lies with the Allied Telesyn switches.</p>
<p>The big problem this causes is that any machines with a remote filesystem, such as an NFS share, in their fstab fail to mount the shares at boot; which means I have to manually ssh in and issue a mount command as root.</p>
<p>The solution is to ask rc.inet2 if it would kindly consider waiting just a little longer for the network to come up and not mount remote filesystems if it doesn&#8217;t.</p>
<p>The following patch attempts to ping an always-on host, preferably the host that serves the filesystem(s) you are going to mount.</p>
<ul>
<li>If a response is received, the boot process continues as normal.</li>
<li>If there&#8217;s no response to the first ping:
<ul>
<li>A further 5 pings are attempted.</li>
<li>A countdown is displayed.</li>
<li>After 6 failed attempts boot continues, but with no attempt to mount remote filesystems.</li>
</ul>
</li>
</ul>
<p>rc.inet2.diff (<a href='http://blog.tpa.me.uk/wp-content/uploads/2010/06/rc.inet2.diff.gz'>download rc.inet2.diff.gz</a>):</p>
<div class="codecolorer-container diff geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="diff codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #888822;">--- ./rc.inet2.orig &nbsp; &nbsp; 2007-09-17 23:07:32.000000000 +0100</span><br />
<span style="color: #888822;">+++ ./rc.inet2 &nbsp;2010-06-14 14:05:24.237107265 +0100</span><br />
<span style="color: #440088;">@@ -15,9 +15,16 @@</span><br />
&nbsp;<br />
&nbsp;# At this point, we are ready to talk to The World...<br />
&nbsp;<br />
<span style="color: #00b000;">+lan_test_host=&quot;&lt;known up host, or remote filesystem server&gt;&quot;;</span><br />
<span style="color: #00b000;">+avail=<span style="">6</span>;</span><br />
<span style="color: #00b000;">+while ! ping -c1 $lan_test_host &amp;&gt;/dev/null &amp;&amp; <span style="">&#40;</span><span style="">&#40;</span> avail-- &gt; <span style="">1</span> <span style="">&#41;</span><span style="">&#41;</span>;</span><br />
<span style="color: #00b000;">+do</span><br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; echo &quot;Waiting for network before mounting remote filesystems... $avail&quot;;</span><br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; sleep <span style="">1</span>;</span><br />
<span style="color: #00b000;">+done</span><br />
&nbsp;<br />
&nbsp;# Mount remote <span style="">&#40;</span>NFS<span style="">&#41;</span> filesystems:<br />
<span style="color: #991111;">-if cat /etc/fstab | grep -v '^#' | grep -w nfs <span style="">1</span>&gt; /dev/null <span style="">2</span>&gt; /dev/null ; then</span><br />
<span style="color: #00b000;">+if cat /etc/fstab | grep -v '^#' | grep -w nfs <span style="">1</span>&gt; /dev/null <span style="">2</span>&gt; /dev/null &amp;&amp; <span style="">&#40;</span><span style="">&#40;</span>avail<span style="">&#41;</span><span style="">&#41;</span>; then</span><br />
&nbsp; &nbsp;# Start rpc.portmap, /sbin/rpc.lockd, and /sbin/rpc.statd if we find NFS<br />
&nbsp; &nbsp;# volumes defined in /etc/fstab since these will need to be running in order<br />
&nbsp; &nbsp;# to mount them. &nbsp;If they are not running, attempting to mount an NFS<br />
<span style="color: #440088;">@@ -46,7 +53,7 @@</span><br />
&nbsp;<br />
&nbsp;# Mount remote CIFS filesystems. &nbsp;Note that where possible, using CIFS is<br />
&nbsp;# preferred over SMBFS. &nbsp;SMBFS is no longer actively maintained.<br />
<span style="color: #991111;">-if cat /etc/fstab | grep -v '^#' | grep -w cifs <span style="">1</span>&gt; /dev/null <span style="">2</span>&gt; /dev/null ; then</span><br />
<span style="color: #00b000;">+if cat /etc/fstab | grep -v '^#' | grep -w cifs <span style="">1</span>&gt; /dev/null <span style="">2</span>&gt; /dev/null &amp;&amp; <span style="">&#40;</span><span style="">&#40;</span>avail<span style="">&#41;</span><span style="">&#41;</span>; then</span><br />
&nbsp; &nbsp;echo &quot;Mounting remote CIFS file systems: &nbsp;/sbin/mount -a -t cifs&quot;<br />
&nbsp; &nbsp;/sbin/mount -a -t cifs<br />
&nbsp; &nbsp;# Show the mounted volumes:<br />
<span style="color: #440088;">@@ -54,7 +61,7 @@</span><br />
&nbsp;fi<br />
&nbsp;<br />
&nbsp;# Mount remote SMB filesystems:<br />
<span style="color: #991111;">-if cat /etc/fstab | grep -v '^#' | grep -w smbfs <span style="">1</span>&gt; /dev/null <span style="">2</span>&gt; /dev/null ; then</span><br />
<span style="color: #00b000;">+if cat /etc/fstab | grep -v '^#' | grep -w smbfs <span style="">1</span>&gt; /dev/null <span style="">2</span>&gt; /dev/null &amp;&amp; <span style="">&#40;</span><span style="">&#40;</span>avail<span style="">&#41;</span><span style="">&#41;</span>; then</span><br />
&nbsp; &nbsp;echo &quot;Mounting remote SMBFS file systems: &nbsp;/sbin/mount -a -t smbfs&quot;<br />
&nbsp; &nbsp;/sbin/mount -a -t smbfs<br />
&nbsp; &nbsp;# Show the mounted volumes:</div></div>
<p>In order to apply the above patch, do the following as root:</p>
<div class="codecolorer-container bash geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># cd /etc/rc.d</span><br />
<span style="color: #666666; font-style: italic;"># wget http://blog.tpa.me.uk/wp-content/uploads/2010/06/rc.inet2.diff.gz</span><br />
<span style="color: #666666; font-style: italic;"># zcat rc.inet2.diff.gz | patch -p1</span></div></div>
<p>Do not forget to manually edit your newly patched file to replace &#8220;&lt;known up host, or remote filesystem server&gt;&#8221; with a valid hostname or IP address.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tpa.me.uk/2010/06/14/slackware-trying-to-mount-nfs-shares-before-the-network-is-ready/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Migrating Slackware to New Hardware</title>
		<link>http://blog.tpa.me.uk/2009/12/03/migrating-slackware-to-new-hardware/</link>
		<comments>http://blog.tpa.me.uk/2009/12/03/migrating-slackware-to-new-hardware/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 16:51:37 +0000</pubDate>
		<dc:creator>Zordrak</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[interfaces]]></category>
		<category><![CDATA[migrating]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[persistent]]></category>
		<category><![CDATA[rules]]></category>
		<category><![CDATA[udev]]></category>

		<guid isPermaLink="false">http://blog.tpa.me.uk/?p=272</guid>
		<description><![CDATA[Sometimes it is necessary to retain a Slackware installation, but change the hardware it runs on: Migrating to or from virtual hardware (VirtualBox, VMware etc) Duplicating an installation across multiple new servers Using temporary hardware to set up a new OS for a server to minimise downtime Plain old hardware failure etc. Under many other [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is necessary to retain a Slackware installation, but change the hardware it runs on:</p>
<ul>
<li>Migrating to or from virtual hardware (VirtualBox, VMware etc)</li>
<li>Duplicating an installation across multiple new servers</li>
<li>Using temporary hardware to set up a new OS for a server to minimise downtime</li>
<li>Plain old hardware failure</li>
<li>etc.</li>
</ul>
<p>Under many other Operating Systems, <em>especially</em> Windows, this can be painful and perhaps not even worth doing. As usual it is easy with Slackware.</p>
<p>In the simplest case (default install, default kernel, desktop environment) there&#8217;s literally nothing you need to do. Just put the disk or image in the new hardware and boot.</p>
<p>If you are using a custom kernel (<a href="http://blog.tpa.me.uk/slackware-kernel-compile-guide/">as you should be</a>) then you will need to create a new kernel and update lilo either before or after you do the migration. If you have any sense of self-preservation, your lilo config will include the default &#8220;huge&#8221; kernel and so the minimum you need to do is just boot the huge kernel on the new hardware, then you can go about making a new custom kernel later.</p>
<p><strong>The bit that will catch you out:</strong><br />
There is one thing that might make you stumble: you moved the installation, booted up and all is well.. but the network isn&#8217;t working. You run `ifconfig -a` and find your two network interfaces are now called eth2 and eth3 and neither is configured.. &#8220;What&#8217;s going on?&#8221;, you ask. The answer is udev.</p>
<p>udev knows that your two new network interfaces are different to your old ones because they have different MAC addresses and decides you might not want to have them configured the same; perhaps you are going to swap in the old cards later and have four, so it reserves the previously used &#8220;ethX&#8221; labels in case it sees those cards again.</p>
<p>Since you are migrating to new hardware, you want it to forget about your previous network interfaces and re-use the labels with your new hardware. Head to <em>/etc/udev/rules.d</em> and find the file called 70-persistent-net.rules. Take a look at it.. it should look something like this:</p>
<div class="codecolorer-container bash geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># This file was automatically generated by the //lib/udev/write_net_rules</span><br />
<span style="color: #666666; font-style: italic;"># program, run by the persistent-net-generator.rules rules file.</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># You can modify it, as long as you keep each rule on a single</span><br />
<span style="color: #666666; font-style: italic;"># line, and change only the value of the NAME= key.</span><br />
<br />
<span style="color: #666666; font-style: italic;"># PCI device 0x10de:0x0373 (forcedeth)</span><br />
<span style="color: #007800;">SUBSYSTEM</span>==<span style="color: #ff0000;">&quot;net&quot;</span>, <span style="color: #007800;">ACTION</span>==<span style="color: #ff0000;">&quot;add&quot;</span>, <span style="color: #007800;">DRIVERS</span>==<span style="color: #ff0000;">&quot;?*&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span>address<span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;00:18:f3:7c:75:31&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">type</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;1&quot;</span>, <span style="color: #007800;">KERNEL</span>==<span style="color: #ff0000;">&quot;eth*&quot;</span>, <span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;eth0&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># PCI device 0x10de:0x0373 (forcedeth)</span><br />
<span style="color: #007800;">SUBSYSTEM</span>==<span style="color: #ff0000;">&quot;net&quot;</span>, <span style="color: #007800;">ACTION</span>==<span style="color: #ff0000;">&quot;add&quot;</span>, <span style="color: #007800;">DRIVERS</span>==<span style="color: #ff0000;">&quot;?*&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span>address<span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;00:18:f3:7c:75:32&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">type</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;1&quot;</span>, <span style="color: #007800;">KERNEL</span>==<span style="color: #ff0000;">&quot;eth*&quot;</span>, <span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;eth1&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># PCI device 0x10de:0x0373 (forcedeth)</span><br />
<span style="color: #007800;">SUBSYSTEM</span>==<span style="color: #ff0000;">&quot;net&quot;</span>, <span style="color: #007800;">ACTION</span>==<span style="color: #ff0000;">&quot;add&quot;</span>, <span style="color: #007800;">DRIVERS</span>==<span style="color: #ff0000;">&quot;?*&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span>address<span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;00:18:f3:7c:75:b7&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">type</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;1&quot;</span>, <span style="color: #007800;">KERNEL</span>==<span style="color: #ff0000;">&quot;eth*&quot;</span>, <span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;eth2&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># PCI device 0x10de:0x0373 (forcedeth)</span><br />
<span style="color: #007800;">SUBSYSTEM</span>==<span style="color: #ff0000;">&quot;net&quot;</span>, <span style="color: #007800;">ACTION</span>==<span style="color: #ff0000;">&quot;add&quot;</span>, <span style="color: #007800;">DRIVERS</span>==<span style="color: #ff0000;">&quot;?*&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span>address<span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;00:18:f3:7c:75:b8&quot;</span>, ATTR<span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">type</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>==<span style="color: #ff0000;">&quot;1&quot;</span>, <span style="color: #007800;">KERNEL</span>==<span style="color: #ff0000;">&quot;eth*&quot;</span>, <span style="color: #007800;">NAME</span>=<span style="color: #ff0000;">&quot;eth3&quot;</span></div></div>
<p>See how it has an entry for both the old interfaces and the new ones? That&#8217;s what&#8217;s meant by <em>persistent net rules</em>. If you moved to a new machine again, it would add the two new interfaces as eth4 and eth5.</p>
<p>You have two choices for fixing the situation:</p>
<ol>
<li>Delete the file. It will be re-created on next boot and start again from eth0.</li>
<li>Manually modify the file to reflect the configuration you want.</li>
</ol>
<p><em>Note: There is also a 70-persistent-cd.rules file that it&#8217;s worth keeping an eye on during hardware migration, but usually it&#8217;s only the net rules that actually cause people problems.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tpa.me.uk/2009/12/03/migrating-slackware-to-new-hardware/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

