<?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>Life on the edge of /dev/null &#187; netcat</title>
	<atom:link href="http://grimstveit.no/jakob/blog/tag/netcat/feed/" rel="self" type="application/rss+xml" />
	<link>http://grimstveit.no/jakob/blog</link>
	<description>This is what I care about. Why do you care?</description>
	<lastBuildDate>Mon, 09 Jan 2012 07:36:57 +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>freebsd-questions: When a System Dies; Getting back in operation again</title>
		<link>http://grimstveit.no/jakob/blog/2009/06/16/when-a-system-dies/</link>
		<comments>http://grimstveit.no/jakob/blog/2009/06/16/when-a-system-dies/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 14:45:52 +0000</pubDate>
		<dc:creator>Jakob Breivik Grimstveit</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[geekish]]></category>
		<category><![CDATA[netcat]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://grimstveit.no/jakob/blog/?p=41</guid>
		<description><![CDATA[This post is fetched from the freebsd-questions mailinglist, and is a perfect example on how I consider the Linux/BSD world to be superior to Windows, at least in terms of systems administration. On Unix, it&#8217;s all just files, devices and bitstreams&#8230; From: n j To: Martin McCormick &#60;martin@dc.cis.[obfuscateddomain].edu&#62; Cc: freebsd-questions@freebsd.org When a System Dies; Getting [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://freebsd.org"><img class="alignright size-thumbnail wp-image-46" title="FreeBSD logo" src="http://grimstveit.no/jakob/blog/wp-content/uploads/2009/06/FreeBSD-logo-150x150.png" alt="FreeBSD logo" width="150" height="150" /></a>This post is fetched from the <a href="http://lists.freebsd.org/mailman/listinfo/freebsd-questions">freebsd-questions mailinglist</a>, and is a perfect example on how I consider the Linux/BSD world to be superior to Windows, at least in terms of systems administration. On Unix, it&#8217;s all just files, devices and bitstreams&#8230;</p>
<p><strong>From:</strong> n j<br />
<strong>To:</strong> Martin McCormick &lt;martin@dc.cis.[obfuscateddomain].edu&gt;<br />
<strong>Cc:</strong> freebsd-questions@freebsd.org</p>
<p>When a System Dies; Getting back in operation again.</p>
<p><span style="color: #800080;">&gt; &#8230; What is the best way to restore the full system?<br />
&gt; Can I use the FreeBSD installation disk in rescue mode?</span></p>
<p><span id="more-41"></span></p>
<p>I experienced such a situation just 2 weeks ago. My primary problem was that I had to do restore over the network (no attached tape drives, no external HDDs). I wanted to use ssh to grab the dump from the backup server, but ended up using netcat which worked great.</p>
<p>Here&#8217;s basically what I did including backup from the not-yet-dead machine (note, I used intermediate backup server, but it should be possible to directly pipe dump to restore):</p>
<ol>
<li> dump -0Laf &#8211; / | ssh backup-server &#8220;cat &gt; dump.root&#8221;
<li> boot the new machine from CD disc1 (FreeBSD &lt;7) or livefs disc (FreeBSD &gt;7)
<li> create and newfs partitions as explained in this thread (at least the size of backup, can be larger)
<li> go into the rescue (fixit) mode, create mount points for created partitions (mkdir mnt.root), mount partitions (e.g. mount /dev/da0s1a /mnt.root), change directory to mount point (cd /mnt.root), configure NIC (ifconfig)
<li> start netcat (nc -l 55555 | restore -rvf -)
<li> on backup-server: cat dump.root | nc new-machine 55555
<li> repeat for usr and var partitions
</ol>
<p>Notes:</p>
<ol>
<li> if security is an issue, ssh out from the new machine to the backup server with port forwarding (ssh -R 55555:localhost:55555 backup-server) and pipe the backup to localhost (cat dump.root | nc localhost 55555); my initial idea was to start sshd in fixit mode (see my post to the list &#8220;fixit console with sshd&#8221;) which turned out to be too much of a trouble.
<li> restore uses TMPDIR to store some temporary files during restore process; the fixit mode has limited free space and when it gets exhausted the restore process will fail, so it is a good idea to use an available partition as a temporary TMPDIR (e.g. export TMPDIR=/mnt.var while restoring usr partition and later use a subdirectory of usr as TMPDIR to restore var partition)
<li> [IMPORTANT!] after the restore process is over, manually check restored etc/fstab and etc/rc.conf (currently mounted as /mnt.root/&#8230;) to fix:
<ol>
<li> partition names (e.g. /dev/da0s1a might become /dev/amrd0s1a)
<li> ethernet interface names (e.g. em0 might become bge0)
<li> IP addresses in case you still have the old box running to avoid IP conflict
</ol>
</ol>
<p>You should now be able to safely reboot and log into your new machine.</p>
<p>Regards,<br />
<span style="color: #888888;">&#8211;<br />
Nino</span></p>
<div class="none"><g:plusone href="http://grimstveit.no/jakob/blog/2009/06/16/when-a-system-dies/" size="small" count="true"></g:plusone></div>]]></content:encoded>
			<wfw:commentRss>http://grimstveit.no/jakob/blog/2009/06/16/when-a-system-dies/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

