I have mounted my system where my modules were accidentally deleted, ALL of them, all of the OLD ones, and the most recent ones 3.2.41. I have mounted my system and I'm chroot and I don't know what to do here. I found an answer on here saying to download the headers, which when I tried, it said they were already the newest version, and make a symbolic link to /lib/modules/linux-headers-pkgname/build, and it allowed me to create the link to /lib/modules/linux-headers-3.2.41/ but no further.

If anyone could help me fix this, I'm already chroot with my correct system mounted along with proc, sys, and /dev/pts, at this point I just don't know what package to download and install, or how to place what I need back into /lib/modules. Should I remove this symlink as well? I have the 3.2.41 backed up on an external drive, can I just copy it back into the correct folder and have my modules back? I'm using Ubuntu 32-bit 12.04.


I booted into the live system, logged into a root shell, logged into root

$ sudo -i password

I mounted my filesystem:

# mount /dev/sda6

then I mounted sys, proc, dev, & dev/ptsL

# mount -o bind /dev /mnt/dev
# mount -o bind /proc /mnt/proc
# mount -o bind /sys /mnt/sys
# mount -o bind /dev/pts /mnt/dev/pts

then I chroot'd:

# chroot /mnt

after that I made sure that any modules I had moved over were removed, because I was finally able to copy my modules that were backed up on my external, and the modules from the live system into my filesystem, and they didn't completely work, all they did was fix the problem mounting my other filesystems and some USB acccess. So to do this I used:

# rm -r /lib/modules

then I made sure my internet connection was still good:

$ ping -c 5 google.com

then, after verifying that I could access the internet, I ran some updates because every few days updates come out, and my filesystem checked my kernel to see if I needed to update anything and I was able to re-install my modules this way. I ran:

# apt-get update  
# apt-get dist-upgrade

After all this, I used ls to check and see if my modules were back and indeed they were, in /lib/modules. I rebooted the computer, and everything worked perfectly.

Thanks the wonderful person that helped me, over at ubuntuforums.org

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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