Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Mount a trashed hard drive using Target Disk mode System
I recently had my iBook hard drive go bad, rendering the machine unbootable. The file system was corrupt, but booting the machine in single user mode revealed that large amounts of data were still recoverable. Problem was that I could not burn these to CD in the single user mode (hdiutil threw a bus error, probably due to the file system corruption), and network services would not start. Thus, the data was there, but I could not salvage it to a safe location. Also, attempts to run disk repair from CD or fsck manually from the command line were unsuccessful, as the filesystem was already sufficiently hosed.

I then proceeded to boot the iBook as a FireWire Target Disk (by pressing T upon power-on), hooked to a G5 iMac, but alas, the iBook disk would not display itself in the Finder. Analysing the system logs showed that mounting attempts were unsuccessful due to the iBook's hard drive not passing file system check. On the iMac's command line, however, I managed to mount the half-broken iBook disk successfully by taking the following steps:
  1. Create a mount point for the iBook by typing:
     mkdir /Volumes/iBook
  2. Mount the iBook disk in read-only mode by typing:
     mount -t hfs -r /dev/diskXXXX /Volumes/iBook
    The -r argument forces the disk to be mounted as read-only. Replace the XXXX with the designation of the target disk on the host machine, e.g. by looking at the FireWire devices in About This Mac.
To my surprise, the disk mounted without complaints, and I was able to salvage large amounts of data -- as long as I kept out of the directiories that were most damaged. All important data is now safe, and I am shipping the iBook to Apple under warranty. I hope that this hint might prove useful for anyone that experiences a hard drive failure and partial filesystem corruption.
    •    
  • Currently 3.43 / 5
  You rated: 4 / 5 (7 votes cast)
 
[65,622 views]  

Mount a trashed hard drive using Target Disk mode | 27 comments | Create New Account
Click here to return to the 'Mount a trashed hard drive using Target Disk mode' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mount a trashed hard drive using Target Disk mode
Authored by: bdjones on Nov 29, '04 11:51:35AM

Just curious, did you try DiskWarrior?



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: bpfh on Nov 29, '04 12:34:39PM

Nope, no need for DiskWarrior as the trusty old command line did the job perfectly, in this particular case :)

-bpfh



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: guybrush on Nov 29, '04 12:20:00PM

thx for the hint, should come in handy sometime.

I've had a few occasions when my USB hdd didnt automount in Finder (reboot worked tho), when I encounter this problem again I guess i'll try to mount it myself via Terminal :)



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: javiolo on Nov 29, '04 01:08:49PM
I have a USB Lacie external hd that doesn´t mount (Win or Mac) I tried several apps to mount it but they don´t find it... I´ve checked USB devices in About mac and appears there, Lacie d2 Drive USB2. Now I don´t what to write in the code you posted
 mount -t hfs -r /dev/diskXXXX /Volumes/iBook 
What I have to substite the diskXXXX value? Lacie d2 Drive USB2 ? Thanks

[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: bpfh on Nov 29, '04 03:41:18PM

Sorry, I do not know what the designation for an USB drive would be. At the moment, my SanDisk card reader, for instance, appears as /dev/disk2s2.

I am not sure how to get a listing of active devices in MacOS X. Entering ls /dev/disk* will give you a complete listing, but how to determine which one is your USB drive? Anyone?

-bpfh

[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: guybrush on Nov 30, '04 07:24:06AM

When i mount i see 'BSD Name' in 'About this Mac->More Info'

for example
BSD Name: disk2
...
File System: Journaled HFS+
BSD Name: disk2s9

Not sure if it appears if it DOESNT mount correctly in finder..



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: foilpan on Nov 29, '04 12:41:01PM

just for reference, did you experience anything weird before the disk became unusable?

i've never had a drive become so unusable that something like this would be necessary. at least i don't think it's happened yet. (now i've jinxed myself...)

thanks!



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: bpfh on Nov 29, '04 04:39:31PM

The only indication was that just before the system was rendered unbootable, I started getting heavy pizza spinning and hard drive grind. That's all.

-bpfh



[ Reply to This | # ]
Also might work for a trashed board
Authored by: greed on Nov 29, '04 01:50:00PM

Similarly, I recently discovered that my iBook was eligible for the Logic Board Repair Extension Program. The screen did all sorts of neat things I didn't know an LCD could do. Upon reset, when the system discovered it didn't have video, it shut down again. (Mine doesn't have a power LED, so it is very hard to tell--I had to listen for the HDD parking to realize what was happening.)

Well, being the untrusting kind of guy I am, I didn't want to send it in for repair with the drive intact. So I tried target disk mode, and lo! It worked!

A couple of hours with Retrospect and a few blank DVD-Rs and I had a full offline backup, and the online backups were all brought up-to-date. (I'm paranoid... but am I paranoid enough?)

A quick wipe of the hard disk, and off to the nearest repair centre it goes.

One thing, though: Make sure you get the person at the repair centre to WRITE DOWN that you wiped the disk. Otherwise they get very nervous when they can't boot the machine after fixing the logic board--they really don't want to have broken your hard drive in the process....

So, moral is, give Target Disk Mode a try when all is dark and there seems to be no hope....



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: peedog on Nov 29, '04 01:57:41PM

That's an excellent strategy to recover data from a hard drive heading south. Mounting with the read only option set prevents or delays the prospect of a drive crashing because of a write action taken by the system, which is beyond the user's control. I use this frequently in Linux. On the Mac, however, have you learned how to disable the service which automatically attempts to mount attached devices (in a read-write manner)? Then you could shut down the computer, attach a device, and mount it yourself manually.



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: soumyeah on Nov 29, '04 02:30:45PM

can i use Target Disk Mode to recover data from an internal HD that is not the boot disk? I have a G4 desktop and recently the internalHD i use for storage, which has worked well for a year+, no longer mountes. Diskwarrior and similar programs seem unable to help due to a corrupt filesystem (a failing PRAm battery may have led to this corruption).
When i hook it up to a G4 ibook in Target Disk Mode, only the boot drive shows on the ibook...
how can i access and recover data from the extra internal HD?
any help would be greatly appreciated!
patrick



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: szabesz on Nov 30, '04 07:19:23AM

Borrow (or buy) a FireWire Drive kit, so that you can pud your HD in it in order to have an external drive instead.
I do not know much about extra internal drives, but my iBook's  combo drive works well on the host machine while using the iBook in Target Disk Mode.



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: szabesz on Nov 30, '04 07:27:05AM

I have also read this tip several times. Though I have never tested it, I recommend to perform the whole procedure in a cool and dry environment. Taking cold objects to a warm room generates water drops on the objects's surface and you risk making more damage to the HD than you have had before putting it in the freezer....



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: szabesz on Nov 30, '04 07:32:22AM

sorry, I have missed it :)



[ Reply to This | # ]
Keeping it cool...
Authored by: mikerose on Nov 29, '04 10:45:13PM

While not applicable in every case, we've had a lot of good luck over the past six months with a simple data recovery technique: put the hard drive, or the entire laptop if needed, in the freezer for 20 minutes. Bring it out and use a DriveDock or target disk mode to back up the user folder to another machine. We've 'saved' drives this way that were unmountable and unrecoverable with DiskWarrior, DataRescueX and other tools of last resort.

It may sound silly, but in my experience it works pretty well.



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: intrinsicchaos on Nov 29, '04 11:44:05PM
I am trying to do this with an external HD via USB (the Firewire interface doesn't seem to work, period, either on my iBook or my new 17" iMac G5). I follow the exact directions in Terminal but when doing the mount command, i get "mount_hfs: invalid argument." What I'm typing is
mount -t hfs -r /dev/disk1s1 /Volumes/USB/
I don't get it?

[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: intrinsicchaos on Nov 29, '04 11:58:03PM

I should also add that the HD in question is Windows NTFS. I can't get it to mount at all on either machines. Via Firewire, it doesn't even appear in Disk Utility and only in System Profiler as "Firewire 400 device". Via USB, it does appear in Disk Utility but can't be mounted.



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: intrinsicchaos on Nov 30, '04 12:04:02AM
When typing
mount -r /dev/disk1s1 /Volumes/USB
the result is
/dev/disk2s1 on /Volumes/USB: Incorrect super block
What does that mean?

[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: bpfh on Nov 30, '04 12:51:28AM

The hfs argument specifies the file system type, and if your disk is NTFS, naturally this will not work. Try -t ntfs instead.

-bpfh



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: intrinsicchaos on Nov 30, '04 09:48:42PM

Nope, didn't work - no such thing as mount_ntfs, apparently.



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: Ut on Dec 05, '04 08:08:02AM

/dev/disk1s1 ist the partition map of disk1, not a volume. The hfs volume must be /dev/disk1s2 or higher. For the right number, look inside the console for diskarbitrationd's mounting error message.



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: LC on Nov 30, '04 12:15:37AM
You mentioned not being able to run hdiutil when booted single-user; that's true, but I think you can start the services needed before trying to run it. hdiutil needs access to a whole bunch of frameworks at runtime.
I think you might also want to use /usr/sbin/diskutil. In either case, the kextd and other stuff needs to be active ... so the actions in /etc/rc need to be executed first. The last line is SystemStarter which will get you the /System/Library/StartupItems items, including Disks ... I don't remember the last place to stop, to avoid multi-user or graphical login manager ... I think you can -C SystemStarter in case it goes to far or gets stuck; Larry.

[ Reply to This | # ]
mount_hfs: Invalid argument
Authored by: msmithstubbs on Nov 30, '04 08:03:02AM

I use:

mount -t hfs -r /dev/disk2 /Volumes/snafu

and I get:

mount_hfs: Invalid argument

I checked system profiler and my firewire drive is definitely disk2. And yes, it is HFS (actually I think it is HFS+, does that make a difference.) I did try with NTFS but that didn't work either.

any suggestions? Thanks!



[ Reply to This | # ]
mount_hfs: Invalid argument
Authored by: bpfh on Dec 01, '04 01:13:12AM

Coming from Linux side, I cannot really guarantee that what I am saying is at all true, but I would suspect that disk2 refers to the entire disk. Something like disk2s<something> might refer to the correct partition.

-bfph



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: DJR213 on Dec 03, '04 05:37:57PM

Would that technique work on say, a Powerbook G3? It is the 333mHz (lombard?) one. When I turn it on, the folder with the question mark appears. I tried to zap the PRAM but that didnt work. I have some pretty important stuff that I havent seen in about 2 years.



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: croasmun on Dec 25, '04 09:03:54AM

When running the above command, all I get is "mount_hfs: device busy" Any help? This has been a pretty sad Christmas watching a month's worth of work (sice last backup) disappear... not to mention the Complete U2 ($150...)



[ Reply to This | # ]
Mount a trashed hard drive using Target Disk mode
Authored by: ziyad on May 25, '05 07:40:24AM

i'm getting this error
mount_hfs: Block device required

I'm using
mount -t hfs -r /dev/rdisk1s10 /Volumes/recover

data rescue says my external firewire drive is rdisk1s10



[ Reply to This | # ]