CompTIA Linux+ (XK0-006)System ManagementMedium
A technician needs to load a kernel module that requires two other modules to function correctly, without manually determining and loading each dependency. Which command should be used?
- Amodprobe
- Blsmod
- Cdepmod
- Dinsmod
Show answer & explanationAnswer & explanation
Correct answer: A. modprobe
modprobe intelligently loads a module along with any dependent modules by consulting /lib/modules/$(uname -r)/modules.dep, whereas insmod loads only the single specified module file with no dependency resolution.
Why the other options are wrong
- B. lsmod only lists currently loaded modules; it does not load anything.
- C. depmod generates the dependency list file but does not load modules itself.
- D. insmod inserts only the exact module file given, failing if dependencies are missing.
modprobe vs insmod
modprobe loads a kernel module plus its dependencies using the modules.dep map, while insmod inserts a single module file with no dependency handling.
- modprobe reads /lib/modules/$(uname -r)/modules.dep
- insmod requires the full path to a .ko file
- depmod regenerates the dependency database
Memory trick: 'modprobe brings friends; insmod comes alone.'