0

I recently recovered an accidentally formatted ext4 partition by following these steps: Recover ext4 file system after quick format

The recovered drive now shows up in testdisk after running "quick search" and I can browse my lost files. However, if I select the recovered drive in testdisk and use the "write" option, the drive still can't be mounted after restarting my computer as the program suggests.

I believe the problem is that although I successfully recovered my lost ext4 partition from a backup superblock, I never updated the GPT partition table to reflect this. Hence, Ubuntu cannot detect/mount the drive. How do I fix this?

  • If you can see files in testdisk, make sure you create backup, if you do not already have a backup. repair gpt: http://www.rodsbooks.com/gdisk/repairing.html & https://askubuntu.com/questions/386752/fixing-corrupt-backup-gpt-table/386802#386802 – oldfred Jun 10 '22 at 03:47
  • I think that the GPT table is not necessarily corrupt, it just hasn't been updated to reflect the changes I made to my data partition. Gdisk says "No problems found. 4205 free sectors (2.1 MiB) available in 2 segments, the largest of which is 2191 (1.1 MiB) in size." – firstname gklsodascb Jun 10 '22 at 21:51
  • Gdisk would say if primary, backup & protective MBR are not correct and then you need to do a w to write updated info. Repair gpt http://askubuntu.com/questions/112921/help-me-extract-partition-table-gpt & http://askubuntu.com/questions/446991/gparted-claims-whole-hard-drive-is-unallocated-and-gives-warning-about-gpt-table & https://askubuntu.com/questions/460233/cant-restore-my-gpt-data-with-gdisk – oldfred Jun 10 '22 at 23:56
  • I tried opening gdisk and hitting "w" and it recovered the partition that I accidentally created, not the recovered partition that I want to restore. So, now I have to restore the disk from a backup (which will take hours.) – firstname gklsodascb Jun 11 '22 at 00:17

0 Answers0