# Could not load /lib/modules/modules.dep [SOLVED]

## TheKingOfPain

I've got a strange message during boot:

```
Could not load /lib/modules3.2.1-gentoo-r2/modules.dep
```

It is cause probably by this:

```

uname -r

3.2.1-gentoo-r2

```

But I do not have 3.2.1-gentoo-r2 kernel. I do not have gentoo sources at all (I use pf-sources instead of them).Last edited by TheKingOfPain on Sat Feb 25, 2012 11:16 am; edited 1 time in total

----------

## Yuu

Hi TheKingOfPain,

maybe you have a bad /usr/src/linux/. What is the output of this command ?

```
$ ls -lh /usr/src/linux

lrwxrwxrwx 1 root root 21  4 févr. 12:09 /usr/src/linux -> linux-3.2.1-gentoo-r2
```

----------

## TheKingOfPain

No, it's correct.

```
lrwxrwxrwx 1 root root 14 02-24 19:53 /usr/src/linux -> linux-3.2.5-pf
```

There is no another sources then linux-3.2.5-pf in /usr/src

----------

## Yuu

Hi TheKingOfPain,

did you properly run "make modules_install" after compiling your kernel ?

I think depmod should have failed or something went wrong, when calling depmod (which should generate a proper modules.dep)

What's make me think that ? My /usr/src/linux/Makefile :

```
# Target to install modules

PHONY += modules_install

modules_install: _modinst_ _modinst_post

PHONY += _modinst_

_modinst_:

        @rm -rf $(MODLIB)/kernel

        @rm -f $(MODLIB)/source

        @mkdir -p $(MODLIB)/kernel

        @ln -s $(srctree) $(MODLIB)/source

        @if [ ! $(objtree) -ef  $(MODLIB)/build ]; then \

                rm -f $(MODLIB)/build ; \

                ln -s $(objtree) $(MODLIB)/build ; \

        fi

        @cp -f $(objtree)/modules.order $(MODLIB)/

        @cp -f $(objtree)/modules.builtin $(MODLIB)/

        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst

# This depmod is only for convenience to give the initial

# boot a modules.dep even before / is mounted read-write.  However the

# boot script depmod is the master version.

PHONY += _modinst_post

_modinst_post: _modinst_

        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modinst

        $(call cmd,depmod)

else # CONFIG_MODULE
```

----------

## TheKingOfPain

 *Yuu wrote:*   

> Hi TheKingOfPain,
> 
> did you properly run "make modules_install" after compiling your kernel ?
> 
> 

 

Yes, of course I did.

```
make -j9 && make modules_install
```

----------

## Yuu

Hi TheKingOfPain,

I think you should try running : 

```
# module-rebuild rebuild

# depmod -a
```

----------

## TheKingOfPain

```
# module-rebuild rebuild
```

Works perfectly. It rebuilds for example my virtualbox modules.

```
#ls /lib/modules/3.2.5-pf/misc/

acpi_call.ko  vboxdrv.ko  vboxnetadp.ko  vboxnetflt.ko  vboxpci.ko

```

But still:

```

#depmod -a

WARNING: Couldn't open directory /lib/modules/3.2.1-gentoo-r2: No such file or directory

FATAL: Could not open /lib/modules/3.2.1-gentoo-r2/modules.dep.temp for writing: No such file or directory

```

SHAME on me  :Wink: .

/etc/fstab

```

/dev/sda3               /boot           ext2            noauto,noatime                    1 2

```

noauto

And every kernel newer then 3.2.1-gentoo-r2 goes to '/' partition.

----------

