≡ Menu

kernel version

I need kernel headers to compile module and vmware tools. How do I install kernel headers on Debian or Ubuntu Linux operating systems using command line options?
[click to continue…]

List or Check Installed Linux Kernels

Q. How do I list all installed kernel on Linux operating system? How do I find out current kernel version?

A. You can use standard package listing command to list installed kernels.

RedHat / CentOS / RHEL / Fedora Linux user

You need to use standard rpm command to list installed software. Type the following command at shell prompt:
$ rpm -qa kernel
Output:

kernel-2.6.18-4.1.15.el5
kernel-2.6.18-8.1.14.el5
kernel-2.6.18-8.1.10.el5

To list / display current kernel

Type the following command:
$ uname -r
$ uname -mrs

Output:

Linux 2.6.18-8.1.14.el5 x86_64

Debian / Ubuntu Linux user

Use dpkg command to list all installed kernel, enter:
$ dpkg --list | grep linux-image
Output:

ii  linux-image-2.6.20-15-generic        2.6.20-15.27                           Linux kernel image for version 2.6.20 on x86/
ii  linux-image-2.6.20-16-generic        2.6.20-16.32                           Linux kernel image for version 2.6.20 on x86/
ii  linux-image-generic                  2.6.20.16.28.1                         Generic Linux kernel image

I am a new proud Linux user. My question to you is - how do I find which kernel version installed on my Linux system? How do I upgrade my kernel to latest version? Any help would be greatly appreciated.
[click to continue…]

Linux rebuild the initial ramdisk image

Q: I think I am missing some driver or my initial ramdisk is corrupted for running kernel how do I Rebuild the initial ramdisk image under Linux?

A: You need ramdisk if you have added new hardware devices such as SCSI or FibreChannel controller to your server as the ramdisk contains the necessary modules (i.e. drivers) to initialize hardware driver. If you modified the /etc/modprob.conf (or modules.conf) file then you need to execute special script called mkinitrd.

The mkinitrd script constructs a directory structure that can serve as an initrd root file system. It then generates an image containing that directory structure using mkcramfs, which can be loaded using the initrd mechanism. The kernel modules for the specified kernel version will be placed in the directory structure. If version is omitted, it defaults to the version of the kernel that is currently running.

Find out your kernel version:
# uname -r
2.6.15.4
Make backup of existing ram disk:
# cp /boot/initrd.$(uname -r).img /root
To create initial ramdisk image type following command as the root user:
# mkinitrd -o /boot/initrd.$(uname -r).img $(uname -r)
# ls -l /boot/initrd.$(uname -r).img

You may need to modify grub.conf to point out to correct ramdisk image, make sure following line existing in grub.conf file:
initrd /boot/initrd.img-2.6.15.4.img
When the system boots using an initrd image created by mkinitrd command, the linuxrc will wait for an amount of time which is configured through mkinitrd.conf, during which it may be interrupted by pressing ENTER. After that, the modules specified in will be loaded.