-   Linux - Kernel (
-   -   modprobe: FATAL: could not load /lib... at kernel boot (

jamie_barrow 08-07-2006 10:27 AM

modprobe: FATAL: could not load /lib/.../modules.dep at kernel boot
Hey everyone,

I am busy with an OS course project of creating a kernel module and a system call. The module was easy and got that working fine. But system call means that I had to get the kernel source and recompile... which I got working eventually.

# uname -r

The kernel source I have is for 2.6.12-9-386, located under /usr/src/ (and linked to as /usr/src/linux).

So I've done the following:

# cd /usr/src/linux
# make config (just chose whatever values it had, and made sure ext2 and ext3 were Y)
# make -C ./
# make bzImage
# cp arch/i386/boot/bzImage /boot/vmlinuz-mykernel

Then I editted /boot/grub/menu.lst to this:

default 0
timeout 30
color cyan/blue white/blue

title Ubuntu, kernel 2.6.12-9-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.12-9-386

title Honours kernel 2.6.12-9-386.hons
root (hd0,0)
kernel /boot/vmlinuz-mykernel root=/dev/hda1 ro
initrd /boot/initrd.img-2.6.12-9-386

title Ubuntu, kernel 2.6.12-9-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.12-9-386

title Ubuntu, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin


So when I reboot, and choose the second option (the new kernel) I get lots of...

modprobe: FATAL: Could not load /lib/modules/2.6.12/modulesdep : No such file or directory

... then I get...

Begin: Running /scripts/init-premount ...
FATAL: Could not load /lib/modules/2.6.12/modulesdep: No such file or directory
FATAL: Could not load /lib/modules/2.6.12/modulesdep: No such file or directory
Begin: Mounting root file system ...
Begin: Running /scripts/local-top ...
ALERT! /dev/hda1 does not exist. Dropping to a shell!

... and it goes into a BusyBox v1.00 shell.

So my question is.. whats going on?? Is the compilation right, because I think it is. I know I compiled the FS types into the kernel, not as modules so thats not the problem.

I tried...

# make modules install
# depmod
# depmod -a
# ls /lib/modules/2.6.12/modules.dep well, but same thing happened. If anyone knows how to help... please help!



runnerfrog 08-07-2006 11:07 AM

Look at this:

Begin: Running /scripts/init-premount ...
FATAL: Could not load /lib/modules/2.6.12/modulesdep: No such file or directory
This will sound very stupid, but that is normal behavior for a kernel without module support. After checking that you have module support enabled, you should see if you have the depmod binary in /sbin; if not, try upgrading modutils-depmod.

masonm 08-07-2006 11:15 AM

Looks like you forgot to actually install the modules. When you compiled the kernel did you do a "make modules_install" ?

jamie_barrow 08-07-2006 01:16 PM

runnerfrog: I will check again when I go back to university tomorrow. I would think that it is compiled with module support... but will double check. Yes, I tried depmod (and yes it is under /sbin) as said earlier.

masonm: Yeah, that might be the problem. I think I forgot the underscore :D lol. Well hopefully that is the only problem.

I'll keep you guys updated tomorrow. Thanks for the help.

jamie_barrow 08-08-2006 05:21 AM

Hey. My .config file has CONFIG_MODULES=y

After trying # make modules_install, I get this printed out to the screen:

if [ -r -a -x /sbin/depmod ]; then /sbin/depmod -ae -F 2.6.12; fi

I do have /sbin/depmod, and I have run it. I will try updating depmod and see what happens.

jamie_barrow 08-10-2006 09:42 AM

well... the hard drive fricken crashed so I'm starting again :(

quchenxy 08-25-2006 08:41 AM

After your kernel rebuilding process completed smoothly, you are supposed to create a new ramdisk image file for the new kernel. That is usually done in this way:

#cd /boot
#mkinitrd -o /boot/initrd-img.

change the
to your version number. Make sure you type the above command COMPLETELY

Check that you have the new initrd image in your /boot directory. Then, edit your grub config file to make changes (which probably you've already done, but now add a new line "initrd=xxxx". Then run grub-install /dev/hdx if you want to install the grub into the MBR.

All times are GMT -5. The time now is 03:27 PM.