9
2
It's an 8 GB Patriot thumb drive, which I've used extensively with lots of data. Today, it is detected, but all data is gone: (EDIT at least some data is still there, but the partition table is gone)
EDIT @Sathya (thanks) here's the relevant output from sudo fdisk -l
:
Disk /dev/sdc: 8019 MB, 8019509248 bytes
247 heads, 62 sectors/track, 1022 cylinders
Units = cylinders of 15314 * 512 = 7840768 bytes
Disk /dev/sdc doesn't contain a valid partition table
It looks like it is /dev/sdc, with that 8 GB... and no partition table.
I tried to mount /dev/sdc (and then dmesg | tail
):
/media> sudo mount /dev/sdc mytmp
mount: wrong fs type, bad option, bad superblock on /dev/sdc,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
/media> dmesg | tail
[ 24.300000] sdc: unknown partition table
[ 24.320000] sd 2:0:0:0: Attached scsi removable disk sdc
[ 24.370000] usb-storage: device scan complete
[ 26.870000] EXT2-fs error (device sdc): ext2_check_descriptors: Block bitmap for group 1 not in group (block 0)!
[ 26.870000] EXT2-fs: group descriptors corrupted!
[ 50.420000] unhashed dentry being revalidated: .DCOPserver_eeepc-brendanma__0
[ 50.430000] unhashed dentry being revalidated: .DCOPserver_eeepc-brendanma__0
[ 50.430000] unhashed dentry being revalidated: .DCOPserver_eeepc-brendanma__0
[ 5565.470000] EXT2-fs error (device sdc): ext2_check_descriptors: Block bitmap for group 1 not in group (block 0)!
[ 5565.470000] EXT2-fs: group descriptors corrupted!
EDIT @Col: results from testdisk
Disk /dev/sdc - 8013 MB / 7642 MiB - CHS 1022 247 62
Current partition structure:
Partition Start End Size in sectors
Partition sector doesn't have the endmark 0xAA55
After I hit [proceed]
, it says:
Structure: Ok.
Keys A: add partition, L: load backup, Enter: to continue
The "Structure: Ok." seems reassuring... will "A: add partition" make my old data accessible (if it's still there), or will it make a new, fresh partition?
Another option is "[ MBR Code ] Write TestDisk MBR code to first sector
" - would it be better to do this?
EDIT I found that at least some of my data is still on the flash drive, by using the below, and searching for English text in less (like " the "):
cat /dev/sde | tr -cd '\11\12\40\1540-\176' | less
(The drive changed from "/dev/sdb" to "/dev/sde" because I connected some extra drives today). I've learnt that "/dev/sde1" would be the first partition; and "/dev/sde" is the whole drive. Because unix treats these devices just like files, you can use all the ordinary unix file commands on them, like cat
, and then process them like any other stream of data. The tr
above removes non-printable characters ("\40" is space, which I wanted to preserve). In less, you can use "/" to search, similar to Vim.
How can I get my data back (assuming it's still there)? If only the partition table is corrupted, is there a standard "partition recovery tool"? Is there a way to "repartition" without deleting everything?
@ChrisF That answer doesn't work... and I can't respond to it there - so I have here (see the edit to the question). – 13ren – 2009-08-31T10:45:01.387
@13ren - If you use the same OpenID on both sites you can associate your accounts. However for now please e-mail team@superuser.com and ask them to do the association. I have merged the two questions in the meantime. – BinaryMisfit – 2009-08-31T10:55:03.127
1@13ren - I know you can't respond there. I was including the link for the moderators so they could find the question. – ChrisF – 2009-08-31T10:57:38.630
Thanks ChrisF, sorry I misunderstood. I sent an email as you suggested. @Diago thanks for merging, I can comment now. I'll email them again. – 13ren – 2009-08-31T11:12:53.327
1Insert the drive, and do a sudo fdisk -l and can you please update the post with the output ? – Sathyajith Bhat – 2009-08-31T12:34:31.940
@Sathya: done (thanks). Looks like the partition table is gone (how could that happen?) – 13ren – 2009-09-01T05:21:37.213
@13ren the most likely cause is an unsafe removal while it was writing to the partition table – Col – 2009-09-03T15:16:48.373
@Col OK, my case is unusual, because it hadn't been removed at that time (although a few weeks previously I removed the power supply from the USB hub it was connected to... maybe there was low power?). Also, I was only writing ordinary files, not partitioning it or anything (or does writing files also update the partition table?) – 13ren – 2009-09-05T10:30:23.573