Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Copying Files to External Hard Drive via Terminal?

Hey guys!


So before I begin, I have a Mid 2011 Macbook Pro 15 inch, 16gb of RAM, and Yosemite 10.10.2 installed on my system.


I think my Macbook Pro's hardrive is giving up the ghost. Anytime I try to boot it up, it the loading bar fills to about the 1/4 mark and then the computer completely shuts down. I tried repairing the disk in recovery mode, but I get an error that simply states that the hardrive cannot be repaired and that I should back up as many files as I can. I even attempted to use the /fsck/ command in Single User mode to repair my disk, but it just gave me a disk I/O error. All of my research on the problem has pretty much lead to the conclusion that my hard drive is on it's last legs.


Because I am an absolute idiot, I have never activated Time Machine, and therefor, I have no backup of any of my files, and I don't see anyway to create a backup in recovery mode. That being said, I see that I can access Terminal from Recovery mode. Is there any way to use Terminal to back up my files to an external drive? Or am I completely screwed?

MacBook Pro, OS X Yosemite (10.10.2), 15 inch, Early 2011

Posted on Feb 14, 2015 10:54 PM

Reply
Question marked as Best reply

Posted on Feb 13, 2017 11:26 AM

So I stopped the back up before it was complete. How can I recover files from my external hard drive? My external Hard drive is 2tb why would the files get erased if it has more room than my Mac book hard drive?

9 replies

Feb 13, 2017 1:49 PM in response to John Lockwood

John,


If the OP has the DiskWarrior 5 USB stick, it can be inserted into the Mac prior to booting into Recovery. Once Terminal is launched in Recovery, one can then run DiskWarrior directly by the following command string, or change directory to that DiskWarrior binary:


/Volumes/DW/Installer\ Items/DiskWarrior.app/Contents/MacOS/DiskWarrior &


This will launch DiskWarrior 5 GUI, and one is good to go. For the OP drive circumstance, I would be inclined to press the Option key which will allow Rebuild... and Scavenge.


I have done this myself, so I know it works.

Feb 16, 2015 4:37 AM in response to BraveNewCliche

You can in theory boot to a Recovery partition or the Internet Recovery software, from that you can then in theory use Terminal to copy files to an external drive. Roughly the command would be


ditto /path/to/source /Volumes/path/to/destination


As a tip if you are copying a folder and you want ditto to make the same folder on the destination you need to include the folder name in the destination path, e.g.


ditto /Users/myuser/Documents/myfolder /Volumes/Backup/myfolder


Before however you get stuck in to trying the above you might want to consider trying DiskWarrior. I don't believe it will necessarily be able to repair the damage any better than Disk Utility aka. fsck because it sounds like the hard disk has developed a hardware problem, but Disk Warrior can sometimes 'mount' a virtual copy of the hard disk and let you copy files from this virtual copy. I have myself managed to recover the vast majority of a hard disk this way.


To do this you would need to boot from a different drive, install Disk Warrior on it, run it to try and access the failing drive and then you should be able to try using the Finder to copy files from the virtual copy of the drive.

Copying Files to External Hard Drive via Terminal?

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