Home
Posted By: Virtual1 flash drive corruption - 06/30/15 12:02 PM
I've ran into this problem from time to time in the past, but recently it's just jumped out of the bushes and tackled me. I'll be using flash drives to boot macs (for imaging or service) and I suddenly find that a flash drive isn't showing up in the boot selector at power-on. When I plug it into another computer I get the dreaded "would you like to initialize this drive?" popup.

In the past I've just given a bit of a sigh and rebuilt it. But lately I've been working with several different boot images and trying to tweak, compare, and troubleshoot them, and it's gotten a lot more inconvenient.

In addition to basic boot drives, I've also had my service flash drive (with tools, documents, software installers, etc, a big 32, 64, 128, or 256gb) get nuked this way and have to restore it. (fortunately I keep it backed up, for the most part!)

So I decided to dig a little deeper this afternoon when TWO of my boot drives got hammered in close succession. The first place to check was of course the boot block, expecting to see that one block zeroed out as I have seen before. But surprise, it's got pure garbage in it. Not just block 0, the first 64k of the drive is full of a block of keyboard vomit. (49152 bytes, $C000) I suppose that's a single block for many flash storage devices. (though these all claim a block size of 512 bytes in disk utility, and I HAVE seen that change, I have a 4tb hdd with a 4kb block size)

I would suspect a flash drive bug, but I've had this happen with a wide range of different flash drives, which points more to an OS problem. And the issue appears to be most often caused when trying to access the drive from the boot select at startup. (I've seen an external hard drive or two get block 0 nuked in the past this way, but for me it's been a MUCH more rare event)

My stopgap for the moment was to use DD to back up the first 64kb of my flash drives. Many of them are laid out with identical partition schemes, just one 8gb APS on a GUID drive, but I made a point to back up different schemes separately. No sooner had I done that than I had ANOTHER one get nuked, WHILE SWAPPING DRIVES AROUND TO BACK UP. I was immediately able to fix it, but what the heck is going on here??

Anyone else have similar experiences with drives suddenly becoming "unformatted"?


segway: os x stores a copy of the boot block (blocks 0 and 1) at the very end of the drive. I've seen cases where blocks 0/1 got zero'd, and the os stunned me by simply grabbing the backup and fixing itself transparently, on-the-fly. But if there's garbage there, or if the rest of the partition table is hosed, that won't work
Posted By: Ira L Re: flash drive corruption - 06/30/15 02:44 PM
I have not seen this happen, and I have a few flash drives with boot setups. Are you doing all of this inspection and setting up on the same computer every time? It would be too simple to say the problem lies with the desktop/laptop you are using, but… confused

By the way, your expression "keyboard vomit" is priceless! grin
Posted By: Virtual1 Re: flash drive corruption - 06/30/15 06:16 PM
yep this experience is across a wide variety of hardware. various computers, flash and hard drives, internal hard drives even, (yes, "yikes") and OS versions. The internal drive was particularly nasty. I had my computer hooked to another mac that was in firewire target mode, and when I attached to it to run disk warrior from my laptop, my laptop HDD got nuked! badly enough that I had to reformat and start over. that was a very unpleasant day.
© FineTunedMac