Ubuntu – Recover Partition Table for exFAT Partition

data-recoveryexfatgpartedpartitioningusb

I unplugged my USB stick from Ubuntu 16.04 without the save remove option, but exfat should be fine doing so. No read write was happening, the partition does not use journaling. What I end up with is an unmountable USB stick with checksum error.

What tools are there to recover the partition table or at least the data on the USB stick? What I am doing now is scanning via parted. Has anyone experienced the same problem with exfat and recovery options? Unfortunately parted probably won't detect the partition because it does not support exfat.

I also tried to use Partition Wizard on Windows but it failed to detect anything, just showing unallocated space. How do I proceed? are there helpful tools under Windows or Ubuntu?

enter image description here

I also tried to use gpart -v /dev/sdb but it failed to detect anything. On OS X there is a tool called fsck_exfat, is there any on Windows?

update
The disk is preinstalled with Parted Magic.
After quick search no partition shows up.

Best Answer

exfat should be fine doing so. No read write was happening, the partition does not use journaling

The fact that the file system does not use journaling is the exact opposite of "being fine" removing a drive without unmounting it properly. ;) The OS can't easily fix inconsistencies because there is no such journal.

Use TestDisk

Briefly, your drive still has a partition table and the file system type shows up correctly as exFAT, as seen on your screenshot. Install TestDisk and run it on the device:

sudo apt install testdisk
sudo testdisk /dev/sdb

I have discussed this tool before here on AU, and you might also be interested in the TestDisk guide. As I wrote in this answer on the Unix & Linux Stack Exchange website:

The essential steps are:

  • scanning the drive
  • selecting the partition
  • pressing P to show the files
  • copying the deleted (red) files with C

In this case you might want to copy all files, not just the deleted ones.

Related Question