3

I am struggling to disable USB ports on macs with the new Yosemite

My original intention was to give read only access to USB drives but it seems impossible, so I decided to go for the complete removal of the USB access

I followed the instructions on the osX manual but won't work

I tried this, posted here in the forum: link but it won't work

What I get now is this error link

(kernel) Can't remove kext com.apple.iokit.IOUSBMassStorageClass; services failed to terminate - 0xdc008018.

Failed to unload com.apple.iokit.IOUSBMassStorageClass - (libkern/kext) kext is in use or retained (cannot unload).

It may be because I removed the file from the extensions folder first, but if that was the case, why usb is still working? Hope you can help somehow.

Cheers

Community
  • 1
  • 1
Davide Biasco
  • 31
  • 1
  • 5

3 Answers3

1

Unload it first with

kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext/

However having said that removing and even deleting this kext in Yosemite doesn't seem to prevent USB working again on reboot. In fact you now lose the ability to unload the kernel extension once loaded.

Steve
  • 11
  • 1
  • 2
    Hello and thanks for the reply. Are you telling me that there is no way to disable the USB on Yosemite? There must be a way. Argh. – Davide Biasco Jun 10 '15 at 10:55
0

I'd like to improve the previous answer but I cannot comment on it, so I will add it here.

I am having the same problem and to solve it I confirm that you should unload the driver with

kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext/

In order to keep this setting at reboot, I added a call to the root crontab (since this won't be modified by updates nor other users)

to become root

sudo su -

modify root crontab

crontab -e

add the line to the file and close it

@reboot kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext/

I hope this helps

Kampai
  • 22,848
  • 21
  • 95
  • 95
GMZ
  • 1
0

You need to unload the AppleUSBCardReader and AppleUSBODD drivers as they load IOUSBMassStorageClass. Run the following commands in the terminal:

sudo kextunload -b com.apple.driver.AppleUSBCardReader <br>
sudo kextunload -b com.apple.driver.AppleUSBODD <br>
sudo kextunload -b com.apple.iokit.IOUSBMassStorageClass
cryptic_star
  • 1,863
  • 3
  • 26
  • 47