{"id":41,"date":"2009-06-16T16:45:52","date_gmt":"2009-06-16T14:45:52","guid":{"rendered":"http:\/\/grimstveit.no\/jakob\/blog\/?p=41"},"modified":"2009-06-16T16:45:52","modified_gmt":"2009-06-16T14:45:52","slug":"when-a-system-dies","status":"publish","type":"post","link":"https:\/\/www.grimstveit.no\/jakob\/blog\/2009\/06\/16\/when-a-system-dies\/","title":{"rendered":"freebsd-questions: When a System Dies; Getting back in operation again"},"content":{"rendered":"<p><a href=\"http:\/\/freebsd.org\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"46\" data-permalink=\"https:\/\/www.grimstveit.no\/jakob\/blog\/2009\/06\/16\/when-a-system-dies\/freebsd-logo\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.grimstveit.no\/jakob\/blog\/wp-content\/uploads\/2009\/06\/FreeBSD-logo.png?fit=175%2C175&amp;ssl=1\" data-orig-size=\"175,175\" data-comments-opened=\"1\" data-image-title=\"FreeBSD logo\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.grimstveit.no\/jakob\/blog\/wp-content\/uploads\/2009\/06\/FreeBSD-logo.png?fit=175%2C175&amp;ssl=1\" class=\"alignright size-thumbnail wp-image-46\" title=\"FreeBSD logo\" src=\"https:\/\/i0.wp.com\/grimstveit.no\/jakob\/blog\/wp-content\/uploads\/2009\/06\/FreeBSD-logo-150x150.png?resize=150%2C150\" alt=\"FreeBSD logo\" width=\"150\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/www.grimstveit.no\/jakob\/blog\/wp-content\/uploads\/2009\/06\/FreeBSD-logo.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/www.grimstveit.no\/jakob\/blog\/wp-content\/uploads\/2009\/06\/FreeBSD-logo.png?w=175&amp;ssl=1 175w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/><\/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>\n<p><strong>From:<\/strong> n j<br \/>\n<strong>To:<\/strong> Martin McCormick &lt;martin@dc.cis.[obfuscateddomain].edu&gt;<br \/>\n<strong>Cc:<\/strong> freebsd-questions@freebsd.org<\/p>\n<p>When a System Dies; Getting back in operation again.<\/p>\n<p><span style=\"color: #800080;\">&gt; &#8230; What is the best way to restore the full system?<br \/>\n&gt; Can I use the FreeBSD installation disk in rescue mode?<\/span><\/p>\n<p><!--more--><\/p>\n<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>\n<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>\n<ol>\n<li> dump -0Laf &#8211; \/ | ssh backup-server &#8220;cat &gt; dump.root&#8221;\n<li> boot the new machine from CD disc1 (FreeBSD &lt;7) or livefs disc (FreeBSD &gt;7)\n<li> create and newfs partitions as explained in this thread (at least the size of backup, can be larger)\n<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)\n<li> start netcat (nc -l 55555 | restore -rvf -)\n<li> on backup-server: cat dump.root | nc new-machine 55555\n<li> repeat for usr and var partitions\n<\/ol>\n<p>Notes:<\/p>\n<ol>\n<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.\n<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)\n<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:\n<ol>\n<li> partition names (e.g. \/dev\/da0s1a might become \/dev\/amrd0s1a)\n<li> ethernet interface names (e.g. em0 might become bge0)\n<li> IP addresses in case you still have the old box running to avoid IP conflict\n<\/ol>\n<\/ol>\n<p>You should now be able to safely reboot and log into your new machine.<\/p>\n<p>Regards,<br \/>\n<span style=\"color: #888888;\">&#8212;<br \/>\nNino<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &lt;martin@dc.cis.[obfuscateddomain].edu&gt; Cc: freebsd-questions@freebsd.org When a System Dies; Getting [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[5,4,14,13],"class_list":["post-41","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-freebsd","tag-geekish","tag-netcat","tag-sysadmin"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8nTfx-F","jetpack-related-posts":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/posts\/41","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":8,"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/posts\/41\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.grimstveit.no\/jakob\/blog\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}