Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
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.