Posts tagged with kernel

Non Booting 64bit Kernel

December 18th, 2009

In an attempt to fix the slow booting problem I have with Fedora 12 running in a virtual machine I decided to compile the latest stable kernel, 2.6.32.

Compiling went fine but I cannot get it to boot as it hangs at the line ‘Creating initial device nodes’. There’s plenty of people with the same problem it seems, but no solution that works for me. I’ve compiled many kernels before and never had a booting problem so this is pretty annoying, maybe it’s because it’s the first 64bit kernel I’ve tried compiling.

Kernel Hang

Compiling Your Own Kernel to Decrease Boot Time

October 3rd, 2008

After reading about Fedora and Ubuntu attempts to speed up the boot times I thought I’d see how my boot times compared, plus if there was anything I could easily do to improve mine.

First I installed Bootchart, it’s in the Fedora 9 repositories so it’s a simple install.

# yum install bootchart

That’s all the is to it, it even edits your grub.conf to append the init=/sbin/bootchartd to your currently running kernel (to stop Bootchart running each boot just remove this entry from your grub.conf).

After booting the Bootchart output is saved to /var/log/bootchart.svgz, but just running the command bootchart with no arguments will automatically parse the file and format the output into a svg file in your current directory.

Running a stock Fedora 9 kernel (2.6.26.5-45.fc9.i686) gave a boot time of 42 seconds, not that bad for a 5 year old laptop plus I’m running SELinux. This is probably because I have already turned off many services that I rarely or never use.

As a comparison I decided to download and compile a ‘vanilla’ 2.6.26.5 kernel from kernel.org. Running `make menuconfig` I was fairly ruthless with removing unneeded options and trying to compile most options into the kernel instead of into modules. For example my laptop has a pccard slot but I never use it so I removed support in the kernel.

Another optimization I tried was to remove all the debugging options under ‘Kernel Hacking’ and to remove the ‘Compile for size’ option under ‘General Setup’ so the compiler uses the -O2 flag instead of -Os, as the help says:

CONFIG_CC_OPTIMIZE_FOR_SIZE:
Enabling this option will pass "-Os" instead of "-O2" to gcc
resulting in a smaller kernel.

I didn’t change anything that affected the functionality of my laptop, it still works perfectly, plus I didn’t compile all options into the kernel (ipw2100 wireless to name one) or remove everything I could have.

The result of running Bootchart with the new kernel gave a boot time of 33 seconds. That’s a 9 second or 21% speedup! I must admit that it was more than I expected and it’s a good improvement for about 1 hours work. It would be even quicker the next time since most of the time was spent creating the .config file but I can just use that again next time.

Safely Shutdown a Frozen Linux System

September 17th, 2008

For when everything freezes totally it’s useful to know the commands on this Free Software Magazine page.

I notice that on Fedora these keys are not captured by default but this is easily fixed using the following command as root.

# echo 1 > /proc/sys/kernel/sysrq

On my system this also opens gnome-screenshot but don’t worry as the kernel still gets the keys as well. My only problem is that the /proc/sys/kernel/sysrq file gets overwritten on boot so I need to make the change permanent, if I find a solution I’ll update the post.

Update – on Fedora it’s very easy to set the sysrq parameter to 1 permanently. Just open the file /etc/sysctl.conf as root and look for the following line, changing it from 0 to 1.

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

Recompiling Virtualbox Kernel Module

July 7th, 2008

If after installing a new kernel you may get an error message when you try to start Virtualbox saying something like ‘The vboxdrv kernel module was either not loaded…’. If you then read the logs the solution is actually written there.

Re-setup the kernel module by executing ‘/etc/init.d/vboxdrv setup’ as root.

Sure enough this command fixes the problem and rebuilds the kernel module for the currently running kernel.

# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module          [  OK  ]
Recompiling VirtualBox kernel module       [  OK  ]
Starting VirtualBox kernel module          [  OK  ]