9
[rootSERVER ~]# rmmod -f cifs
ERROR: Removing 'cifs': Resource temporarily unavailable
[rootSERVER ~]# modprobe -r cifs
FATAL: Module cifs is in use.
[root@SERVER ~]# lsb_release -a
LSB Version:    :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: Scientific
Description:    Scientific Linux release 6.1 (Carbon)
Release:    6.1
Codename:   Carbon
[root@SERVER ~]# 

I tried

rmmod -fw cifs

but it just waited for ages... (and yes, all cifs shares are "umount -l"-ed before trying to remove cifs module..)

QUESTION: how can I remove the cifs module??

gasko peter
  • 5,434
  • 22
  • 83
  • 145

3 Answers3

7

You can try modprobe -r which can resolve some dependency issues for you, while rmmod will do nothing else than trying to unload the module.

Also, there is an explicit kernel option on forced module unloading because it's hardly ever a good idea to do so. Can your kernel actually force a module to unload? Because if it can't the -f switch does precisely nothing.

Bananguin
  • 7,796
  • 2
  • 25
  • 57
0

You get it to stop being in use. i.e. unmount all of your cifs mount points.

psusi
  • 17,007
  • 3
  • 40
  • 51
0
/usr/bin/sudo /bin/umount -f -a -t cifs
/usr/bin/sudo /bin/umount -f -l -a -t cifs
sleep 5
/usr/bin/sudo /sbin/modprobe -r -f cifs
pkill nautilus
gasko peter
  • 5,434
  • 22
  • 83
  • 145