Friday, April 26, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 4021  / 3 Years ago, sun, july 4, 2021, 11:40:45

When i do rmmod usb_storage and then dmesg i can see the output saying usb_storage deregistered. But when i attach a flash drive and then dmesg , it says



Initializing USB Mass Storage driver...
[16565.129239] scsi41 : usb-storage 1-1:1.0
[16565.130134] usbcore: registered new interface driver usb-storage
[16565.130172] USB Mass Storage support registered.


How do i manually insert/remove the module without it automatically getting loaded?


More From » kernel

 Answers
2

Just blacklist the kernel driver:



echo "blacklist usb-storage" | sudo tee -a /etc/modprobe.d/blacklist.conf


After that, nobody can use a USB flash drive in your system.



You'll have to manually "insmod" your driver with sudo to use USB devices again or if you want to restore the initial behaviour remove the module from the blacklist file.


[#26224] Monday, July 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eeperant

Total Points: 39
Total Questions: 106
Total Answers: 117

Location: Finland
Member since Sat, Dec 5, 2020
3 Years ago
;