How can I access file on a non-booting SSD with terminal?

I have a new MacBook air that hangs on boot-up. I can restore from a Time Machine back up, but it is a day old and I would like to recover work I did today off the hard drive before restoring, if possible. Apple support tells me that this should be possible using Terminal, but was not able/allowed to tell me how to do this and referred me to the communities. As usual, timing is miserable as I leave on a 3-week business trip in a few hours and need my laptop and files. Can anyone help me to do this?


Many thanks!

MacBook Air (13-inch, Early 2014), OS X Yosemite (10.10.2)

Posted on Mar 6, 2015 11:34 AM

Reply
10 replies

Mar 6, 2015 11:47 AM in response to dougtilton

First, you need to be able to boot from the Recovery HD:


Boot Using Command+R keys:


1. Restart the computer.

2. Immediately after the chime press and hold down the

"COMMAND" and the "R" keys together.

3. Release the keys when the Utilities Menu appears.


Once at the Utilities Menu select Terminal from the Utilities menu in the screen's menubar. Now, you need to know where these new files are located. You move to any location using the 'cd' command such as cd /Users/user_name/Documents, then press RETURN. Replace user_name with your actual username. Next you need to do a directory listing to see if your files are in that location, Documents. Use ls -al to do a directory listing of the files and folders in Documents. If you find your new files there, then connect an external drive or flash drive. You will need to know the name you have assigned to this drive. It needs to be already formatted. Copy your files using cp /Documents/filename /Volumes/volname/filename. Replace volname and filename with those that apply. Press RETURN.


Or take it to your local Apple Store and see if they can do the chore for you.

Mar 6, 2015 11:53 AM in response to Niel

Niel wrote:


If you're able to use Target Disk mode, hook the two computers up with a Thunderbolt cable, restart the MacBook Air with the T key held down, and copy the files off; if you need to do this in the Terminal, use the cp or ditto command.


(123560)

Firewire also works for Target disk mode. Thunderbolt to Firewire also works if you have the right leads & holes in the Macs 🙂


You should have the disk mounted as an external, so ditto or cp may be unnecessary, you should be able to drag & drop if the disk is mounting as readable.



@Kappy, can you 'cd /Users/…' in recovery mode?

surely the recovery OS is mounted at / not the boot disk?

Mar 6, 2015 12:31 PM in response to Drew Reece

Thanks. I've already tried to mount the volume, but it is FileVault encrypted (which may be the source of my problems). Terminal helpfully tells you haw to find the Logical Volume name of the encrypted drive, but now I need to figure out how to mount that. Not sure diskutil mount will work for that. Also, it says you can decrypt the drive from Terminal, but, again, I need to find instructions for that.


Not sure how to get photos in here ... I'm using Safari from the Recovery console. Will Command-Shift-4 give me a screen cap I can post?


I appreciate your help.

Mar 6, 2015 12:49 PM in response to dougtilton

The diskutil command & Disk Utility are basically the same tool. Both should be able to mount a filevault encrypted volume via recovery mode.


See if you can read the manual on your phone

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man8/diskutil.8.html

http://apple.co/1zWk8Sg the manual shortened for Safari in Recovery mode

http://apple.co/1wMrKvI <- this thread shortened


I think it is the unlockVolume argument in diskutil, but try in the GUI first.


I don't know about screen caps via recovery mode - I doubt you can find them even if the tool took images 😟.

Mar 6, 2015 3:04 PM in response to Drew Reece

Thanks, Drew.


I unlocked the volume in Disk Utility, and then I ran decryption in the volume. It actually still appears to be encrypted, unfortunately, but I was able to mount the drive and get files off to a flash.


I was hoping that with decryption I would be able to boot to safe mode or even just boot normally, but currently the boot process still hangs at 50%. I get to the login screen, enter my password, and then it hangs. I'd already tried resetting the nvram -- often suggested as a cure for this -- and fixing the permissions, so I'm kinda out of ideas.


Since I think I've managed to salvage today's work, I think I'm just going to try restoring from yesterday's backup now. I'm sort of running out of time.

Mar 6, 2015 3:32 PM in response to dougtilton

There is another option to if you think the issue is only in your account…

http://www.trickyways.com/2010/06/forgot-mac-password-see-how-to-reset-without-d isk/


Removing /var/db/.applesetupdone will cause the setup assistant to run on next boot, you can create a new admin account. If that new account runs & works OK you can try fixing the other account or consider migrating it's data to a new user (maybe exclude the users Library to reset that & then re-add data slowly).


There is also an option similar to safe mode for user accounts. Hold shift after clicking the login button - that disables all login items for the user account. That could be a reason for a hanging login.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I access file on a non-booting SSD with terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.