Common kernel problems

From FedoraProject

Jump to: navigation, search
This page needs some love
This page should be revised or reconstructed to better suit the needs of Fedora.

This page documents common problems with the Linux kernel in Fedora.

Contents

How to set kernel boot options

Kernel boot options are contained in the file /etc/grub.conf. Each installed kernel has a group of lines called a stanza describing what kernel to boot, where to find the root file system, the name of the initrd to load, and additional kernel options. A typical stanza looks something like this:

title Fedora Core (2.6.22.9-61.fc6)
root (hd0,1)
kernel /vmlinuz-2.6.22.9-61.fc6 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.22.9-61.fc6.img

Kernel options are placed at the end of the "kernel" line and are separated by spaces. When having problems, it is usually a good idea to remove the "quiet" option so that the full set of kernel messages is shown during boot. Here is an example with the "quiet" and "rhgb" options removed and some other options added:

title Fedora Core (2.6.22.9-61.fc6)
root (hd0,1)
kernel /vmlinuz-2.6.22.9-61.fc6 ro root=LABEL=/ pci=nomsi,nommconf nohz=off
initrd /initrd-2.6.22.9-61.fc6.img

NOTE: The full list of kernel options is in the file /usr/share/doc/kernel-doc-<version>/Documentation/kernel-parameters.txt, which is installed with the kernel-doc package.

How to set module options for boot drivers

Module options are set in the file /etc/modprobe.conf, or (with versions of module-init-tools in F10+) on the kernel command line. Drivers that are needed to boot the system are put into an initrd, and their options are copied from modprobe.conf by the mkinitrd script that builds the initrd. To change module options for those drivers, you can change the /etc/modprobe.conf file and rebuild the initrd, or alternatively (in recent releases of Fedora) you can simply append on the kernel command line.

For example, to disable adma mode on an nVidia SATA controller, add these options to the kernel command line (format is <modulename>.<option>=value):

sata_nv.adma=0

Alternatively, add this line to /etc/modprobe.conf:

options sata_nv adma=0

To get options set in /etc/modprobe.conf into the initrd, run the mkinitrd program. Usually this is just the command mkinitrd /boot/initrd-$(uname -r).new.img $(uname -r) to build a new initrd for the currently-running kernel without overwriting the exisitng one. (See man mkinitrd for help on additional options.) To test the new initrd, reboot the system and use the command line editing facilities to change the name of the initrd. Or, create a new stanza in the /etc/grub.conf file something like this (see above for the original):

title Fedora Core [with new initrd]  (2.6.29-0.215.rc7.fc11.i586)
root (hd0,1)
kernel /vmlinuz-2.6.29-0.215.rc7.fc11.i586 ro root=LABEL=/ rhgb quiet
initrd /initrd-2.6.29-0.215.rc7.fc11.i586.new.img

This will let you boot with either the new or the old initrd by pressing the up arrow / down arrow keys on the very first boot screen. Once everything is tested, remove the original initrd and rename the new one to the same name as the old one, then remove the "[with new initrd] " stanza from /etc/grub.conf.

Can't find root filesystem / error mounting /dev/root

To take apart an initrd, do the following ..

mkdir initrd
cd initrd/
gzip -dc /boot/initrd-2.6.23-0.104.rc3.fc8.img | cpio -id

Another way to examine the initrd is with Midnight Commander. Add the extension .cpio.gz to the filename and then just place the cursor over the name and press Enter.

Crashes/Hangs

Boot pauses probing floppy device

On some machines (mostly laptops with removable floppy drives), boot will pause while the (non-existant) floppy device is probed. A series of the following messages will appear:

end_request: I/O error, dev fd0, sector 0
end_request: I/O error, dev fd0, sector 0
Buffer I/O error on device fd0, logical block 0

This is caused by initrd's nash searching for filesystem labels on the floppy device. This problem can be avoided by adding floppy.allowed_drive_mask=0 to the kernel boot options.

Can't find installation CD/DVD or hard drives

Install runs very slowly

If the system runs very slowly, it may have a BIOS bug that causes part of the system memory to be uncached. Playing with the mem= parameter can work around this problem. Trying for example, mem=1000M will limit the system to 1000 megabytes of memory and may make the install run much faster.

Can't install

Sometimes, even booting with acpi=off or various other boot command line options, the kernel refuses to boot on some subsets of hardware. If none of the above tricks helps, then..

Diagnosing "My machine locked up"

This can be a tricky one to diagnose. Most users don't have serial console capability, so we're mostly guessing in the dark.

Suspend/Resume to RAM failure

The most common failure mode is 'black screen on resuming'.

System clock runs too fast/slow

Sound card doesn't work

"High Definition Audio" devices

Many times the model can't be detected properly. Adding the correct model to the sound card driver's entry in /etc/modprobe.conf will force the driver to use that model, e.g. options sound-card-0 model=3stack. Options for this driver are documented in the file /usr/share/doc/kernel-doc-<version>/Documentation/sound/alsa/ALSA-Configuration.txt in the kernel-doc package.

System hangs on reboot

Changing the reboot method can work around this problem. To force a reboot method other than the default, use the reboot= kernel option:

These can be combined: reboot=b,w forces a warm reboot using the system BIOS.

Booting is slow

The first thing to do is isolate which part of the boot process is slow to determine if the fault is the kernel, the initrd scripts, or other parts of the boot process. One way to do this is using the bootchart application. Install this with yum, and the next time you reboot, profiling will be done during boot which can be collected by running the command bootchart which will generate a .png file containing a graph showing where the time was spent. If the kernel appears to stall during boot, booting with the boot parameter printk.time=1 will insert timestamps before every message the kernel prints to its ringbuffer. Retrieve these messages with dmesg, and look for large deltas between two timestamps to isolate (for eg) drivers which may be spending a long time initialising.

Creation of slab failed

In Rawhide/devel kernels (and in -debug flavors of released kernels), Fedora uses the SLUB allocator with full slab debugging enabled by default. The debugging might cause problems in some rare cases: memory allocations can fail, causing the system to panic. Slab debugging can be disabled with the option slub_debug=- (a single minus sign.) Note, that this option will hide an actual bug that really should be reported and fixed rather than worked around.

USB devices don't work

This can be caused by USB autosuspend stopping and starting devices repeatedly. To disable autosuspend globally, use the kernel option usbcore.autosuspend=-1 .

Problems with PCMCIA / PC Card adapters

By default, the kernel only reserves a fairly small amount of memory and I/O space for PC Card adapters. Some adapters need more space, or will not work within the default range of addresses.

nVidia SATA controllers don't recognize all connected drives

Differences between the Fedora 7 and Fedora 8 kernels

How to make Fedora 8 behave like Fedora 7 and vice versa

In Fedora 8, USB autosuspend is enabled while it is disabled in Fedora 7

In Fedora 8, libata ACPI is enabled while it is disabled in Fedora 7

In Fedora 8, PCI message signaled interrupts (MSI) are enabled while they are disabled in Fedora 7

See Also...