You are not logged in.

#1 2012-05-03 12:01:27

CSanders
Member
Registered: 2012-05-02
Posts: 7

[Solved] Install in KVM VM can't find modules.dep

Hello,

I've been using fedora at work for ~1 year now, so I'm relatively familial with it.  I waned to install Arch as a learning process.  However, I'm installing in on a KVM VM first and I've run into a problem.  I've been using   this guide but seem to have done something wrong.  I was going to just re-install but the true goal here is the journey not the destination so I wanna see if I can fix it.

After following the guide I rebooted to try to start Arch and receive:

FATAL: Could not load /lib/modules/3.3.4-1-ARCH/modules.dep: No such file of directory

ERROR: Unable to determine major/minor number of root devices '/dev/mapper/vg_arch-lv_arch'.

So far by mounting the / and /boot in the live cd I've:

  1. Tried redoing the mkinitcpio.

    mkinitcpio -c /mnt/etc/mkinitcpio.cof -g /mnt/boot/initramfs-linux.img

  2. Tried chroot to /mnt and run depmod -a

  3. Checked that modules.dep exist in the listed locatoin

That's about the end of the suggestions I've found so far.  Once I have the root mounted I can go to /mnt/lib/modules/3.3.4-1-ARCH and there is a modules.dep.  This leads me to believe I've got a problem with reading the LVM root partition during boot.  What else can I do from here?  I've exhausted google and the Arch Wiki and can't find anything else, though it's very likely I'm just not searching for the right things yet.

Thanks for the help.

Solution

  1. Read about chroot here

  2. Read about mkinitcpio here

Specifically on chroot check the section on mounting /proc /sys etc.
On mkinitcpio check the -k flag to specify the kernel version.
That has me up and running.

Last edited by CSanders (2012-05-03 12:43:04)

Offline

#2 2012-05-03 12:04:55

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [Solved] Install in KVM VM can't find modules.dep

Did you forget to add the lvm2 hook to the initcpio?


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2012-05-03 12:12:26

CSanders
Member
Registered: 2012-05-02
Posts: 7

Re: [Solved] Install in KVM VM can't find modules.dep

I have the following two lines which I edited in /mnt/etc/mkinitcpio.cof before remaking it.

MODULES="virtio virtio_blk virtio_pci virtio_net"
HOOKS="base udev autodetect pata scsi sata filesystems usbinput lvm2"

And just to be sure it was really "lvm2" and not "lvm" I tried with lvm and was told there was no such module.

Offline

#4 2012-05-03 12:12:35

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] Install in KVM VM can't find modules.dep

CSanders wrote:

So far by mounting the / and /boot in the live cd I've:

  • Tried redoing the mkinitcpio.

    mkinitcpio -c /mnt/etc/mkinitcpio.cof -g /mnt/boot/initramfs-linux.img

  • Tried chroot to /mnt and run depmod -a

  • Checked that modules.dep exist in the listed locatoin

Initramfs images are kernel specific. What you've described above creates an image for the kernel on the liveCD, not the one in the root at /mnt. You need to chroot before running mkinitcpio (which will require that the API filesystems are mounted as well).

Offline

#5 2012-05-03 12:14:35

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,615

Re: [Solved] Install in KVM VM can't find modules.dep

First you need to chroot into your installation, check the wiki.

After chrooting in, check /mnt/etc/mkinitcpio.conf .
Your hooks= line needs to have the correct hooks for your installation.
it should look similar to this :

HOOKS="base udev autodetect sata lvm2 filesystems fsck"

After you checked/corrected that, run mkinitcpio -p linux  FROM WITHIN the CHROOT to regenerate the initramfs'es.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2012-05-03 12:16:38

CSanders
Member
Registered: 2012-05-02
Posts: 7

Re: [Solved] Install in KVM VM can't find modules.dep

Initramfs images are kernel specific. What you've described above creates an image for the kernel on the liveCD, not the one in the root at /mnt. You need to chroot before running mkinitcpio (which will require that the API filesystems are mounted as well).

So I was curious about this due to some other comments I head read while searching.  I've found that in the live CD if I run

uname -r

I get "3.0-ARCH", while the boot is properly looking for 3.3.4-1ARCH.  Doesn't that indicate that it used the correct kernel?

Just in case it doesn't I tried doing a chroot to /mnt/ but when I try to run mkinitcpio it returns

ERROR: /proc must be mounted

.  I'm not sure what to do about this b/c /proc exists on the live CD but I'm not clear why my /mnt/proc is empty.

Offline

#7 2012-05-03 12:24:37

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [Solved] Install in KVM VM can't find modules.dep

Have a read through this.


Burninate!

Offline

#8 2012-05-03 12:31:02

CSanders
Member
Registered: 2012-05-02
Posts: 7

Re: [Solved] Install in KVM VM can't find modules.dep

Gcool wrote:

Have a read through this.

Actually, turns out I was reading that when you posted.

Here's where I'm stuck.
After mounting proc, sys, and dev I did the mkinitcpio but now I receive:

ERROR: '/lib/modules/3.0-ARCH/' is not a valid kernel module directory

Which is accurate, because my /lib/modules is 3.3.4-1-ARCH. 
So I checked for what could be setting that incorrectly with

grep -r "3.0-ARCH"

Only thing I found was in etc/mkinitcpio.d/exmple.preset
But even in that file the line is commented out with #fallback_kver="3.0-ARCH".
I didn't think I was using any defaults since I specify the -c command to mkinitcpio.

Where is it getting this 3.0-ARCH kernel version from?

Offline

#9 2012-05-03 12:33:51

CSanders
Member
Registered: 2012-05-02
Posts: 7

Re: [Solved] Install in KVM VM can't find modules.dep

Ah HA!

Not done yet, but there is a -k option for mkinitcpio when making for a different kernel than the currently running one.  Giving that a shot now, though I thought the chroot would change kernel too.  Maybe not?

Offline

#10 2012-05-03 12:36:19

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [Solved] Install in KVM VM can't find modules.dep

I think you're simply not chrooted in. After you've done the necessary mounts, make sure you're in /mnt/arch (or wherever you mounted your root) and then run.

# chroot . /bin/bash

Once you've done that, try regenerating the initramfs again.

PS: once you've chrooted in, you should see "3.3.4-1-ARCH" when running "uname -r"

Last edited by Gcool (2012-05-03 12:38:10)


Burninate!

Offline

#11 2012-05-03 12:39:24

CSanders
Member
Registered: 2012-05-02
Posts: 7

Re: [Solved] Install in KVM VM can't find modules.dep

Success!

So I did run

# chroot . /bin/bash

I still had to use the -k command to mkinitcpio when generating it.  But having done that I'm getting to a log in prompt!

Only error I see now is when booting I see this for a few seconds.

Error '/grub/i386-pc/ext4.mod' not found

I think I typed that correctly it moves on and gives a log in prompt from there.

Offline

#12 2012-05-03 12:48:31

CSanders
Member
Registered: 2012-05-02
Posts: 7

Re: [Solved] Install in KVM VM can't find modules.dep

Gcool wrote:

PS: once you've chrooted in, you should see "3.3.4-1-ARCH" when running "uname -r"

So for some reason I don't.
I've marked this as solved as the issues is fixed, but I would be curious to know why I'm not seeing the expected behavior from chroot.  I'm typing exactaly as you describe after mounting everything as in the the wiki.  What else could I be missing?

I would also be curious why I'm seeing the grub error message above.

Offline

#13 2012-05-03 23:24:23

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] Install in KVM VM can't find modules.dep

Your kernel doesn't change when you chroot.

Offline

#14 2012-05-04 05:44:45

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [Solved] Install in KVM VM can't find modules.dep

Don't know what I was thinking there, falconindy is absolutely right. The kernel loaded during boot (from your livecd) won't change all of a sudden because you've chrooted into another environment obviously. While chrooted into your existing install, a "mkinitcpio -p linux" should suffice. But nothing wrong with using the "-k" option to point to the actual kernel image.

As for the error you receive; there simply is no "ext4.mod" module (I take it you're using GRUB2 as your bootloader). Have you somehow specified this module to be loaded in yout bootloader config?


Burninate!

Offline

Board footer

Powered by FluxBB