OS X: Force mounting a drive partition

• Bill Hunt

For once, it’s not my laptop that’s broken; it’s my external hard drive. For future reference, in OS X, if you encounter a drive partition that is recognized by the Disc Utility, but refuses to mount, try running these commands in the Terminal:

mkdir /Volumes/VolumeName
sudo mount -t hfs /dev/diskXsX /Volumes/VolumeName

Where diskXsX is the disk as specified in the Info window of Disk Utility. If that fails, open up Console, and check system.log. Or you can run this:

tail /var/log/system.log

You might see something like this:

Jun 27 23:01:02 localhost kernel: jnl: replay_journal: bad block list header @ 0x50a600 (checksum 0xeb7a03c6 != 0xc62acb43)
Jun 27 23:01:02 localhost kernel: jnl: journal_open: Error replaying the journal!
Jun 27 23:01:02 localhost kernel: hfs: early jnl init: failed to open/create the journal (retval 0).

If this is the case, then the journaling on that partition is screwed up really bad. I don’t know of a way to fix this, so I just mount the drive without journaling by running this command:

sudo /System/Library/Filesystems/hfs.fs/hfs.util -MU diskXsX /Volumes/MyVolume fixed readonly nosuid nodev

This should allow you to access the drive from the Terminal and copy the data off of it. Oh, and FYI, you can use regular expressions with most command line utilities, including cp:

cp -r ./iTunes Music/[0-9]* /Volumes/MyVolume/iTunes Music/

This is really useful when a copy has failed, and you want to start from a certain point.

cp -r project management team./iTunes Music/[m-zM-Z]* /Volumes/MyVolume/iTunes Music/

I really hate computers.

[Edit: As it turns out, disconnecting the drive in question, rebooting, and then re-connecting the drive caused everything to start working again. Miraculously.]