Skip to contentSkip to conversation

What is the difference between modprobe and insmod?

DISCUSSION bobo 3 participants 3 messages Dec 20, 2002

lore
Share & tools
lore

bobo

author
#0 lore raw

While writing IPtables scripts,there are two command: modprobe and insmod.

In some example,some use : modprobe ip_tables,but others use: insmod ip_tables.

Why? Is there difference between them?

Thanks

#1 lore raw
Quoted 7 lines · bobo

While writing IPtables scripts,there are two command:
modprobe and insmod.

In some example,some use : modprobe ip_tables,but others use:
insmod ip_tables.

Why? Is there difference between them?

For the purpose of loading specified modules you can consider them the same. Modprobe is a higher-level interface that will call insmod. I personally use modprobe since it succeeds silently. IE, if it successfully loads the module, or if the module is already loaded, insmod will report this, while modprobe will not output anything in these situations. They will both, by default, report failure to find/load a module, and the -q option tells them both to be quiet about errors, but insmod will /still/ report success even with -q.

For full details see "man insmod" and "man modprobe"... :^) (under KDE, the default IIRC with RedHat 7.2, using alt-F2 then #insmod in the dialog, or #insmod as a URL in konquerer works nicely)

j

#2 lore raw
In reply to bobo

The difference is that lsmod won't insert the dependent modules whereas the modprobe does.
Dharmendra.T
Linux Security Expert

Quoted 12 lines · bobo

While writing IPtables scripts,there are two command: modprobe and insmod.

In some example,some use : modprobe ip_tables,but others use: insmod ip_tables.

Why? Is there difference between them?

Thanks