Robota Softwarehouse B.V.
  Home Company Products Projects Developers Contact Search  

Recovery

It can happen at any time. Your hard disk breaks down, you overwrite a file or you accidentally delete it. File recovery will might be your last chance to get back some of the data you lost.

For programmers and web developers the chances are high that the data lost is a text file.

The traditional UNIX way to recover files is by using the 'grep' function to scan your hard disk partition and search for a block with the keywords you entered. Once found you take some lines before and some lines after and save the whole lot to a recovered text file. With some (a lot) luck you find your hard work back in this document.

this method is ONLY useful if deleted file is text file



EXAMPLE:


grep -a -B[size before] -A[size after] ‘text’ /dev/[data_partition] > file.txt Where,

* -i : Ignore case distinctions in both the PATTERN and the input files i.e. match both uppercase and lowercase character. * -a : Process a binary file as if it were text * -B Print number lines/size of leading context before matching lines. * -A: Print number lines/size of trailing context after matching lines.

To recover text file starting with 'pizza' word on /dev/sda1 you can try following command: # grep -i -a -B100 -A1000 'pizza' /dev/hda1 > file.txt
Finally use vi to view the resulting file.

If you are using ext2 file system, try out recover command.

Tags

General conditions (pdf) - Algemene voorwaarden (pdf) - Algemene voorwaarden (html)
Copyright 2005 Robota Softwarehouse B.V.. All rights reserved.

Robota Softwarehouse B.V. - Weth. Driessenstr. 71 - 1107XH - Amsterdam - The Netherlands - KvK 53227115
Email: info@robota.nl - Website: http://www.robota.nl - Telephone: +31203631747 - Tailor-made software since 1990