About nixCraft

Topics

Load Linux kernel module before SCSI module using mkinitrd

Posted by Vivek Gite [Last updated: January 16, 2007]

Today I have discovered nifty mkinitrd command option :)

mkinitrd command is use to make an initrd image. According to man page:
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(8), 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.

So mkinitrd creates an initial image used by the kernel for preloading the block device modules such as IDE, SCSI RAID etc. These modules are needed when system need to access the root filesystem.

If you have new SCSI card you need to make sure that a particular kernel module will be loaded by my initial ramdisk. Pass --preload option to mkinitrd to load the `module' module in the initial ramdisk image. The module gets loaded before any SCSI modules which are specified in /etc/modprobe.conf. This is quite good if you need any module before SCSI module.
# mkinitrd --preload=module-name /boot/initrd-2.6.9-42.ELsmp.img 2.6.9-42.ELsmp

Replace module-name with actual module name.

For more information read mkinitrd man page:

E-mail this to a Friend    Printable Version

Is your site working? Monitor Your Web Site 24/7. Get SMS alerts on server downtime. Free 30-day trial including 20 SMS!

You may also be interested in other helpful articles:

Discussion on This Article:

  1. Pinny Says:

    I have same problem: I’ve installed FC7 on a machine with SATA disk. I’ve copy this machine (with ghost) to a machine with scsi disk. Now the machine boots but cannot find the scsi module during init. I’ve run mkinit with
    –preload=mptspi but It looks that this module isnt loading during the init process. What am I doing wrong? Thanks for the advice!

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.