January 23, 2009

Mac: Fixing a Bad Driver (kext) on boot

Sometimes it's not easy on the web to find a place where you can get help in case of your Mac doesn't boot.
Maybe it's because you are a first timer trying to install a hackint0sh, maybe because you are trying new drivers on your Mac...
Whatever the reason, there is a good chance your Mac stops loading.

These 3 cases below can help you diagnose and fix the situation.
I hope they are as usefull to you as they were to me!

Case 1: Leopard doesn't load due to a bad driver

- Try booting with the Shift key pressed (for Safe mode), and Leopard will only load the most important drivers.
If Leopard still doesn't load, see the other options below.

Case 2: Discover which driver is preventing Leopard from starting up
- On boot, when the message "Press any key to enter startup options" appears, enter "-v" (for Verbose)
The boot will proceed and will dump all messages and errors to the screen.
When the loading stops, read the last messages and seek for errors. With any luck you will have the name of the driver that is preventing the Mac from loading.

Hint: Google the driver name to find the path and filename of the offending file.
Hint: A "kext" is a driver, a "plist" is a configuration file in XML (text file)
Hint: The driver that gives most problems in 1st time hackint0sh installations is the Power Management driver. If this is your case, the easiest way is to reinstall Leopard like you did the first time, but this time check the option to remove the Power Management driver (on the drivers list)

Case 3: Remove/Replace a bad driver that prevents Leopard from starting up
Notice: To do this you need to know the filename of the offending file(s), and you need to know your way around the command line. If you don't, leave it to a professional, otherwise you may end up with a problem worse than the one you started with!
- On boot, when the message "Press any key to enter startup options" appears, enter "-s" (for Single-user mode)
Type these commands (the same ones on the screen):
  /sbin/fsck -fy
  /sbin/mount -uw /
From now on it's up to you, but if you are used do DOS, these are some equivalents on Mac/Unix (notice also the parameters of these are different). I hope it's a good start so that you can fix the driver yourself:
  ls = dir
  cp = copy
  mv = move
  rm = del
  rmdir = rd
Example 1: List kexts:
  ls -la | less /System/Library/Extensions/*
Example 2: Remove a bad kext:
  rm -R /System/Library/Extensions/bad_kext_file
  rm /System/Library/Extensions.mkext
Do your magic, and in the end type:
  exit
Reboot with the "-f" option.

Good luck!

6 comments:

Givver said...

You are a life saver!

Thank You

Raymond said...

For Step 3, I boot into the Single-user mode, but the kernel panic still occur after few second.

That I cannot type:
/sbin/fsck -fy

How could I fix it, thanks a lot.

Don Synstelien said...

Thanks,
This helped me pull myself out of a fix.

Cheers,
Don

Martin said...

This post saved me from wasting an entire day trying to get my stuff outta OSX and into Ubuntu. Thanks a lot! I couldn't find how to boot without loading a specific kext when i came across your blog and this post did the trick.

Thanks again!

Frank said...

@Raymond: An additional option is to boot off your original install disk, and before the install begins, select the Terminal under the Utilities dropdown menu to do what you need to do. The boot device will already be mounted, Just enter 'mount' to see where it lives and change directory to it.

Anonymous said...

Sweet post! Saved a few hours out of my day, cheers mate.

Post a Comment