Single User Mode - mount external drive and copy user files to there

I have an iBook G4 running (I think) Tiger (although it may be Panther). AHT reports a bad HD and it will not boot from that drive. Mounting it via Target Disk to another Mac won't permit me to even see beyond the root directory; just a spinning sunburst at the bottom of the Finder window.

If I boot into single-user mode, I can "ls" and "cd" to see the files and folders in the home folder. Assuming the HD is named "Macintosh HD" and I have a USB-connected hard drive named "Backup", what are the commands I need to use in single-user mode in order to mount "Backup" and copy the user's home folder (there's only one on this drive) over to "Backup"?

As I indicated above, I'm not absolutely sure whether this iBook is running Panther or Tiger.

Thanks in advance for any assistance!

Intel iMac 24" / MacBook, Mac OS X (10.5.5), Where the h*** did all these external drives come from?

Posted on Jan 9, 2009 6:37 PM

Reply
17 replies

Jan 9, 2009 6:46 PM in response to Barry Levine

When you connect Backup it should mount automatically. You can cd to it by entering cd /Volumes/Backup and pressing RETURN. However, you cannot write to it until you mount a writeable filesystem by entering: /usr/sbin/mount -uw /Volumes/Backup and pressing RETURN. You should now be able copy files from Macintosh HD to /Volumes/Backup. To return to Macintosh HD just enter cd /.

Jan 9, 2009 7:24 PM in response to Barry Levine

Shouldn't. I've done this before. I recall the external drive mounted on its own. If not, then you might just issue the mount command first, then see if you can cd to it. If the system isn't recognizing OS X disk names then do a /bin/df to find out what the Unix device is. You may need to replace /Volumes/Backup with /dev/deviname instead.

Not something I do very often so my memory is sometimes fuzzy.

Jan 9, 2009 7:55 PM in response to Kappy

Assuming I can ever see the external drive in some listing, then all I want to do is copy the Pictures and Music folders from the user's home folder over to the external drive.

AHT reports this HD is bad. Can't boot from it. DiskWarrior chokes on attempting to read the directory of the "problem" drive. DataRescue, likewise, can't begin to do its job because of the directory issue. I'm trying to do this outside of the GUI simply because I may have better luck.

Jan 9, 2009 8:12 PM in response to Barry Levine

The problem may well be because the drive is bad that there's a problem with the Unix system. I'm not sure. Wish I knew more Unix.

You can try the mount -a command which should mount all filesystems defined in fstab, but I'm not sure if that will help since fstab was deprecated but that may not have been until Leopard.

DF should produce a listing of all mounted devices in /dev. Maybe you should try restarting into single-user mode with the external drive already connected (if you haven't already) on the off chance it will appear.

But given the disks directory is badly hosed this may be a limitation for you.

Jan 10, 2009 3:19 AM in response to Barry Levine

Instead of running Single-User mode from your damaged HD, if you have the OS X install disk for the G4, you could try booting from it and running Terminal from there. Terminal is in the Utilities menu at the top left of the initial install screen.
All connected volumes should normally mount automatically, though it's unclear if your bad internal HD would mount and be readable. They would all be in /Volumes, so
ls /Volumes
should show them.

Jan 10, 2009 7:18 AM in response to jsd2

Okay; I'm in the Terminal (bash) and managed to cd over to the proper directory on the hard drive (Pictures). I tried using "ditto" to copy everything to a drive named "300GB" but I get an error saying that 300GB isn't writable. I've tried "mount -uw 300GB" and "usr/sbin/mount -uw 300GB" but the mount command isn't recognized. I think I'm getting closer but I'm still not there.

Keep the advice coming! Thanks.

Jan 10, 2009 8:39 AM in response to Barry Levine

This is from "man ditto":
-------
The command:
ditto src_directory dst_directory
copies the contents of src_directory into dst_directory, creating
dst_directory if it does not already exist.
--------

I am no Unix expert, and you might want to wait to get input from others, but here are my thoughts:

When you are booted from the install disk, your root directory / is the install disk itself. To get to the mounted volumes, you need to go through /Volumes. Remember also that a pathname that begins with a slash is an absolute pathname; one that does not begin with a slash is a pathname that is relative to the current directory you are in.

I would first cd to your home folder on Macintosh HD, via (including the quotes):

cd /Volumes/"Macintosh HD"/Users/yourshortname


then
ls

to be sure Pictures and Music are in there,
then
ditto Pictures /Volumes/300GB/Pictures

and
ditto Music /Volumes/300GB/Music

Jan 10, 2009 9:29 AM in response to jsd2

I'm in the middle of copying things.

I did a chmod -R ug+w (IIRC) to the 300GB volume and this made it writable.

I then CD'd to the Pictures folder on the Macintosh HD.

I then did a cp *.jpg /Volumes/300GB/ and found that it managed to copy all of the jpegs that were sitting loose in the Pictures folder. Some of the photos were corrupted but I expected this as the drive is reported to have a hardware issue by AHT.

I'm now in the process of copying the iPhoto Library using the cp -r command. Some files are being reported as bad and can't be copied but, again, I'm expecting this.

Whatever I can get from this drive will be a bonus. I'll mention that I used Drive Genius to duplicate the HD to a disk image and, while this was done successfully, it resulted in a "no filesystem" error when I attempted to mount it. However, I -did- ask for it to be mounted anyway and then used DiskWarrior on it (even though it didn't appear in the Finder). It took a few hours for DiskWarrior to come up with a "preview" of the disk (as the filesystem was thoroughly hosed). The User folder was nowhere to be found and every file that was displayed was corrupt. That's why I'm trying this "out of the GUI" process.

I'll thank everyone who made suggestions; they all pointed me in the proper direction.

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.

Single User Mode - mount external drive and copy user files to there

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