Is there any way to upgrade linux driver module without rebooting the system ?
1 Answer
Well, since you’re not that forthcoming with the info, let’s keep it theoretical.
Yes, a kernel module can be unloaded. It’s quite easy, too:
localhost ~ # modprobe kcopy
localhost ~ # lsmod
Module Size Used by
kcopy 5124 0
iTCO_wdt 4967 0
lpc_ich 13224 0
mfd_core 3041 1 lpc_ich
localhost ~ # modprobe -r kcopy
As you can see in the listing, the kernel module wasn’t in use (counter at 0). If a module is in use (e.g. a filesystem driver which has a mounted filesystem), it cannot be unloaded.
But this all depends on the kernel being built with support to remove modules:
[*] Enable loadable module support --->
--- Enable loadable module support
[*] Module unloading
(Symbol: MODULE_UNLOAD
)
There’s also support of forced removal, but it must not be used on production systems.
lsmod
output included.