Monday, 8 December 2014

How to save your data on a non bootable Macbook Pro (via recovery mode and terminal)

I recently had to pull data off of one of my coworkers Macbook Pro when his laptop became un-bootable and he had no backup.  I was able to boot the computer to single user mode using command+s,  unfortunately things were corrupt and the volume didn't even have the fsck executable in /sbin/

second approach was to boot into the recovery volume since it has a clean set of tools there for diagnosing and repairing.

diskutility was pretty useless and spewed a bunch of errors for about 10 minutes which resulted in nothing.  The only useful thing it did was tell the system drive was /dev/disk0s2

I then opened the terminal  and issued the following command:
fsck_hfs -fy /dev/disk0s2

this promptly diagnosed the drive and determined it was corrupt.  now for the repair

I used the following command:
diskutil repairvolume /dev/disk0s2

this did a bunch processing in the terminal and eventually said everything was clean and fixed.  Do I believe it?  no,  so I'm going to recover what data I can while the volume is mounted.

I plugged in an external USB drive the computer and it was promptly mounted at /Volumes/USB

from the terminal i used the following types of commands to manually copy the important data to the USB volume:

cp -r /Users/someone/Folder /Volumes/USB/Folder

No comments:

Post a Comment