How to kextunload in OS X Lion

I'm starting to learn more about the mac os x internals. Now i want to load and unload some kernel extensions.

I startet to load the MS-DOS file system via

sudo kextload /System/Library/Extensions/msdosfs.kext 

I can check this by typing

kextstat | grep msdos 

The command output shows the loaded kext-file. But when i want to unload the MS-DOS file system:

sudo kextunload com.apple.filesystems.msdosfs

I get only this message:

Can't create com.apple.filesystems.msdosfs.

What is wrong with the kextunload - line above?

3 Answers

kextunload can use the full Kernel Extension path, just like kextload.

sudo kextunload /System/Library/Extensions/msdosfs.kext

If you want to use the bundle identifier – the one listed by kextstat –, use the -b switch:

sudo kextunload -b com.apple.filesystems.msdosfs
2

kextload man page can give you details. Here is the command I've been using:

sudo kextload /path/to/file.kext

OR kextutil man page, this tool is useful for get some debug messages if there are errors in the loading process.

sudo kextutil /path/to/file.kext

And of course, the kextunload man page in the other answer. Here is the command I mainly use since I don't like to write out the entire bundle id:

sudo kextunload /path/to/file.kext

You can also use kextstat to verify if your kext file has been loaded:

kextstat | grep -v apple

This will list all third party kexts as long as 'apple' is not in the bundle id.

i had the same problem (Can't create –b. ; Can't create com.apple.driver.AppleUSBFTDI.) trying "sudo kextunload –b com.apple.driver.AppleUSBFTDI" on os x 10.9.5

but after i used the full path (sudo kextunload /System/Library/Extensions/), it worked...

that only happens on some kexts, for eg on other kext (/System/Library/Extensions/FTDIUSBSerialDriver.kext) , it works perfect with "sudo kextunload -b com.FTDI.driver.FTDIUSBSerialDriver"

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like