A module was loaded together with several modules it depends on. Which command unloads that module and then also unloads the dependencies that are left with a use count of zero?
LPIC-1 Exam 101-500, objective 101. System architecture medium
Draft — not checked yet. This question was written from the published exam objectives and cites the clause it comes from, but nobody has yet read it against that clause and signed for it.
It is kept out of search results and out of mock exams until they have. Read the source below before you take the answer as settled.
The options
Not correct rmmod usb_storage
Wrong. rmmod unloads exactly the one module named and does no dependency handling, so the now-unused modules it pulled in stay loaded.
Correct modprobe -r usb_storage
Correct. modprobe -r removes the named module and then recursively removes the modules it depended on, provided nothing else is still using them.
Not correct insmod usb_storage
Wrong. insmod only inserts a module, it has no removal mode at all, and it expects the full path to a .ko file rather than a module name, so this invocation fails outright.
Not correct depmod -a
Wrong. depmod -a rebuilds the module dependency database for the running kernel. It does not load or unload any module.
Why
modprobe is the dependency-aware front end: modprobe <name> loads a module plus everything it needs, and modprobe -r <name> reverses that, dropping dependencies whose use count has fallen to zero. insmod and rmmod are the low-level pair that act on a single module only. Neither will remove a module whose use count is above zero.
Where this comes from
- Cited
- LPI exam objective 101.1
- What it says
- Loading and unloading kernel modules, including handling module dependencies.
Practise this
Reading one question is not practice. The trainer will draw a set from objective 101 and space the ones you get wrong.