I most likely pulled the drive during a write operation and damaged the partition data. The drive now won’t show in Disks or gparted but it will show in lsblk and fdisk, but not consistently.
lsblk (returns response immediately)
it always shows sdc, 8:32, 1, 233.3G, 0, part
and sometimes shows sdc1, 8:33, 1, 233.3G, 0, part
fdisk -l (takes forever, or just fails to return anything at all)
The backup GPT table is corrupt, but the primary appears OK, so that will be used.
Disk /dev/sdc: 233.26 GiB, 250450280448 bytes, 489160704 sectors
Disk model: Ultra
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 00000000-0000-0000-0000-000000000000
Device Start End Sectors Size Type
/dev/sdc1 2048 489160703 489158656 233.3G Microsoft basic data
Most everyone suggests using testdisk, which got me far, but can’t seem to successfully save the changes and recover the drive. Testdrive is doing something right, sometimes, because it often finds the damaged partition and even lets me read the file contents, but it’s extremely slow and inconsistent because the drive is not acting right.
I don’t mind losing the data but I’d like to try and recover the partition if possible. I’d like to see if I can do it manually instead of using testdisk and would appreciate help with the steps to recover the partition. If the data can’t be recovered, then I’d instead appreciate steps to recover the USB. It’s a 256GB and I’d hate to have to replace it.
One other note, I can’t get gdisk to work at all with the thumb drive. I tried running it as root and when prompted, I entered the drive location and it just hangs.
Type device filename, or press to exit: /dev/sdc
Thank you for your help!