This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
user:mcooper6:rescue_mac [2011/08/11 12:19] – created mcooper6 | user:mcooper6:rescue_mac [2011/08/11 20:06] (current) – [Restore Mac OS X] mcooper6 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP left 40%> | ||
+ | ~~TOC~~ | ||
+ | </ | ||
+ | // | ||
+ | // | ||
+ | <WRAP centeralign 90% bigger> | ||
+ | <WRAP bigger fgred> | ||
+ | <WRAP muchbigger> | ||
+ | How to save your skin in less than two and a half days | ||
+ | </ | ||
+ | <WRAP left> | ||
+ | <WRAP info left bgwhite> | ||
+ | Following the steps in this tutorial will lead you through the process of: | ||
+ | *Recovering data from a Mac that won't boot after a catastrophic failure | ||
+ | *Restoring VirtualBox virtual machines to their working state, current to the time of failure | ||
+ | </ | ||
+ | <WRAP info left bgwhite> | ||
+ | Points to note: | ||
+ | * This approach uses a USB device for recovering piles of small data where no individual file is larger than 4GB. A second Mac is used in FireWire target mode to recover files larger than 4GB. (I.E. VirtualBox .vdi files) | ||
+ | * At the very least, you need your VirtualBox vm's machine xml file, the primary hard drive (.vdi file) and the snapshots (.sav files) to successfully restore your VirtualBox vm' | ||
+ | * It *is* possible to re-install Snow Leapord without losing your data. However, this assumes that you're drive is not damaged by whatever mayhem caused your Mac to stop booting in the first place. | ||
+ | * Your mileage may vary. If your machine catches fire, then you've done something wrong. | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | <WRAP clear></ | ||
+ | |||
+ | =====Background===== | ||
+ | |||
+ | This article details my exploits with a virtualized macbook pro running Mac OS X 10.6.3, with a 2.4 GHz Intel Core 2 Duo, and 4GB of RAM. On this machine reside 2 very important Virtual Machines; one Windows XP, and one Ubuntu 10.04. | ||
+ | |||
+ | **One good point about my setup: | ||
+ | |||
+ | Guess what, the Mac crashed. | ||
+ | |||
+ | =====Where to start===== | ||
+ | |||
+ | ====1. Swear==== | ||
+ | If you're working in seclusion, it is perfectly acceptable at this point to turn the air blue with profanities so vile that you offend yourself. | ||
+ | |||
+ | If you're working somewhere more crowded, try slamming the copier hatch down onto your hand. No one would blame you for cussing. | ||
+ | |||
+ | After you're done with all that: | ||
+ | < | ||
+ | The Data Rescue Prayer: | ||
+ | |||
+ | Dear Lord, | ||
+ | |||
+ | I know I have woefully ignored all the common sense that you've given me by not backing up my data, | ||
+ | but I pray that you not teach me that lesson right now. | ||
+ | |||
+ | Thanks. | ||
+ | |||
+ | Your Friend, Matt | ||
+ | |||
+ | </ | ||
+ | ====2. Salvage the data==== | ||
+ | |||
+ | There' | ||
+ | |||
+ | ===Single user mode=== | ||
+ | While starting your Mac, hold down command-S. | ||
+ | |||
+ | <cli> | ||
+ | ~:$ mount -t msdos / | ||
+ | </ | ||
+ | |||
+ | This command mounts the USB drive at the mount point Volumes. | ||
+ | |||
+ | <cli> | ||
+ | ~:$ mkdir / | ||
+ | </ | ||
+ | |||
+ | From there, initiate the slurp: (I'm copying all the files and folders within the directory named ' | ||
+ | <cli> | ||
+ | ~:$ cp -r -v / | ||
+ | </ | ||
+ | |||
+ | You can easily stream movies, and music, and presentations and all other sorts of bits in this manner. | ||
+ | |||
+ | ===FireWire and Target Mode=== | ||
+ | I just happened to have a second Mac (10.4.11 ppc) just sitting there, waiting. | ||
+ | <cli> | ||
+ | ~:$ shutdown -h now | ||
+ | </ | ||
+ | |||
+ | Now, with the second Mac still on, plug in each end of the FireWire to the respective machine. | ||
+ | |||
+ | Specifically, | ||
+ | *Users/< | ||
+ | *Users/< | ||
+ | *Users/< | ||
+ | *Users/< | ||
+ | |||
+ | For example, the name of one of the VM that I'm after is WinXP. | ||
+ | |||
+ | *Users/ | ||
+ | *Users/ | ||
+ | *Users/ | ||
+ | *Users/ | ||
+ | |||
+ | |||
+ | The Machines directory holds all the snapshot and current state information that is necessary to restore the vm to the state it was in prior to HD failure. | ||
+ | |||
+ | The VirtualBox.xml file is the primary file that VirtualBox reads when it opens, and when it starts a virtual machine. | ||
+ | |||
+ | <WRAP info bgwhite> | ||
+ | As previously noted, Snow Leopard may be reinstalled without losing your data, however the drive to be reinstalled needs to have ' | ||
+ | </ | ||
+ | |||
+ | ===Other things to try=== | ||
+ | |||
+ | If the previous approach is not working for you: | ||
+ | |||
+ | *Try formating SD Card as Mac OS X Extended (journaled) and using the Mac's built in SD card reader/ | ||
+ | *Try writing to a DVD | ||
+ | *Try compressing, | ||
+ | =====Restore Mac OS X===== | ||
+ | Now that you've salvaged all the data you can handle, it's time to re-OS. | ||
+ | |||
+ | If (like me) your disk happens to **not** be journaled, a reformat is necessary to make the switch (unless you had previous success switching this while in target mode). | ||
+ | |||
+ | Now that you've got a clean disk, hit the installer. | ||
+ | =====Restore VM' | ||
+ | |||
+ | This is the point where it becomes a little tricky, but if you follow these steps you should have a good shot of getting it right the first time. Assuming that you've successfully transferred those backed up VirtualBox files back onto the troubled Mac, fire up your browser and go get a copy of VirtualBox 3.1. | ||
+ | |||
+ | <WRAP info> | ||
+ | If your VM's were created in a different version of VirtualBox, then it is best to get that version. | ||
+ | </ | ||
+ | |||
+ | ====Create a new VM==== | ||
+ | Once installed, fire up VirtualBox and create a new VM. Make sure it has the same name and operating system as the VM that you're attempting to restore. | ||
+ | |||
+ | ====Make some snapshots==== | ||
+ | To make things a bit easier, create the same number of snapshots on the new VM as were available to the VM that you're trying to restore. | ||
+ | |||
+ | ====Configuration==== | ||
+ | ===The Directory=== | ||
+ | At this point, VirtualBox has created all the necessary files, … except the HardDisks directory. | ||
+ | |||
+ | ===The snapshots=== | ||
+ | In Finder, delete the new snapshots that were created by VirtualBox, and replace them with the snapshots restored from the ' | ||
+ | |||
+ | ===VM' | ||
+ | Replace the new machine' | ||
+ | |||
+ | <WRAP info> | ||
+ | If none of this works, *and* you've rescued your VM's ' | ||
+ | </ | ||
+ | |||
+ | While you're here, open the VM's .xml file and look for the < | ||
+ | |||
+ | < | ||
+ | |||
+ | < | ||
+ | <Image uuid=" | ||
+ | </ | ||
+ | |||
+ | Remove this tag from the VM's xml file. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===VirtualBox.xml=== | ||
+ | Open both the old and the new VirtualBox.xml in whatever editor you wish (you' | ||
+ | |||
+ | Find this line in both documents: | ||
+ | < | ||
+ | < | ||
+ | |||
+ | Replace the value attribute in this tag with the uuid of the VM that you're attempting to restore. | ||
+ | </ | ||
+ | |||
+ | Optionally, add this line to turn off the alerts upon startup: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | Next, in the machine registry, | ||
+ | |||
+ | < | ||
+ | < | ||
+ | |||
+ | Replace the uuid attribute with the uuid of your primary hard disk, | ||
+ | and replace the src attribute with the path to your VM's xml file. | ||
+ | |||
+ | </ | ||
+ | |||
+ | Now find the < | ||
+ | |||
+ | < | ||
+ | *My VM is named WinXP* | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The first uuid in this element set must be set to the uuid of the primary hard drive. | ||
+ | The location attribute should be changed to reflect the new location of the .vdi file in the ' | ||
+ | |||
+ | Nested elements are set to each respective snapshot. | ||
+ | </ | ||
+ | ===Fire it up=== | ||
+ | After all of this, you should now be able to fire up the VM as if nothing ever happened. | ||
+ | =====VirtualBox.xml===== | ||
+ | |||
+ | Below is the resulting VirtualBox.xml: | ||
+ | |||
+ | < | ||
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | =====Links===== | ||
+ | |||
+ | *[[http:// | ||
+ | *[[http:// | ||
+ | *[[http:// | ||
+ | *[[http:// | ||