What is the default location for kernel modules in a Linux system?

Prepare for the LPIC-2 Certification Test with our study tools, including flashcards and multiple choice questions with hints and explanations. Get ready to pass your exam!

The default location for kernel modules in a Linux system is indeed /lib/modules/$(uname -r). This path is essential because it allows the system to dynamically load the appropriate kernel modules that correspond to the currently running kernel version. The $(uname -r) command returns the version of the currently active kernel, ensuring that the correct modules are loaded for that specific kernel.

When a new kernel is installed or upgraded, the modules associated with that kernel version are compiled and placed in a directory named after that version under /lib/modules/. This helps maintain organization and facilitates the separation of modules for different kernel versions, enabling the system to manage multiple versions simultaneously.

The other options do not serve as the default path for kernel modules. /usr/lib/kernel/modules may seem plausible, but it is not the standard directory utilized by the Linux kernel for module storage. /etc/modules is generally a file used for specifying which modules should be loaded at boot time rather than a storage path. /var/lib/modules is also not recognized as a conventional location for kernel modules and does not align with standard practices in Linux systems. Therefore, /lib/modules/$(uname -r) remains the established convention for locating kernel modules.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy