Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidentally deleted /home directory with sudo rm -rf... :(

I tried to restore it with testdisk, but becouse Ubuntu is from Wubi, it cannot list filesystem and dont know another way to do this.

How could i restore my data? It's important.

Please help.

Wubi, Ubuntu 10.10

share|improve this question

migrated from stackoverflow.com Jul 11 '11 at 17:39

This question came from our site for professional and enthusiast programmers.

    
if you are using Windows 7 you may try System Restore and recover a system snapshot before the time you deleted the files. – Pablo Castellazzi Jul 11 '11 at 18:44
    
@Pablo Castellazzi: I believe Windows System restore only covers system files (hence the name) - it will not touch the user's personal files, thus the image file that Wubi uses would probably not be restored. – sleske Jul 11 '11 at 19:06
    
@sleske: I was not sure if it would work or not. I understood "User's personal files" as anything in C:\Users. Since wubi files are outside that path i thought it may work. Anyway it does not work. This exact question was asked here. – Pablo Castellazzi Jul 11 '11 at 21:26

First of all, make a backup of your Wubi installation file. That should be the file C:\ubuntu\disks\root.disk. Do not try to boot your Wubi installation before doing this, as this may overwrite the data you deleted.

To try and recover the data, boot your computer from a Linux rescue CD (or copy the Wubi file to a Linux computer, or to a removable media).

Then use an undelete utility to try and save your data. For possible approaches, see e.g. How to recover a removed file under linux

If an undelete utility refuses to read a filesystem from a file, you can create a loopback device (as root):

# losetup /dev/loop0 /my/wubi/file

Afterwards, the file will be accessible as a device under /dev/loop0, where you can use tools on it (or even mount it, though that will not help you).

To remove the loopback device when you're done:

# losetup -d /dev/loop0
share|improve this answer

Try ext3grep ,if its ext4FS then try extundelete. If both tools doesn't help,may be you can try file carving tools like foremost,sleuth-kit,scapel or extcarve

share|improve this answer
    
Thanks all, i found the solution here: askubuntu.com/questions/52693/recover-deleted-data-with-rm-rf – Shogun Jul 17 '11 at 22:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .