Linux System Administration

Basic Linux kernel module administration commands
Basic Linux kernel module administration commands
Linux command syntaxLinux command description
ls -R /lib/modules/$(uname -r) Command to list all modules available for a given linux system
modinfo /path/to/module.ko Display module information
insmod kernel-module-name Install a module to a running kernel. NOTE: this command does not resolve module dependencies
modprobe kernel-module-name Install a module to a running kernel inlcuding dependencies
depmod -a Rebuild module dependancy database using /lib/modules/$(uname -r)/modules.dep
insmod --force kernel-module-name Force insmod to load module even if its build for a defferent module version
modprobe -n -v kernel-module-name Display insmod commands to load module and its dependencies. Useful when modprobe gives up due to dependency problem
lsmod Display all modules currently loaded into a kernel
rmmod kernel-module-name Command to remove a module from a running kernel

Booting a MS Windows OS using GRUB is a quite simple process. However, we must follow some rules in order to succeed. The first and foremost rule is:

  • Windows OS always wants to be installed on a first hard drive and first partition.
  • if you have your windows installation on second hard drive you need to use grub's map command to re-map first hardrive as seccond and vice versa

Grub's Naming convetion

Grub starts its hard drive and partition numbering system from 0. This means that (hd0,0) refers to a first hard drive and first primary partition. Whereas, (hd2,2) refers to third hard drive and third primary partition. All extended partitions starts from number 4. Therefore, (hd1,5) refers to a second hardrive and second extended partition.

Booting a Windows OS with grub

In case you have indeed installed your MS Windows on a first hard drive and first partition the whole process is rather simple. Open up a Grub's menu config file:

 vi  /boot/grub/menu.lst

and add a following code into appropriate boot menu section :

title           Microsoft Windows XP Professional
root    (hd0,0)
chainloader     +1

save file and run command:

# update-grub

and you are done.

  • root: the root partition of your MS Windows installation
  • title: title name as it will be displayed on grub's boot menu
  • makeactive: make this entry bootable
  • chainloader: do not boot but let partition's boot loader to boot instead

In case you have a MS Windows installation on a third hard drive, things are little bit more complicated. Here is a /boot/grub/menu.lst code for booting a MS Windows from a third hard drive and first partition.

title           Microsoft Windows XP Professional
rootnoverify    (hd2,0)
map             (hd0) (hd2)
map             (hd2) (hd0)
chainloader     +1
  • rootnoverify: do not mount but execute another command
  • map: this makes a third hard drive a first and first hard drive third

After you have updated /boot/grub/menu.lst run:

# update-grub

and you are done.

This short article describes the quick and easy way on how to customize, build and install Linux kernel under Debian or Ubuntu Linux. First, we will install all prerequisites then download kernel source. Next step will be customization and as a last step we will create and install a Debian package with new Customized Linux kernel.


Let's start with first step which is installation of all prerequisites:

# apt-get install bzip2  build-essential \ 
kernel-package libncurses5-dev

Kernel build and customization

Next step is to download kernel source code from Untar and cd inside the kernel's directory tree:

$ tar xvjf linux-2.6.34.tar.bz2
$ cd linux-2.6.34

At this point we will do the most important part of creating new customized kernel and building a Debian package. This is all done with a single make-kpkg command.


Optional step is to apply kernel patches before running a following command:

make-kpkg --rootcmd fakeroot --config menuconfig --initrd --us --uc kernel_image
  • --us do not sign source
  • --uc do not sign changelog
  • --initrd perform any actions necessary for a kernel loaded using initrd
  • -- rootcmd fakeroot command that provides a means of gaining super user access
  • --config menuconfig will use menuconfig as a configuration tool where default is oldconfig
Read more ...

Page 9 of 72

Go to top