4
1
Abstract
I have a FAT32 memory card that when inserted into a computer causes Windows to prompt to format it. The card is definitely not supposed to be blank and has a bunch of files on it.
Symptoms
Using a hex-editor/disk-viewer, I examined the card and found that several sectors/clusters have been overwritten with something that has a signature of USBC
at the start of the sector. Specifically, the master boot record (and partition table) is gone (hence Windows thinking the card is blank and needing to be formatted), as are the boot sectors (they have the USBC
signature and a volume label of NO NAME
and partition type of FAT32
).
Fortunately, it looks like both copies of the FAT are almost entirely intact (a few FAT entries at the start of a cluster here and there seem to be overwritten by USBC
). The root directory is also nearly intact—I can see the volume label entry and subdirectory listings, but one sector is overwritten. (There are no more instances of USBC
after the last one in the FAT2.)
Hypothesis
These observations seem to indicate some sort of virus that erases a few key filesystem structures, and then overwrites a few extra sectors here and there. Googling it seems to corroborate the idea of a virus, except that others report a file called USBC
which does not apply here, and in fact, could not be possible since there is no filesystem to even see files. I cannot find any information about a virus with these symptoms, nor a removal tool. (I can't help but wonder if it is actually due to an autorun virus prevention tool.)
Question
I can likely fix the FAT corruption since they are mostly contiguous chains and maybe even the lost sector of the root directory, but does anyone know of a convenient way to restore or (re)create the MBR/partition table and boot sectors (without formatting or overwriting the data)?
It happened again recently; another card had the
USBC
corruption. I had specifically gone out of my way to avoid modifying the card because I had accidentally deleted some files and wanted to avoid overwriting anything on it. Yet somehow, the card suddenly became corrupted (fortunately I had cloned it first). The write-protect switch was useless because the reader I was using was another cheap Chinese reader from eBay which seemed good (certainly much better than the previously used rubbish one), but it did the same thing. Cheap Chinese card-readers are *trash* and should be avoided!!! – Synetech – 2015-02-02T22:00:51.767Experienced in https://bugs.gentoo.org/show_bug.cgi?id=409565 as well.
– Tamara Wijsman – 2012-11-04T23:47:05.443Thanks for the link (specifically the relevant comment). Mine was a memory card, not a flash-drive, but they are effectively the same. Moreover, while I don’t recall exactly, I would not be surprised if the circumstances mentioned in that thread (removing a card/drive while the laptop is asleep) did indeed occur at some point for me. This new information makes this question all the more important.
– Synetech – 2012-11-05T00:19:27.510Odd that this question got another up-vote this week since it happened to me again recently. I plugged a 2GB SD card into a card-reader (a cheap Chinese one I bought on eBay for a few cents and have been using without issue for a couple of years), and plugged that into the laptop, as I had done many times. Last week, I was only able to read from it; the write function was broken and treated all cards are read-only. The other night, it would not light the LED or register the removable drive in Windows until I removed the card. Obviously it has trouble with the card connector. – Synetech – 2013-06-27T19:32:56.560
I then tried another, similar card-reader which did light the LED, let me read the card, and let me write to it. Unfortunately, not long afterwards, it showed a couple of very large junk files that could/should not have existed (they did not even register when I checked the disk-usage). I used the safely-remove-device function to eject the card(reader) and unplugged-replugged it in. Windows now informs me that it is unformatted. I opened it in a disk editor and sure enough, the MBR is gone and overwritten by gibberish that starts with the string
USBC
. – Synetech – 2013-06-27T19:35:21.553I have made a sector-dump of the card (fortunately only 2GB) and used PhotoRec to extract the files and a hex-editor to extract the directory entries. I may be able to “restore” most of the card like last time, after a bunch of work but fortunately this one only had a few, large-ish, reproducible/downloadable files (still hours of work).
Obviously these cheap, Chinese readers are crap and unreliable (same error with 2-3 readers and 2-3 cards). They can/do corrupt your data. I highly recommend against using them (other than maybe to rip out the connector for use in electronics projects). – Synetech – 2013-06-27T19:41:21.817