How to recover files from a MAC that will not boot with Linux

I recently had a situation where one of our office Mac laptops failed to boot. I’ll likely need to reinstall the OS, but wanted to make sure I had all the important files before attempting this procedure.

Items Needed:

Flash drive for your files.
Linux LiveCD (I’m using an old CentOS 6.3 cd)
Network Connection

Insert the LiveCD.

Insert the Flash drive.

Boot the computer

Immediately after pressing the power button, press and hold the C button until the LiveCD’s boot menu loads. If required, select “Boot”, but DO NOT select the “Install” option!

Set the Root Password

Once the OS boots and the desktop is displayed, open a terminal and set a root password. You’ll need this for future steps.

sudo su
passwd

Install filesystem drivers

You’ll likely need to install drivers that allow the OS to read the Mac’s file system. For CentOS 6, I ran the following commands:

rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
yum install kmod-hfsplus

Mount the drives

Using the Desktop’s file browser, open the computer’s hard disk. (My example’s drive was called ‘7’) You will be asked for the root password, so enter the password you entered above.

You’ll also need to mount the Flash drive by opening it the same way you opened the computers file system.

Copy the files

I was unable to copy files from the User account using the file browser due to permissions set on the folder, but I had no problems copying files from the terminal.

Shutdown

Once the required files are copied to the flash drive, simply shutdown the computer.

 

Issues:

My original intent was to use ssh/rsync/scp to copy the files to a network linux machine.  Unfortunately I was unable to do this due to a couple of issues.

  1. Trying to use scp and rsync remotely would not recognize the path due to the Mac filesystem.  It would have to be copied from the host to the remote PC.
  2. trying to copy from the host failed when I tried to ssh into the remote pc due to the “read only” filesystem.  This is why I ended up just plugging in a Flash drive.
  3. The OS I used would not identify the Flash drive if I plugged it in after it booted.  Plugging it in before the boot process worked well for me.

 

I hope this helps!  Good luck!

Comments

So empty here ... leave a comment!

Leave a Reply

Sidebar