After an install testdisk finds two partitions which overleap. Linux.

How to use TestDisk to recover lost partition
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
treewithlinux
Posts: 4
Joined: 26 Aug 2020, 09:09

After an install testdisk finds two partitions which overleap. Linux.

#1 Post by treewithlinux »

Hello, maybe a short version - TLDR; - at the start:

On an installation my 4TB backup-drive was mounted and a new "swap-partition" was created. Testdisk finds two partitions which overleap; my "old ext4 data" along with the new swap.
All screenshots of gparted and testdisk in a [dead link removed by recuperation].

Pointers / help on how to fix it are greatly appreciated.

~~~

Detailed Version:

Something went wrong while trying a new Linux-Install (with the Zen-Installer) and now my backup-disk is inaccessible.

After a new Linux-Install with the Zen-Installer - which is not like Calamares & Co, for those who use Linux - the system greeted me with a kernel-panic.

I booted a live distro and after a quick look into the grub.conf, i found the error and was able to boot into my antergos-install.
I mounted the new partition for the zen-installer and saw, that nothing was written there by the installer.
I checked the other disks and saw, that on my backup-hdd the zen-installer created an 4TB sawp?!

Image

Image

The swap on my backup-hdd was not in use. I installed the testdisk-package and started photorec to see if any files can be found.
Photorec found a lot of my files. How can this be? The Zen-Installer did not format the swap, maybe just created the sway and wrote a new partition-table?

I closed photorec and started testdisk.
After choosing GPT -> Analyse -> Quick search, he finds swap but also my old backup-partition, but they overleap! Even the the name [data] is correct.

Image

Testdisk also finds the superblocks. It was an ext4-filesystem.

Image

///

My best guess is, that the Zen-Installer "only initialized" a swap-partition and wrote a new partition-table, since a lot of files and superblocks can be found.
Normally i would do more "try and error", but a diskimage with dd of the 4TB-partition takes my system (HDD on USB) almost 24h.

It feels like i should be able to fix that. What would you do?
Pointers / help on how to fix it are greatly appreciated.

Thanks, Jan

recuperation
Posts: 2720
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: After an install testdisk finds two partitions which overleap. Linux.

#2 Post by recuperation »

Your partition do not overlap when looking at the sector numbers in the Testdisk screenshot.
Gparted shows different partition information than Testdisk.
Did you modify your disk in between?

When handling this disk, please choose GPT.

treewithlinux
Posts: 4
Joined: 26 Aug 2020, 09:09

Re: After an install testdisk finds two partitions which overleap. Linux.

#3 Post by treewithlinux »

Hello recuperation, immediately after i realized the new Linux-Installer created a new swap on my backup-hdd,
i made a copy of the whole hdd with dd. testdisk was only used with that created image.
- e.g. testdisk /run/media/bbig/Seagate Expansion Drive/sda_recovery2.img -

You have an idea already, what i should try?

recuperation
Posts: 2720
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: After an install testdisk finds two partitions which overleap. Linux.

#4 Post by recuperation »

As the Testdisk screen suggests, your installer could have created the swap partition without even touching the data partition.
Mount your duplicate file "sda_recovery2.img" as read-only into a device.
Then let Testdisk search on the device. Once the analysis is over try to navigate your Data-Partition using the "p"-key (function: list files). If that fails run deep search and try to access the found partition each partition one by one using the "p"-key.

treewithlinux
Posts: 4
Joined: 26 Aug 2020, 09:09

Re: After an install testdisk finds two partitions which overleap. Linux.

#5 Post by treewithlinux »

The analyse again did return the two partitions, but i could not open it to browse files.
So now the deep search is running almost 3 hours now; a quick screenshot before i really need to go to bed:

Image

Don't know, the error msg seem off; i guess it came formated for windows systems (fat).
I used it with ext4.

Thanks!

Edit: After almost 24 hours more warnings:

Image

treewithlinux
Posts: 4
Joined: 26 Aug 2020, 09:09

Re: After an install testdisk finds two partitions which overleap. Linux.

#6 Post by treewithlinux »

The search is completed:

Image

Testdisk found 102 "partitions" all labeled the same [data], but i cannot do anything with those, :(
I can only continue, then he lists the two previous found partions and some "boot" and "MS" ones.
Upon selecting one, i only get back to "Analyse"-Page.

Someone any idea? Thanks!

recuperation
Posts: 2720
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: After an install testdisk finds two partitions which overleap. Linux.

#7 Post by recuperation »

You can only go through your 100 partitions and try to access them.
If that fails you can use Photorec or some commercial tool.

Locked