
Once, the myth busters on the Discovery Channel dealt with this issue. They tried all kinds of the strong magnets, but none spoiled the hard drive in a laptop. But, when they exposed it to a commercial high powered magnet which is capable of lifting a car, the hard drive was entirely damaged. So the answer: it is unlikely to be damaged by any available magnet except the one used in shipyard to lift cars.
Unlike floppy discs, a hard drive has two big advantages. First is the magnetic flux density necessary to write a bit to the drive has increased as the bit density has increased. So even the degaussers sold commercially to bulk erase hard drives from some years back are not powerful enough to erase current drives.
Second advantage: it’s encased in metal. You could find a magnet large enough to corrupt or damage a hard drive, but you probably don’t own one. I ran into a benchtop superconducting electromagnet in a lab at MIT some years back.
It was recommended that these not be used near computers. And that car-lifting magnet the Mythbusters used is right out. Of course, a strong enough magnet might also fold, spindle, or otherwise mutilate the drive’s heads, bearings, etc.
An SD card stores data by trapping electrons within normally insulated transistor gates via Fowler–Nordheim tunneling. They are normally unaffected by the presence of a magnetic field.
It’s possible that, if you put an SD card into a very powerful varying magnetic field, you might induce electrical currents in the card that could corrupt the electrical charges stored on those FETs. But it’s also possible you’d damage the rest of the electronics on the card, such as the SD controller chip. Dead is dead, no matter how you arrange it.
I should point out, too, that I’m putting my money where my mouth is on this one. I have magentic mounts for my phone and tablet, both of which, of course, use flash memory for storage. After a couple of custom-made car mounts for specific phones, I switched to a small metal plate sticker on the back of the phone and a magnetic mount on my car’s console.
I have a little gizmo I made from a tripod ball head, magnets, and a thread adapter than lets me put my tablet up on a music stand, for an easy music read while playing guitar. I could pop that off, put the phone on, if I decided I wanted to shoot video at a music event instead.
