Page 1 of 1

Linux partition can't be recovered. Any options?

Posted: 06 Feb 2020, 12:27
by avilqu
Hi all,

I used testdisk on my laptop (XPS 9360 dual boot Windows10 / Archlinux) after Windows10 deleted the entry for my linux partition on the partition table. Testdisk does indeed find a linux partition, but tells me it can't be recovered, not sure why.

See my testdisk log here.

I've tried inputting the start and end sectors in parted rescue but with no luck. Do I have any other option? What about using gdisk to recreate the partition at the same sectors without formatting it?

Thanks for your help.

Re: Linux partition can't be recovered. Any options?

Posted: 07 Feb 2020, 07:00
by cgrenier
After Quick Search, use 'a' to manually add the missing partitions. Use the arrow keys to switch the partitions from the list to P(rimary). The partition not listed from this list must be marked as D(eleted).
Use 't' to change the partition type if necessary.
On next screen, you can have:
1 P EFI System 2048 1026047 1024000 [EFI system partition]
2 P MS Reserved 1026048 1288191 262144 [Microsoft reserved partition]
3 P MS Data 1288192 368368407 367080216 [Basic data partition] [OS]
4 P Windows Recovery Env 401928192 403150847 1222656
5 P Linux filesys. data 403152894 1000215173 597062280
If it's OK (and only in this case), choose Write, confirm, Quit

Re: Linux partition can't be recovered. Any options?

Posted: 07 Feb 2020, 10:14
by avilqu
Thanks for the quick answer, and the amazing work done on testdisk.

After the quick search, I'm greeted with a table that seems a bit chaotic, with sector numbers all over the place. None of the partitions seem to be overlapping, but definitely there are gaps between the partitions. On the screenshot, you'll see a structure with Primary partitions that seems to work and does include the Linux filesystem, but given the complexity of the rest of the table I'm not quite sure it's safe to write. Any advice?

Thanks.