Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have transferred the disk of a a Hardyvirtual machine to another virtual machine with a different kernel but there is no equivalent of /lib/modules// on disk. How can the /lib/modules of the new kernel be added to the image to let it boot without error messages?

Is there apt-get command to download the kernel modules of the new kernel from the repository?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Kernel modules are in the kernel package:

motiejus@skveez> dpkg -S /lib/modules/2.6.32-5-amd64/kernel/arch/x86/kvm/kvm-amd.ko
linux-image-2.6.32-5-amd64: /lib/modules/2.6.32-5-amd64/kernel/arch/x86/kvm/kvm-amd.ko

You will have to apt-get install the kernel that's in the new server to reinstall the mdoules.

You didn't mention the target (new) system distribution. If kernel was compiled from source, you'll have to do sudo make modules_install from the kernel tree. If it's debian/ubuntu and kernel was from the repository, run:

apt-get install linux-image-2.6-<arch>-<flavour> --reinstall

You can get installed kernels in this way:

uname -a
dpkg -l 'linux-image-*'
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.