Wednesday, May 1, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 1770  / 2 Years ago, fri, july 22, 2022, 7:21:33

A hard-drive with four partitions




  1. Ubuntu

  2. Swap

  3. Data

  4. Free



was accidentally formated and then partitioned in the same way with the same partition sizes again. I am looking for a way to retrieve a single file from the Data partition. It is a *.odt file with mainly text in a table in it.



So far I tried to use photorec and tried to find some keywords of that file with grep but without any success. Some files are reproduced but not the one I am looking for.



Is there a way to grep though the partition to look for some key words? Or are there other tools more suitable to retrieve the data?


More From » partitioning

 Answers
0

Depending on the size and fragmentation of the lost file it could be possible to recover it, as when a partition is formatted, a tiny fraction of the available space is actually overwritten.



Use photorec and




  • choose the same partition the file was on

  • select File Opt and check to look for zip files (*.odt files are in fact zip files)

  • choose Whole to analyze all data, not just "unallocated" data



Then you will be presented with all zip files photorec has found. There is no way to grep the files directly as they are compressed, but you can use zipgrep as shown below. Or, as no filenames will be retrieved, you'll have to open each one and check.



To automate the search change directory to the retrieved files use zipgrep to find a word or a pattern, for example like this (it will show all files with the pattern pattern in them):



cd retrieved_files
for F in *; do zipgrep -q pattern "$F" && echo $F; done

[#43867] Friday, July 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
entmpy

Total Points: 52
Total Questions: 112
Total Answers: 113

Location: Marshall Islands
Member since Tue, Sep 21, 2021
3 Years ago
entmpy questions
;