1

I did accidentally override the first part of a partition. Please note, the GPT partition table is completely intact. No damage done there.

That partition was as large as possible. Since I only have another same-sized disk (but not larger), I created a disk-image of the partition only.

I try to run testdisk on that image but all available options seem to include rescuing a partition table. That answer on my last question seems do imply that testdisk can very much recover partially damaged file systems – exactly what I need.

So, how do I run tesdisk on a partition image only (I know the file system type, it's ext4) with the purpose of recovering whatever data is still there.


I already run foremost. The result is nice and all, but my most valuable data is a) a data.db sqlite database (that's a not-supported file type as far as I'm aware) and b) a .thunderbird folder (the folder-structure is quit important for that one)

1
  • Only a comment, since I can barely remember the details of my solution back then: But I actually was able to rescue the data! The problem: The very first block within ext4 (which contains metadata about the filesystem) was overriden. The solution: copies of that one are at other positions in the file system. Just copy it from there to the first block!
    – Asqiir
    Feb 10, 2023 at 18:51

1 Answer 1

0

I would be surprised if doing this would help - My understanding is that testdisks ability to recover/repair filesystem's is very limited. Testdisk is primarily a partition recovery tool, with only marginal support for ext4 operations - ie copying deleted ext4 files.

As per https://www.cgsecurity.org/wiki/TestDisk -

   primarily designed to help recover lost partitions and/or make non-booting disks bootable again

And its ext filesystem support is only

  Undelete files from ext2 filesystem

If the partition is already in place, presumably you could read the disk and then just do file recovery with no Ill effects. That said, I imagine extundelete would be a better tool for this job.

Depending on the type of loss, Photorec (part of the testdisk suite) may apparently be able to identify .sqlite files.

2
  • extundelete seems to for working file systems when single files are accidentally deleted. My filesystem is corrupted, especially the first superblock is definitely gone. (As I wrote in my previous question the first part of the partition is gone.)
    – Asqiir
    Sep 4, 2020 at 11:05
  • Yes, but I see no evidence that testdisk can help you.
    – davidgo
    Sep 4, 2020 at 11:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .