How to Get Your Data Off a Mac That Won’t Boot


AKA-PHOTO/Shutterstock.com

If your Mac won’t boot, there’s still a good chance you can recover the data. Here’s how you can get your files off your Mac’s internal drive—even if macOS keeps crashing or refusing to start.

Got a Recent Backup? Use That

Best practice dictates that you regularly back up your Mac to an external location. You can use Time Machine and a simple external USB hard drive to do this or set up a more elaborate networked solution.

When the worst happens and your Mac fails to boot, you can simply plug your Time Machine disk into another Mac and access your files from there instead. This method assumes you have a recent backup and that the backup includes the files you wish to access.

To access your files, plug your Time Machine drive into another Mac (or mount the network location if you’re using that method). Access the volume via Finder under the “Locations” section of the sidebar.

Double-click on the “Backups.backupdb” folder followed by the folder that matches the name of your Mac. You’ll now see a list of folders that represent each separate backup performed. “Latest” is where you’ll find your most recent backup.

Recover what you need or use the search bar in Finder to find specific folders or files. Do you have a new Mac that you want to restore your old files to? Learn how to restore a Mac from a Time Machine backup.

Got an Intel Mac? Use Target Disk Mode

Target Disk Mode can be used to share your (unresponsive) Mac’s drive with another Mac to transfer files, provided the source Mac isn’t using Apple Silicon. You can check if you’re running Intel or Apple Silicon under the Apple > About This Mac menu.

First, connect both Macs using a Firewire or Thunderbolt cable (this won’t work with a standard USB cable). Now make sure that the Mac you want to share from (the source) is switched off. On the source Mac(the one that won’t boot), press the power button then immediately hold T and wait to boot into Target Disk Mode.

Apple Thunderbolt 3
Apple

Now turn your attention to the second Mac. The source Mac’s drive should appear on your desktop (or in the Finder sidebar under “Locations”) once Target Disk Mode has been initiated. Double click on the drive to access it.

If the drive is encrypted with FileVault you should be prompted for the password which macOS can use to decrypt the volume. At this stage you can transfer any files you may need. Eject the drive and switch off the source Mac when you’re done.

RELATED: How to Boot Your Mac in Target Disk Mode for Easy File Transfers

Got an Apple Silicon Mac? Use Mac Sharing Mode

If you’re trying to share filesfrom an Apple Silicon-equipped Mac with an M1 chip or later, you can use Mac Sharing Mode. This is very similar to Target Disk Mode, though it works a little bit differently.

First, connect your two computers using a USB, USB-C, or Thunderbolt cable. Make sure the Apple Silicon Mac (that you want to share from) is turned off, then press and hold the power button until you see “Loading start-up options” on the screen.

Apple Silicon Chip Hero
Apple

From here select “Options” followed by “Continue” and enter your password when prompted. Your Mac will boot into Recovery Mode, at which point you’ll be able to select Utilities followed by Share Disk. Select the disk you would like to share, then click Start Sharing.

On your other Mac (the one you’re transferring filesto) open Finder, scroll down to the bottom of the sidebar, and click on Network in the “Locations” section. If all goes well, you should see the Mac you’re trying to copy data from appear. Double click on it then click“Connect” As followed by “Guest” then hit “Connect” to finalize the process.

You should now be able to see your Mac’s files and transfer anything you need. Eject the disk and shut down your (Apple Silicon) source Mac when you’re done.

Copy Your Data Using Recovery Mode

Apple includes a recovery partition on every Mac so that even if macOS won’t boot normally, you should be able to get into Recovery Mode to fix the problem. Recovery mode includes some useful features like a Terminal window, the ability to reinstall macOS, and Disk Utility for erasing and partitioning drives.

Access Mac Recovery Mode
Apple

Older Intel Mac owners can boot into recovery mode by holding Command+R at startup. If you have a newer Apple Silicon Mac, shut down your computer then press and hold the power button until you see “Loading startup options” then select Options > Continue.

If your drive isn’t encrypted with FileVault, you can access your files immediately and skip to the “Copy Files Using the Command Line” section below. Most drives are encrypted by default so if you aren’t sure, proceed with the next step (you’ll be able to check using a Terminal command).

Decrypting Your FileVault Drive (Terminal)

You can do this via Terminal using the command line, or via Disk Utility. If you’d rather do this via the graphical Disk Utility, skip to the next section.

As soon as Recovery Mode boots and you see a list of Utilities, click on Utilities > Terminal at the top of the screen to open a new Terminal window. Type diskutil apfs list into Terminal and hit Enter.

Find Disk Identifier

This will provide a list of APFS-formatted drives currently connected to your Mac. Look down the list until you find one that matches your main drive (it will likely be the only one labeled as “FileVault: Yes (Locked)”). Note the disk identifier in the “APFS Physical Store Disk” field. In our case it’s disk2s1. If none of your partitions are locked, you can skip to the next section.

You’ll need the FileVault password (the password you use to unlock your Mac) for this next step. Enter the following into Terminal diskutil apfs unlockVolume /dev/identifier but replace identifier with the label you made a note of in the previous step, e.g. disk2s1.

Unlock FileVault Partition Using Terminal

When prompted, type your password followed by Enter. If you make a mistake, enter the previous command and try again. If you get the password right, your disk has now been unlocked and mounted. Now it’s time to copy data to another drive.

Decrypting Your FileVault Drive (Disk Utility)

Rather than using the Terminal commands above, you can try doing this graphically with Disk Utility. We found the Terminal method worked in a case where Disk Utility didn’t. If the graphical Disk Utility method doesn’t work for you, try the Terminal commands above. (If you used the Terminal commands already, you don’t have to use the Disk Utility.)

Quit any Terminal windows so that the macOS Utilities window appears again, and select Disk Utility from the list. You should see your hard drive listed on the left of the screen in the “Internal” section. If it’s greyed out then it’s encrypted and not mounted.

Click on the “Data” partition on the left, then click on the “Mount” button at the top of the window. You will be prompted for your FileVault password, enter it and click the “Unlock” button. Your FileVault partition will be unlocked and mounted.

Mount Parition in Disk Utility

Copy Files Using the Command Line

You can’t run Finder in Recovery Mode, so any files will have to be copied manually using Terminal. This is easy if you know where your files are located, or if you have a sufficiently large external drive that you can simply copy everything (or just your user directory, if you’d rather).

You can use the ls /Volumes/Macintosh HD/ command to see an overview of your directory structure. Any directories with spaces in the name require a backslash before the space in commands. For example, a folder called “My Photos” becomes /My Photos/ instead.

List Directory Contents in Terminal

Any external drives you connect should be mounted automatically by the system. You can use ls /Volumes/ to check for the presence of the drive. If you can’t find the drive, quit Terminal to get back to the main macOS Utilities window. From here select Disk Utility, then look for the drive. If it doesn’t show up, disconnect and reconnect until it does.

Quit Disk Utility then launch Terminal using Utilities > Terminal. Now use the cpcommand to copy files, with the -Rflag to copy recursively (which includes all directories and files in a given location).

So let’s say for a moment you want to copy the entire user folder for a user called “htg” on the “Macintosh HD” partition to an external drive named “Rescue Disk”. The command you’d use to do this would be:

cp -R /Volumes/Macintosh HD/Users/htg/ /Volumes/Rescue Disk/

Replace the user “htg” with your own user (run ls /Volumes/Macintosh HD/Users/ to find it) and the destination drive with your own. The entire folder will be copied to the root directory of your external drive, assuming you have space to do so.

Copying Files Using Terminal

If you want to copy the contents to a specific folder on your external drive, use the mkdir command to do so before you start, for example: mkdir /Volumes/Rescue Disk/backup to create a folder titled “backup” in the root directory.

Consider Physically Removing the Drive

One last option is to physically remove the drive inside of the Mac and mount it in another computer. Since there is a lot of variance in the types of drives Apple uses, specific instructions will differ depending on your device.

The first thing you should do is look up your Mac model. You’ll find the serial number printed on the outside of the chassis somewhere (on the bottom of your MacBook, for example) which you can then plug in to checkcoverage.apple.comto get your precise model, year, and release date.

With this information, head to iFixit and look up your Mac model to find out how to get into the chassis. You will probably need a set of TORX screwdrivers for this, and you should take precautions like using an anti-static wrist strapand safely storing the screws until you need them again.

From here the directions will ultimately depend on the drive. If the Mac is especially old it may have a mechanical hard drive or an older solid-state drive. Most Macs now use M.2 or NVMe drives, some with proprietary connectors.

With the drive removed, you’ll need to work out how to attach it to another computer or a Mac. There are interfaces for M2 and NVMe drives that can make this process much easier, while a SATA to USB adapter will work for older SSD and HDD models.

Unfortunately, getting another machine to recognize your drive might be the biggest stumbling block. Will Haley’s blog has an excellent account of navigating this process, from finding an adapter to mounting the HFS+ partition in Linux.

If the drive is encrypted with FileVault, this may be a lot harder—especially if you’re not using macOS for the recovery process. If you are using macOS, try the following:

  1. Open a Terminal window and find the (APFS-formatted) volume you would like to mount using the diskutil apfs list command.
  2. Make a note of the volume identifier, for example disk1s1 .
  3. Enter the following command, replacing disk1s1 with the identifier you previously noted: diskutil apfs unlockVolume /dev/disk1s1
  4. Enter the password you would use when logging in to your Mac to decrypt the volume when prompted.

For a more in-depth look at decrypting FileVault volumes using Terminal, check out this excellent blog post by Der Flounder.

Now, Fix Your Mac

With your data (hopefully) safe, it’s time to turn your attention to that Mac that won’t boot. We’ve got a whole list of things to try when your Mac won’t boot, but if none of those work then you might need to reinstall macOS from scratch and start again. Good luck!





Source link

Leave a Reply

Your email address will not be published. Required fields are marked *