{"id":282,"date":"2005-06-06T07:29:00","date_gmt":"2005-06-06T07:29:00","guid":{"rendered":"http:\/\/jclark.org\/weblog\/Apple\/OSX\/nfsbackup.html"},"modified":"2006-09-10T22:11:27","modified_gmt":"2006-09-11T02:11:27","slug":"nfsbackup","status":"publish","type":"post","link":"https:\/\/jclark.org\/weblog\/2005\/06\/06\/nfsbackup\/","title":{"rendered":"Backing up a Windows Laptop with OS X"},"content":{"rendered":"<p><strong>Update 9\/10\/2006:<\/strong> I&#8217;ve improved this procedure, and removed the need for NFS.  See <a href=\"http:\/\/jclark.org\/weblog\/2006\/09\/10\/howto-backup-an-entire-windows-drive-with-os-x-and-ubuntu\/\">HOWTO Backup an Entire Windows Drive with OS X and Ubuntu<\/a> for details.<\/p>\n<p>My wife&#8217;s XP laptop continues to get slower.  She&#8217;s had it for about 2 1\/2 years, and it&#8217;s still running the original XP install, so no surprise that performance is lousy.  I&#8217;ve considered dropping a desktop Linux install on it, but she has a couple of apps that still require Windows.  For now, I decided to format her hard drive and revert it to factory condition with the restore CDs that came with the machine.<\/p>\n<p>So now I needed to back up her machine.  It doesn&#8217;t support Firewire or USB2, so external drives were out.  In the past, I&#8217;ve always copied alot of files over the network, but this is time consuming, and usually error prone-  If windows decides it can&#8217;t copy a file, the whole copy operation stops, and you have to figure out what has copied and what hasn&#8217;t.<\/p>\n<p>I wanted something similar to Ghost.  Ghost is a PC backup solution the PC admin folks at work used to use.  It&#8217;s now a Symantec product, but I don&#8217;t think it was at the time.  The original was great- a single floppy (we used floppies back then) would boot, connect to the network, and copy the entire hard drive to an image file on a network server.  Modern versions allow you to grab files from inside the image; I don&#8217;t recall if the original did.  This is a feature I need; I&#8217;m not restoring the whole image to a drive.<\/p>\n<p>I tried to find an open source alternative (the current Symantec Ghost is overpriced, and I don&#8217;t trust Symantec software at all) without much luck.  I found <a href=\"http:\/\/www.partimage.org\/\">Partition Image for Linux<\/a>, but the images can&#8217;t be opened for access to individual files.  While researching, I came up with another idea&#8230; make a direct copy of the windows partition from a Linux Live CD (such as <a href=\"http:\/\/www.knopper.net\/knoppix\/index-en.html\">Knoppix<\/a>) using <code>dd<\/code>.  I figured the image might be mountable, just as you can mount an ISO CD image file.<\/p>\n<p>A word about efficiency:  This method copies the entire partion, empty blocks along with the rest.  So, copying Sherri&#8217;s 27G partion would result in a 27G image file.  However, I have the space on the iMac, the backup is only temporary, and I wanted to be sure I had <em>everything<\/em>.  Seemed worth a shot.<\/p>\n<p>In order to make the backup over the network, I needed to share a directory on the iMac as an NFS share, since I&#8217;d be connecting from a Linux Live CD.  OS X supports this, but not via a nice little applet like with Windows Sharing.  You need to fool around with <code>netinfo<\/code>, which I dislike, and run several daemons.  Since this is only for temporary use, I decided not to get my hands too dirty, and found a shareware utility called <a href=\"http:\/\/www.bresink.com\/osx\/NFSManager.html\">NFSManager<\/a> to handle the details for me.  Once I had created an NFS share, it was time to use it.<\/p>\n<p>I booted Sherri&#8217;s laptop using a Knoppix LiveCD, opened a shell, and mounted the NFS share (\/Users\/jclark\/Netmount on the iMac):<\/p>\n<pre><code>sudo su\nmdkir \/mnt\/mac\nmount -t nfs 192.168.1.105:\/Users\/jclark\/Netmount \/mnt\/mac<\/code><\/pre>\n<p>The first line makes me root for the ensuing commands.  I then make a mountpoint, and mount the NFS share to the mountpoint.  Interestingly, when I ran the mount command, the command appear to hang, but opening another terminal showed that the mount worked.  <\/p>\n<p>The laptop only had one drive (C:) so I suspected that I only needed to backup <code>\/dev\/hda1<\/code>, but I checked it with QtParted just to be safe.  QtParted is a GUI shell around GNU <code>parted<\/code>, and is accessible from the Knoppix start menu.  I would have used parted from the command line, but couldn&#8217;t find it in the Knoppix install.<\/p>\n<p>Once I had confirmed what I needed to backup, making the image was simple:<\/p>\n<pre><code>dd if=\/dev\/hda1 of=\/mnt\/mac\/laptop_drive<\/code><\/pre>\n<p>The transfer rate was about 10G\/hr, which isn&#8217;t too bad I suppose.  When it was finally complete, I tried to mount it under OS X using the <code>mount<\/code> command, with no success.  A little while later I realized I hadn&#8217;t specified to mount it via loopback (in other words, treat a file like a drive).  After a few minutes trying to figure how to do this in OS X, I got lazy and Googled.  One of my hits suggested an idea for opening a floppy image that seemed too good to be true, but I tried it anyway.<\/p>\n<p>I renamed the image file, adding <code>.img<\/code> to the name, and then double clicked the icon in Finder.  A few seconds later the drive image was mounted, and I had access to the entire drive backup.  Very cool. <\/p>\n<p>Now all I have to do is restore her factory drive image, clean off all the crap it came pre-loaded with, patch the crap out of XP, reinstall her software, and restore all of here files.<\/p>\n<p>Maybe I should just buy her an iBook&#8230;.<\/p>","protected":false},"excerpt":{"rendered":"<p>Update 9\/10\/2006: I&#8217;ve improved this procedure, and removed the need for NFS. See HOWTO Backup an Entire Windows Drive with OS X and Ubuntu for details. My wife&#8217;s XP laptop continues to get slower. She&#8217;s had it for about 2 1\/2 years, and it&#8217;s still running the original XP install, so no surprise that performance [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-282","post","type-post","status-publish","format-standard","hentry","category-osx"],"_links":{"self":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/comments?post=282"}],"version-history":[{"count":0,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/282\/revisions"}],"wp:attachment":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/media?parent=282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/categories?post=282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/tags?post=282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}