Thursday, June 09, 2011

How to run diskutil in single user mode on OSX Leopard and Snowleopard

After spending some wonderful time troubleshooting a Macbook Pro with a failing drive, I wanted to know if the filesystem was corrupted or if it was indeed a disk failure. In order to know this, I had to read the SMART data off the drive. Here is my attempt

First you need to boot into single user mode by turning on the computer and immediately pressing CMD + S where the CMD key is the Apple key. Continue to hold down command + s until you see the verbose logging appear.

Then mount your drive in r/w mode with:

mount -uw /

Then we need to load a couple of required system modules. DirectoryServices is only required if you want networking support.


launchctl load /System/Library/LaunchDaemons/com.apple.notifyd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.kextd.plist
launchctl load /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist
launchctl start com.apple.diskarbitrationd
launchctl load /System/Library/LaunchDaemon/com.apple.DirectoryServices.plist
launchctl load /System/Library/LaunchDaemons/com.apple.configd.plist

Now you should be able to at least run diskutil. You can run the following to check your specific drive
diskutil /dev/disk0sd2

You can enumerate your drives with

ls /dev/disk *


Right now its hanging for me but at least its running in single user mode which is better than before.

3 comments:

Anonymous said...

Did you ever get diskutil working in single mode? I tried everything

mklement0 said...

This shows how to get it to work (article is in German, but the required commands are shown; method still works as of OS X 10.9.2)

Anonymous said...

I keep getting "Permission Denied" when entering the first command