By accident I have deleted the directory with all ubuntu files

Asked by Bram van Leeuwen

I have a dual boot system with 14.04 lts and W-10.
The OS are on a SSD and the files on a 1T harddisk with 5 partitions and one of them formatted as ext and the rest as ntfs.
Somehow the top directory of the ext partition has disappeared.
I have looked in all the other partitons and on the SSD if the directory had been replaced but I could not find it nor some specific subdirectories which should be there.
I tried a program: "extundelete" but I couldn't get it to work.

All this happened just now, and I have not made new documents and I hope the files have not been overwritten.
Can somebody help?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Restore from your backups..

Revision history for this message
Bram van Leeuwen (bramdod) said :
#2

I have to confess that I did not make backups often enough...

In the meantime I tried the restore possibility which is present in gparted+gpart. It said after several hours: no recognizable files are found on this disk.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Try foremost. You will need a writable partition of equal or greater size than the file system you are restoring from to write to. You will lose file location and name but you may get files back. If you have overwritten the space on the physical storage where a file once resided, with new data, then the data is gone and is irretrievable. You may find foremost does an OK job.

I suggest you review your backup regime. It's obviously not appropriate.

Revision history for this message
Bram van Leeuwen (bramdod) said :
#4

Thanks a lot and I have learned my lesson!

After studying the foremost manual I think I should use the following command:

foremost -vd -o /dev/sda8/directory -stdin /dev/sda7

if /dev/sda8/directory is the place where the recovered are sent to; and
if /dev/sda7 is the partition where the lost files had been

Is this correct?

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#5

you need the mount point of /dev/sda8 as you are spitting files to it.

you then can run:

sudo foremost -i /dev/sda7 -o /folder/to/put/data

Revision history for this message
Bram van Leeuwen (bramdod) said :
#6

Thanks actionparsnip, that solved my question.