1

Can I recover deleted files of my Linux HDD from Windows?

I very recently removed a few files with rm filename and I want them back.

I have another HDD with Windows, can I recover the files from here? How?

And if not from Windows, how would you do it from an external Linux (e.g. USB)?

1 Answer 1

1

You can use grep and dd for this. From another disk, run

# grep -a -b "text in the deleted file" /dev/sdXY
530159385076:some text in the deleted file
# dd if=/dev/sdXY count=8 skip=$(expr 530159385076 / 512 - 4)

where -a looks at the disk itself and -b prints the byte offset. count=8 takes 8 blocks and skip in this case goes back 4 blocks -- adjust to your needs.

You must log in to answer this question.