Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

During a disk analyzer session to clean up space, I saw that /lib was taking up a ton of space, and I have never before seen this taking up this much space before in Disk Analyzer. The thing is, I have recently made a /lib folder under my /home/Development for building some Android kernels. So when I looked at this and not having seen it like this before, I thought I was looking at my /lib folder for my Android kernels. I didn't even take a second to look at the hierarchy before going into it and pulling it up in terminal, I was just set on removing what was taking up excessive amounts of space. When I saw how much space was being taken up, my thinking just went to - "remove." So I went into the lib folder and deleted all the old ones. I don't remember the whole names exactly but I do remember there were ones from I believe 29 and up, in .0-29-generic-pae, and all the way up to forty. I normally don't mess around in these folders, especially deleting things, only adding things I may need for Android Development.

I accidentally deleted all my modules from /lib/modules

Now my Ubuntu boots and runs and I have access to all my system, but I have no modules.

Regression:

  1. I have no drivers, which means I can't connect my external HDD where I copied .0-40-generic-pae to, and I can't connect to the internet to download the modules.

  2. The accidentally deleted modules aren't in my trash because I used rm -r, so no restoring from trash.

  3. I was told to just purge my kernel and reinstall it, and that was headache free, I'm getting a headache just figuring out how to properly do so with what I have access to.

  4. I do not want to just wipe and re-install when there could be an alternate way to fix this, possibly even easy way, because I have tons of data that I do not want to loose, and without those modules I can't back them up anywhere.

Another suggestion was to boot into a live session and download what I need, back it up (I guess mount my current Ubuntu partition and put it there), and then install. Well I can do that, I can boot live session, plug in my external HDD, mount my Ubuntu partition, and copy the 40-generic-pae modules I have to that system.

  • I believe I can do this, correct?
  • Would this be the way to go?
  • If so, should I just copy the whole folder /package straight back into /lib/modules, and then reboot?
  • Or is there a different way I should do it?

Can anyone help me with this?

share|improve this question
    
A bit of whitespace would make this a lot easier to read. (not sure why I can not edit that ATM though). –  Hennes May 18 '13 at 0:33
    
As to fixing it, that might be as simple as 'cd /usr/src/linux && make modules && make modules_install`, assuming you have the kernel source installed in /usr/src/linux. –  Hennes May 18 '13 at 0:37
    
Okay, yeah I actually tried to space it out but I didn't know that I had to add an entire line of blank space to separate lines from one another. As far as the comment on fixing it, I'll try that now. I mean, I haven't deleted the source from /usr/src/linux, so it should be there correct? –  DoseOfAndroid May 18 '13 at 0:52
    
Okay Hennes, I tried the command and it said /usr/src/linux didn't exist so I ls'd /usr/src and I have a list of differetn linux headers and linux headers generic-pae, when I deleted the files last night they were in generic-pae files, but these headers probably don't contain the modules do they? –  DoseOfAndroid May 18 '13 at 0:59
    
Which kernel are you running? (Use uname -a to check). Then cd into that kernels folder. Ofc. this assumes a logic naming scheme so you know which kernel to change to. Also, if you only have the headers then you lack the source. In that case you can download the full kernel ( ftp to ftp.kernel.org and cd to pub/linux/kernel ). Or use the package tools to deinstall and reinstall a kernel. That would no longer match 'repairing modules' or 'reinstalling modules', but it would solve your problems. –  Hennes May 18 '13 at 1:05

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.