Kernel Hooks

Arch Linux is really great for easily changing system settings, even more so than most Linux distros. One thing I've been playing around with recently is trimming the size of my initramfs to speed up my boot process. Its not that its slow (~20secs to desktop) just that its there and I love to tweak things =P

So the first things I looked at were the hooks in my mkinitcpio.conf file. This file contains the settings for creating the initramfs that will bootstrap the rest of the system. For compatibility reasons, the default hooks include:

HOOKS="base udev autodetect pata scsi sata filesystems"

But really pata, scsi and sata all do the same things (allow the initramfs to communicate with your harddrive so it can boot your system). So which one to keep? I took a quick look online to see which HDD my laptop (Compaq Presario F700) uses. If you want to try a similar tweak make sure you really pay attention to what you read online. Try and find a reliable source, like the manufacturer's site. Because I didn't...

It took me a while to fix a system that would only boot a ramfs and couldn't communicate with the HDD at all. First I needed to find my Arch Live CD (bottom of a desk drawer after a few minutes of searching). Then a look at the Arch Wiki for some information (fantastic source of knowledge, even for non Arch users, the Arch community does a great job of keeping it updated). To boot to a useable system I used my recovery disc and these instructions to mount the HDD. After this I'm basically using the Live CD's kernel but with all my normal files. This makes changing to the correct hooks (my HDD is really an SATA) and rerunning mkinitcpio to generate a working kernel image. And my system works again, plus I shaved a second off my boot time.

So about an hours work trying to figure out what went wrong and how to fix it, all to shave a second off my boot time?? You ask if it was worth it. I say, hell yeah!

0 comments:

Post a Comment