But here is an more gentle approach:
- In terminal: kextstat -kl|grep IOUSB
- if IOUSBMassStorageClass is in the list the kernel extension is loaded; make sure there is no USB Mass Storage connected (unmounting is not enough)
- In terminal: sudo kextunload -b com.apple.iokit.IOUSBMassStorageClass
- if folder '/System/Library/Extensions Disabled' does not exists then
- In terminal: sudo mkdir '/System/Library/Extensions Disabled'
- in terminal: cd /System/Library
sudo mv Extensions/IOUSBMassStorageClass.kext/ Extensions\ Disabled/
You now have gently unloaded the kernel extension and disabled it for further loading. To undo this task, when you ever need it to work again simply move the extension back into the extension folder.
Keep in mind though that some system updates can install a newer version of this extension and USB Mass storage is enabled again, you need to redo those steps.