{"id":219,"date":"2010-03-05T23:59:16","date_gmt":"2010-03-06T05:59:16","guid":{"rendered":"http:\/\/www.goodjobsucking.com\/?p=219"},"modified":"2010-03-08T12:52:54","modified_gmt":"2010-03-08T18:52:54","slug":"backuppc-and-bare-metal-restore-of-windows-xp","status":"publish","type":"post","link":"http:\/\/www.goodjobsucking.com\/?p=219","title":{"rendered":"BackupPC and Bare Metal Restore of Windows XP"},"content":{"rendered":"<p>While it&#8217;s not well documented, it&#8217;s possible to do a bare-metal restore of a machine running Windows XP that&#8217;s been backed up via BackupPC (assuming, of course, that some method, such as that documented <a title=\"Backing Up Open Files on Windows with Rsync (and BackupPC)\" href=\"http:\/\/www.goodjobsucking.com\/?p=62\" target=\"_self\">here<\/a>, has been used to back up open files, such as the registry.)<\/p>\n<h4>Step 1:\u00a0 Build a local tar file using BackupPC_tarCreate<\/h4>\n<p>The alternative, BackupPC_zipCreate, proved problematic; the gigantic archives that it created could not be completely recovered, yet tar archives proved intact.\u00a0 At any rate, this is best accomplished from the command line, as the backuppc user:<\/p>\n<pre>BackupPC_tarCreate -t -n -1 -h borkstation -s C \/ &gt; borkstation.tar<\/pre>\n<p>&#8220;borkstation&#8221; is the name of the host to recover, &#8220;-n -1&#8221; means the latest backup, and you&#8217;ll obviously need to have enough space where the tar file is going to store the entire backup, which will not be compressed.\u00a0 Note the space between the &#8220;C&#8221;, which represents the share to restore, and the &#8220;\/&#8221;, which represents the directory to restore.<\/p>\n<h4>Step 2:\u00a0 Prepare bare XP<\/h4>\n<p>Basically, you want to install a working copy of the operating system.\u00a0 Aside from network drivers, it really doesn&#8217;t matter if anything&#8217;s installed or working, you&#8217;re going to wipe it all out anyway.\u00a0 The filesystem and the partitions will stay, so configure those the way that you want your system to finally end up.<\/p>\n<h4>Step 3:\u00a0 Prepare Recovery Console<\/h4>\n<p>Using the same install CD, you can install the recovery console to speed things up a little versus booting from the CD, although either option will work.\u00a0 To install the recovery console, use <em>Start-&gt;Run<\/em>, then<\/p>\n<pre>d:\\i386\\winnt32.exe \/cmdcons<\/pre>\n<p>Where D: is the letter if the CD-ROM.\u00a0 Whether you choose to install it or not isn&#8217;t really important, but what is important is that you open up the permissions for Recovery Console, or some of the remaining steps won&#8217;t work.<\/p>\n<ol>\n<li> <em>Start-&gt;Run<\/em>, then type secpol.msc<\/li>\n<li>Go to <em>Security settings-&gt;Local policies-&gt;Security options<\/em><\/li>\n<li>Scroll down to &#8220;Recovery console: Allow floppy copy and access to all drives and all folders&#8221; and make sure it is <em>enabled<\/em>.<\/li>\n<\/ol>\n<h4>Step 4:\u00a0 Install Cygwin<\/h4>\n<p>You&#8217;ll need a &#8220;tar&#8221; utility you can rely on for the next step, and experimenting with a plethora of them has shown that unless you build your own, you&#8217;ll really need <a title=\"Cygwin\" href=\"http:\/\/www.cygwin.com\/\">Cygwin<\/a>.\u00a0 While installing, be sure to select the gnu tar package.\u00a0 (Unless your backup contains Cygwin, you can just delete the c:\\cygwin directory later to get rid of it all.)<\/p>\n<h4>Step 5: Unpack the tar file to the local drive<\/h4>\n<p>A prerequisite to this step is that you get access to the tar file created in step 1 &#8212; which you&#8217;ll have to wait for if it isn&#8217;t finished being built yet.\u00a0 The simplest way to get access to the file is to map a drive to the *nix box that has the tar file. I mapped mine to the Z: drive, which was a pretty arbitrary choice.<\/p>\n<p>Next, create a directory to put the recovered files into, because you do not want them going into the root directory yet.\u00a0 I created a directory called &#8220;recovery.&#8221;\u00a0 Launch Cygwin, then:<\/p>\n<pre>cd \/cygdrive\/c\/recovery<\/pre>\n<pre>tar -xvf \/cygdrive\/z\/borkstation.tar<\/pre>\n<p>This part takes a while, but when it&#8217;s complete, the entire system as backed up will be in the c:\\recovery directory.\u00a0 N.B.:\u00a0 this goes a little faster if you leave off the &#8220;v&#8221; parameter, but then you don&#8217;t see anything in the way of progress.\u00a0 It also helps to occlude or minimize the cygwin window.<\/p>\n<h4>Step 6:\u00a0 Rename and move files<\/h4>\n<p>There are three hardcoded paths in XP, that are probably the only folders in root on your minimal installation:\u00a0 Program Files, Documents and Settings, and WINDOWS.\u00a0 Within the c:\\recovery directory, rename these to something else.\u00a0 I chose &#8220;Program Files.recovery&#8221; and so on.<\/p>\n<p>Once these three directories are renamed, cut and paste everything from c:\\recovery to c:\\.\u00a0 There&#8217;s no need to replace any files in c:\\, and there shouldn&#8217;t be any overlaps, so if Windows asks if you want to overwrite any files, say &#8220;no.&#8221;<\/p>\n<h4>Step 7:\u00a0 Boot to Recovery Console and rename key folders<\/h4>\n<p>Here&#8217;s where Step 3 becomes pretty important.\u00a0 Once you boot into Recovery Console, you&#8217;ll need to allow yourself to work in the root of the drive using the &#8220;set&#8221; command:<\/p>\n<pre>set AllowAllPaths = TRUE<\/pre>\n<p>Once that&#8217;s done, you can rename the three hardcoded directory paths, moving the originals out of the way for your recovered files.\u00a0 For the sake of having a fallback position, I rename rather than delete them at this point:<\/p>\n<pre>ren \"Program Files\" \"Program Files.delete\"<\/pre>\n<pre>ren \"Program Files.recovery\" \"Program Files\"<\/pre>\n<pre>ren \"Documents and Settings\" \"Documents and Settings.delete\"<\/pre>\n<pre>ren \"Documents and Settings.recovery\" \"Documents and Settings\"<\/pre>\n<pre>ren WINDOWS WINDOWS.delete<\/pre>\n<pre>ren WINDOWS.recovery WINDOWS<\/pre>\n<p>The suffix &#8220;.delete&#8221; has no inherent meaning, it just gets the folders out of the way and signals that I don&#8217;t need them any more.\u00a0 Once this is done, and you&#8217;re sure there were no unfortunate typos, you can type &#8220;exit&#8221; to reboot to a recovered system.<\/p>\n<h4>Step 8:\u00a0 Clean up<\/h4>\n<p>After rebooting, pretty much everything should be as it was, although you&#8217;ll have three extra directories with a &#8220;.deleted&#8221; suffix plus the cygwin directory to get rid of.\u00a0 It may be necessary to take ownership and grant yourself permission to do so, but there&#8217;s really no reason not to wipe them all out, since your original folders and files should be intact.<\/p>\n<p>While the &#8220;read only&#8221; flag has been preserved for recovered files, the &#8220;hidden&#8221; and &#8220;system&#8221; attributes have not.\u00a0 For most files, this doesn&#8217;t seem to matter much, but the &#8220;desktop.ini&#8221; files that dot the drives can have weird side effects, like launching an editor upon boot and showing up.\u00a0 It&#8217;s easy enough to fix from the command line:<\/p>\n<pre>cd \\<\/pre>\n<pre>attrib +h +s \/s desktop.ini<\/pre>\n<p>This will grind away for a while, since it will reset all the desktop.ini files on the drive.\u00a0 Once complete, you&#8217;re back to where you were upon your last backup.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While it&#8217;s not well documented, it&#8217;s possible to do a bare-metal restore of a machine running Windows XP that&#8217;s been backed up via BackupPC (assuming, of course, that some method, such as that documented here, has been used to back up open files, such as the registry.) Step 1:\u00a0 Build \u2026 <a class=\"continue-reading-link\" href=\"http:\/\/www.goodjobsucking.com\/?p=219\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[36,91],"_links":{"self":[{"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=\/wp\/v2\/posts\/219"}],"collection":[{"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=219"}],"version-history":[{"count":9,"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions"}],"predecessor-version":[{"id":226,"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions\/226"}],"wp:attachment":[{"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodjobsucking.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}