Home arrow Site Administration arrow Page 11 - Kernel, Cron, and User Administration, Part 1

/lib/modules/kernel_version/ Directory Structure - Administration

Today, get started with your RHCE certification. Learn about shell configuration files, setting up and managing disk quotas, and the basics of the kernel. This comes from chapter five of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7).

  1. Kernel, Cron, and User Administration, Part 1
  2. Certification Objective: Shell Configuration Files
  3. Setting Up and Managing Disk Quotas
  4. The Quota Package
  5. Quota Management Commands
  6. Automating Quota Settings
  7. The Basics of the Kernel
  8. Kernel Concepts
  9. Other RHEL 3 Kernels
  10. Understanding Kernel Modules
  11. /lib/modules/kernel_version/ Directory Structure
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 11
August 25, 2004

print this article



All kernel modules are stored in the /lib/modules/kernel_version/ directory. When RHEL 3 is installed, kernel_version=2.4.21-4.EL. If you have recently compiled a new kernel and your modules are not loading properly, then you have probably forgotten to compile and install the modules. In the /usr/src/kernel_version source directory, run the following commands:

# make modules
# make modules_install

The first line compiles the modules, while the second places them under the proper directory tree. In this directory tree, different subdirectories represent different groupings. The following is a sample of a module directory:

# ls -l /lib/modules/2.4.21-4.EL/kernel/drivers
total 60
drwxr-xr-x 7  root root 4096 Oct 23 15:22 addon
drwxr-xr-x 2  root root 4096 Oct 23 15:22 block
drwxr-xr-x 2  root root 4096 Oct 23 15:22 cdrom
drwxr-xr-x 8  root root 4096 Oct 23 15:22 char
drwxr-xr-x 2  root root 4096 Oct 23 15:22 ide
drwxr-xr-x 2  root root 4096 Oct 23 15:22 input
drwxr-xr-x 2  root root 4096 Oct 23 15:22 md
drwxr-xr-x 3  root root 4096 Oct 23 15:22 message
drwxr-xr-x 10 root root 4096 Oct 23 15:22 net
drwxr-xr-x 2  root root 4096 Oct 23 15:22 parport
drwxr-xr-x 2  root root 4096 Oct 23 15:22 pcmcia
drwxr-xr-x 5  root root 4096 Oct 23 15:22 scsi
drwxr-xr-x 5  root root 4096 Oct 23 15:22 sound
drwxr-xr-x 5  root root 4096 Oct 23 15:22 usb
drwxr-xr-x 3  root root 4096 Oct 23 15:22 video

Remember that each /lib/modules/kernel_version directory contains a modules.dep file that lists all the dependencies for all the modules within the directories. Each of these module directories includes a group of kernel modules for a common type of hardware. You might want to become familiar with where to find certain modules when needed. Here are some module types you can find under each directory:

  • addon   High-end cards such as for server racks
  • block   Block devices: parallel port ide drives, network block devices, XT disks, hardware raid devices
  • cdrom   Non-ATAPI CD-ROM drivers: Mitsumi, Sony
  • char   Miscellaneous input and serial devices
  • ide   Hard disk drivers
  • input   Input devices (keyboards, mice)
  • md   raid devices
  • message   Specialized I/O adapters
  • net   Network modules: basic network cards, generic ppp, slip
  • parport   Parallel port devices (not printers)
  • pcmcia   Drivers used by the pcmcia cardmgr daemon (the actual cards use separate drivers)
  • scsi   SCSI tape, RAID, and hard drive modules, video (special video modules for Linux)
  • sound   Sound adapters
  • usb   Universal Serial Bus hubs and devices
  • video   Graphics adapters

All modules have .o for an extension (such as pcnet32.o). You do not need to specify the full name, just the first part of the module file (pcnet32). Once you know the directory structure, you can have the modprobe command load all modules for a certain category. For instance, if you are on a PC and you donít know the network card, you can simply type

modprobe -t net

This will attempt to load all modules in /lib/modules/kernel_version/net, stopping when a match is found. To remove a module such as pcnet32 and all its dependencies, you can type either

modprobe -r pcnet32


rmmod -r pcnet32

Either of these commands will remove the modules and all their dependencies, provided they are not in use by another module or not currently active. For example, if your network is active, you canít remove the network pcnet32 driver module. If you want to remove only the module and leave the other dependent drivers, run the rmmod command without the -r switch.

This is part one from the fifth chapter of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7). Check it out at your favorite bookstore today. Buy this book now.

>>> More Site Administration Articles          >>> More By McGraw-Hill/Osborne

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates


Dev Shed Tutorial Topics: