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

I had to restore a trashed filesystem from backup, now its not loading a lot of modules

lsmod before:

Module                  Size  Used by
ses                     6715  0
enclosure               8649  1 ses
xt_multiport            2794  1
iptable_filter          2791  1
ip_tables              18390  1 iptable_filter
x_tables               22461  2 xt_multiport,ip_tables
nls_iso8859_1           4633  0
nls_cp437               6351  0
vfat                   10866  0
fat                    55350  1 vfat
usb_storage            50633  1
act_police              4620  1
sch_ingress             2098  1
cls_u32                 6698  5
sch_sfq                 5863  3
sch_cbq                17140  1
snd_hda_codec_realtek   279072  1
snd_hda_intel          25805  0
ppdev                   6375  0
snd_hda_codec          85759  2 snd_hda_codec_realtek,snd_hda_intel
fbcon                  39270  71
tileblit                2487  1 fbcon
font                    8053  1 fbcon
bitblit                 5811  1 fbcon
softcursor              1565  1 bitblit
parport_pc             29958  1
snd_hwdep               6924  1 snd_hda_codec
serio_raw               4918  0
snd_pcm                87946  2 snd_hda_intel,snd_hda_codec
snd_timer              23681  1 snd_pcm
vga16fb                12757  1
lp                      9336  0
vgastate                9857  1 vga16fb
parport                37160  3 ppdev,parport_pc,lp
snd                    71283  6 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore               8052  1 snd
snd_page_alloc          8500  2 snd_hda_intel,snd_pcm
raid10                 21450  0
raid456                54752  0
async_pq                3891  1 raid456
async_xor               3111  2 raid456,async_pq
xor                     4685  1 async_xor
async_memcpy            1537  1 raid456
async_raid6_recov       1816  1 raid456
raid6_pq               80147  2 async_pq,async_raid6_recov
async_tx                2545  5 raid456,async_pq,async_xor,async_memcpy,async_raid6_recov
raid1                  22610  1
raid0                   6778  0
multipath               7181  0
linear                  4126  0
r8169                  39714  0
mii                     5237  1 r8169
ahci                   38350  4

lsmod after:

Module                  Size  Used by
raid456                54720  0
async_pq                3891  1 raid456
async_xor               3111  2 raid456,async_pq
xor                     4685  1 async_xor
async_memcpy            1537  1 raid456
async_raid6_recov       1816  1 raid456
8139too                22245  0
raid10                 21450  1
usbhid                 41116  0
hid                    83888  1 usbhid
8139cp                 19541  0
e1000                 109015  0
raid6_pq               80147  2 async_pq,async_raid6_recov
async_tx                2545  5 raid456,async_pq,async_xor,async_memcpy,async_raid6_recov
r8169                  39714  0
mii                     5237  3 8139too,8139cp,r8169
raid1                  22610  1
raid0                   6778  0
multipath               7181  0
linear                  4126  0

It was a different server I'm taking a backup from, and had a different raid setup so I had to do update-initramfs and grub-update, so that might have something to do with it

The server I took a backup from is still running

How do I restore these modules? Preferably without a restart.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

I think many of those modules would be loaded on demand, hence once you start the services on the restored server you should see more modules in use. However there are some modules for which you will need to install the relevant packages.

A quick way to sync the packages installed is to make an exported list of all the packages from the old machine like so;

$ dpkg --get-selections | cut -f1 > /tmp/package-list

and then install those packages on the other server using the steps explained in this tutorial

Regarding the differences in the modules lists; for example I see the module soundcore in one list but not the other, so try to query the module information on the restored server to check that is available when required like so;

# modinfo soundcore
filename:       /lib/modules/3.3.1-5.fc16.x86_64/kernel/sound/soundcore.ko
alias:          char-major-14-*
license:        GPL
author:         Alan Cox
description:    Core sound module
depends:        
intree:         Y
vermagic:       3.3.1-5.fc16.x86_64 SMP mod_unload 
parm:           preclaim_oss:int

Once you have a module filename, from the details above, you can see which package needs to be installed to provide it, for example the module fbcon;

$ modinfo fbcon
filename:       /lib/modules/2.6.32-38-generic/kernel/drivers/video/console/fbcon.ko
license:        GPL
srcversion:     65B645FD36D989F537E4715
depends:        bitblit,font,tileblit
vermagic:       2.6.32-38-generic SMP mod_unload modversions

is provided by the linux-image package;

$ dpkg -S /lib/modules/2.6.32-37-generic/kernel/drivers/video/console/fbcon.ko
linux-image-2.6.32-37-generic: /lib/modules/2.6.32-37-generic/kernel/drivers/video/console/fbcon.ko
share|improve this answer
    
Thank you tom, I think I fixed it. Here is exactly what I did, for future reference: 1. I ran modinfo sch_sfq, it gave me an error, I don't remember the exact wording but it couldn't open a modules file in /lib/modules/ 2. I ran sudo apt-get update && sudo apt-get upgrade -f, it told me that kernel updates were kept back 3. I ran sudo apt-get dist-upgrade, which downloaded the kernel updates The os started loading the modules then and modinfo was producing the correct output. –  Shoshomiga May 27 '12 at 17:51

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.