Go Back   MacRumors Forums > Apple Systems and Services > OS X

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 4, 2008, 01:03 AM   #1
ziggyonice
macrumors 68020
 
ziggyonice's Avatar
 
Join Date: Mar 2006
Location: Rural America
help -- copy to external via terminal?

The situation is this: I have a MacBook Pro, first generation. The internal hard drive has been damaged, and cannot boot the operating system (Mac OS X 10.5.2). Unfortunately, my last backup was not very recent, and I'm trying not to lose these files.

So my goal is to gain access to the hard drive, and copy everything on it to an external hard drive.

Note that the Firewire port on the machine is not working. Thus, any file transferring must be accomplished over USB or Ethernet. I also have access another Mac, if that would be of any assistance. Now let me throw you some ideas here. (For the record, I don't know if any of this will help, but it's worth a try.) I have booted the machine off the Leopard Install Disc. This now gives you access to several options:

Startup Disk. Disk Utility. Terminal. System Profiler. Network Profiler.

Something tells me Terminal might be able to make some magic happen. Unfortunately, I know nothing about the voodoo commands that can be issued in it to get this plan into action. I hear rumors about something called Single User Mode, however I know very little about it (other than, if entering the wrong command, erasing your drive).

So if anyone out there has any suggestion as to how to set this up, I'd appreciate it. Thanks.
__________________
MacBook Pro [First Generation] | 2.16GHz | 2GB RAM | 120GB HD | Mac OS X (10.6.4)
iPhone 4 | 32GB | Black (I couldn't wait for white any longer.)
ziggyonice is offline   0 Reply With Quote
Old Apr 4, 2008, 01:24 AM   #2
aaronw1986
macrumors 68030
 
Join Date: Oct 2006
I assume you could just use the terminal to use some basic Unix commands such as copy (cp).

http://www.computerhope.com/unix/ucp.htm
__________________
2012 rMBP 15" 2.6 Ghz, 16GB RAM, 512 GB SSD
2008 Mac Pro 8 core 2.8Ghz, 8800GT, 14GB RAM, 3TB
iPad 2 Black 64GB Verizon
2007 MBP 15" 2.4Ghz Glossy:4GB RAM
aaronw1986 is offline   0 Reply With Quote
Old Apr 4, 2008, 01:25 AM   #3
TH-Gunner
macrumors regular
 
Join Date: Mar 2008
I'm not 100% sure this will work... But here's some information that might get you started:

Disk drives are found in /Volumes. So an external HDD called "HDD" will be found in /Volumes/HDD (capitals matter in UNIX!)

So you might go about doing something like this...

[code]sudo cp /Volumes/"Macintosh HD" /Volumes/HDD[/quote]

That, in theory, should copy everything from your Macintosh HD folder/disk/directory (w/e you want to call it) and put it directly on your external HDD. I've never tried doing a whole disk backup with the terminal before, so I'm not sure how well it's going to work.

Something else you can do:

Use Disk Utility to make a disk image of your HDD.

1. Open up Disk Utility
2. Click your internal HDD on the left side bar
3. Click "New Image" on the top
4. Choose the location of your external HDD as the directory in which to save
5. Choose read/write for the Image Format (trust me on this, you don't want to do read-only)
6. Hit "Save," and it should do its magic.
__________________
"I have used a mac before. And they still don't have right click I mean come on. - aakar
LOL
TH-Gunner is offline   0 Reply With Quote
Old Apr 4, 2008, 02:01 AM   #4
SC68Cal
macrumors 68000
 
Join Date: Feb 2006
Don't bother copying system stuff over. Save your home directory before any more damage occurs to the disk.

Code:
cp -pr /Volumes/<name of your hard drive>/<your username> /Volumes/<backup drive>
You can press the Tab key for name completion.

Last edited by SC68Cal; Apr 4, 2008 at 02:10 AM.
SC68Cal is offline   1 Reply With Quote
Old Jan 8, 2013, 12:09 PM   #5
kimfjeld
macrumors newbie
 
Join Date: Dec 2012
Quote:
Originally Posted by SC68Cal View Post
Don't bother copying system stuff over. Save your home directory before any more damage occurs to the disk.

Code:
cp -pr /Volumes/<name of your hard drive>/<your username> /Volumes/<backup drive>
You can press the Tab key for name completion.
This. I had a similar problem, and it is the easiest and simplest solution out there - if you give a dawn about the system files.
kimfjeld is offline   0 Reply With Quote
Old Jan 8, 2013, 01:50 PM   #6
switon
macrumors 6502a
 
Join Date: Sep 2012
RE: dd, ditto, ddrescue, ...

Hi ziggyonice,

You might want to look into the Terminal "ditto", "dd", and "ddrescue" commands as possible substitutions for the "cp" command. The reasons being that "cp" will terminate when a file cannot be read while "ditto" will report the error to stderr and do its best to continue. (Yes, I know about the -R switch on cp, as in "cp -R", but in my limited experience ditto does a better job than cp.)

The "dd", or 'digital dump' or 'convert and copy' except that "cc" was already taken so "dd" was used instead, commands perform a lower level block copy of files/partitions/volumes, and thus may be used to recover corrupted files that cannot be recovered by other means. Why, "dd" can even be used to copy the boot sector of a hard drive and thus can be used to repair the MBR (Master Boot Record) on a Windows/Linux boot drive.

Another choice might be the "ddrescue" command which tries hard to rescue data when read errors are encountered. Personally, I use the "ddrescue" utility built from MacPorts on the Mac OS (Linuxes have their own versions). Speaking of which, I would also try to use a Linux to mount the damaged drive and then attempt the recovery using the Linux commands.

...just three other command possibilities to help in your attempt to recover your files from your corrupted hard drive...

Good luck,
Switon
switon is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Terminal Copy and Paste metier OS X Mavericks (10.9) 15 Nov 9, 2013 09:40 AM
Terminal - Exploring External Volumes? RadDave OS X 10.8 Mountain Lion 9 May 26, 2013 05:49 PM
General: Easy weather app fix (install OpenSSH, copy and paste Terminal code) thadoggfather Jailbreaks and iOS Hacks 0 Feb 6, 2013 12:27 AM
Copy HD or individual/folders files via Terminal? kimfjeld OS X 2 Dec 4, 2012 05:43 AM
Access external hard drive attached to airport from terminal mr sbe OS X 1 Sep 28, 2012 02:27 AM

Forum Jump

All times are GMT -5. The time now is 05:10 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC