1

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

Shogun
  • 131

2 Answers2

2

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
sleske
  • 23,525
0

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