Dealing with Memory Card Corruption
The stuff of nightmares
Has this ever happened to you? You're importing images into Lightroom or Photoshop and one or more of your images has multicolored streaks or part of the image is missing altogether. The images look fine on the camera's LCD, but in your software at least some of the images are a mess. Panic ensues.
First, do not assume your card is corrupted. Judging from inquiries in the Nikon and Lightroom support groups on Facebook, the most likely culprit is not the card, but the card reader. Apparently, they do go wonky and the cheaper ones are more likely to fail than a quality reader (e.g., SanDisk, Lexar, Sony, etc.) So, if this happens to you, try reimporting or copying the images from the card with a different reader. If necessary, use a cable, although that is slow.
There are several possible causes. Turning off the camera while it's writing images, a malfunctioning card reader, improperly or incompletely formatted cards, or a failing card can cause this to happen. It happened to me and I never was able to figure out how, but I trashed the SD card, took a few precautions, and it hasn't happened since. Quality memory cards are robust and should last years; however, stuff happens. I've read of photographers who have accidentally run an SD card through the laundry and were still able to download images. In contrast, CF cards are a bit more fragile. The newer XQD cards seem to be pretty sturdy.
The reason the image may look fine in your camera is because it is displaying an embedded, low-quality JPG file, not the entirety of the image file itself. Unfortunately, the card can be failing and you have no idea until it's too late. How do you prevent this?
Use top quality cards from Lexar, SanDisk, etc. I'm always surprised at people who spend $1,000 or more on a camera and then put cheap cards (or batteries, but that's another story) in them. The pleasure of saving a few dollars will evaporate if you lose images.
Format the card in your camera before each use. Formatting resets the file pointers on the card, refreshing the file structure. It takes about 5 seconds, tops.
Use a quality SD card reader when importing/transferring images. Again, SanDisk and Lexar make high-quality card readers.
Use the card reader built into your laptop/PC if it has one compatible with your card type. The more direct the connection between the card and your computer, the less likely you'll run into problems.
For the same reason, it's probably best not to use a USB hub with your reader.
If you can't import/copy from one USB port, try another port. If necessary, check to make sure the port is working and your drives are up to date.
Never delete images from a card in-camera. Reformat when you're certain your images have been successfully imported into Lightroom or copied to your hard drive and backed up to a second location.
I discourage people from using a cable to transfer images from a camera to a computer. For one thing, it introduces more complexity. Your PC uses drivers from your camera manufacturer and a cable is one more thing to keep track of, and it's slower. Again: direct is better. However, if you've run into a problem with your reader, it's worth it to try again with a cable.
When you import, lock the write tab on the side of the SD card. This prevents you from over-writing or deleting the images on the card until you're sure you've imported the images.
If you use Lightroom, it consider copying your images from the card to a folder on your computer, inspect and delete the obvious duds, and then import (ADD) from there.
In addition to formatting your cards each time, another safety measure, if your camera can write to two cards, is to make the second card a back up, so you have two copies of the same image file. And, while it won't prevent card corruption, this is another reason I prefer to use smaller capacity cards (32GB) and don't fill them before putting in another card. If there's a problem, I won't lose a full day's efforts.
If you do experience this and you determine it's a faulty card, toss the card. Unless you're absolutely sure of the cause, you're better off spending a few dollars on a new quality SD card then taking a chance.