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.

I accidently removed my entire /usr directory thanks to RVM. I can still use the terminal prompt with Ctrl+Alt+F6, but I don't have any sudo (I guess it's because of the missing /usr).

Is there any way to recover my files?, I didn't reboot yet. If not how can I make sudo and the other things work again without completly reinstalling the OS? I'm runnig Ubuntu 12.04.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

If you have backups => Yes

If you haven't made backups, start making them while you remember why it is important.

I think the easiest solution is to make a copy of your home directory and /etc onto an external disk, then detach the external disk and do a reinstall of the system. If you have enough storage space on an external disk:

  • start a liveCD
  • copy all files to external disk or at least /home and /etc
  • reïnstall
  • copy the files from your backup to the new install
  • compare the config files in /etc with the ones in your backup
share|improve this answer
    
Alright, then I'll do a complete reinstallation again. It's just a bit frustrating because I keep destroying my system every few weeks . :S –  js-coder May 4 '12 at 20:42
    
You can wait for a little while to check for other answers. And this is exactly why I advise to make regular backups. –  jippie May 4 '12 at 20:45
    
I was busy making one but i got the same advice: reinstall! Just think of it as a lesson learnd :) –  Rinzwind May 4 '12 at 20:47
    
Also you're obviously using root privileges way too often. Try to minimize that to the very least possible. See it as a challange :) –  jippie May 4 '12 at 20:48
add comment

Easiest method: backup your own files from a live cd and re-install. It is also the most efficient and less time consuming.

Difficult methods:

  • you can install a Ubuntu system on another system and copy the files from that system over to your machine.
  • Use a data recovery tool like R-Studio for Linux to recover it.

    R-Studio for Linux recovers files:

    • Deleted from the computer and emptied from the Trash
    • Corrupted due to a virus, power failure or sudden shutdown
    • From disks that have been Re-formatted to the same file system or a different file system
    • Damaged and have bad sectors-R-Studio for Linux creates an image of the entire disk and recovers it from there to prevent further physical damage to the disk
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.