Premiere Bay Area Wedding Photography Blog by Trifon Anguelov Photography

1090 Clark Avenue, Mountain View, CA 94040 | (650) 930-0743 |


How To Repair Your Corrupted USB Flash Drive

Wires by Trifon Anguelov Photography  As a wedding and portrait photographer, I have been using DVD disks the last few years to deliver the final images to my clients. It was a convenient way to store up to 4.35GB of digital images and mail them. But as with technologies which change overtime,  DVD disks soon became obsolete.

With the price of USB Flash Drives dropping significantly and becoming more affordable and widespread, many computer manufacturers nowadays don’t simply add DVD disk drives to their laptops anymore. The trend has been to store and share data (including digital images) between computers with flash memory instead.

Using USB Flash drives is also more convenient. These drives are small to carry around and very sturdy in comparison to DVD disks which scratch and break easily. Not to mention to copy and read from USB Flash drives is much faster.

Recently purchased a batch of USB Flash drives for the 2015 Wedding season and after formatting and verifying all the memory sticks, found two with problems. Both were not recognized on my Windows 8 workstation so I decided to try to fix them on my MacBook Pro laptop. If you are also looking for information on how to prevent SD or CF memory cards corruption in your digital camera, this article explains in details: Five Easy Steps To Prevent Memory Card Corruption And Losing Your Photos

Here are the steps I took to repair and format them. Both are usable now and I can copy and erase digital images just fine.

First, you’ll need to figure out the disk number of the USB Flash drive. Go ahead and plug it into your Mac laptop, open new terminal window and check if the drive is recognized:

# df -k
Filesystem    1024-blocks     Used Available Capacity  iused    ifree %iused  Mounted on
/dev/disk1      117190724 50159960  66774764    43% 12603988 16693691   43%   /
/dev/disk2s1       983148      844    982304     1%        0        0  100%   /Volumes/USB #6

In this case the new device /dev/sidk2s1 has been recognized and available. In case df 0k command doesn’t give you any input, open Disk Utility application and disk out the device number for the USB Flash drive.

Next using the Disk Utility command line tool, try to verify and repair the drive by using these commands:

# diskutil info /dev/disk2
Device Identifier:        disk2
Device Node:              /dev/disk2
Part of Whole:            disk2
Device / Media Name:      General UDisk Media

Volume Name:              Not applicable (no file system)

Mounted:                  Not applicable (no file system)

File System:              None

Content (IOContent):      None
OS Can Be Installed:      No
Media Type:               Generic
Protocol:                 USB
SMART Status:             Not Supported

Total Size:               8.2 GB (8178892800 Bytes) (exactly 15974400 512-Byte-Units)
Volume Free Space:        Not applicable (no file system)
Device Block Size:        512 Bytes

Read-Only Media:          No
Read-Only Volume:         Not applicable (no file system)
Ejectable:                Yes

Whole:                    Yes
Internal:                 No
OS 9 Drivers:             No
Low Level Format:         Not supported

# diskutil verifydisk disk2

Nonexistent, unknown, or damaged partition map scheme
If you are sure this disk contains a (damaged) APM, MBR, or GPT partition
scheme, you might be able to repair it with “diskutil repairDisk disk2”

# diskutil repairdisk disk2
Nonexistent, unknown, or damaged partition map scheme
If you are sure this disk contains a (damaged) APM, MBR, or GPT partition map,
you can hereby try to repair it enough to be recognized as a map; another
“diskutil repairDisk disk2” might then be necessary for further repairs
Proceed? (y/N) y
Error repairing map: POSIX reports: Input/output error (5)

In my case as expected, both verify and repair command options failed, so it was time to bring the low level tool: gpt. This is a nice utility which will modify and recreate the disk partition table. The following commands will rewrite the partition table for /dev/disk2 to near-default (possibly a little bigger primary volume). You will need to change the /dev/disk2 with the disk number for the USB Flash drive you have before running the commands:

sudo dd if=/dev/zero of=/dev/disk2 bs=512 count=10 conv=sync,noerror
sudo gpt destroy /dev/disk2
sudo gpt create /dev/disk2
sudo gpt add -i1 -b40 -s409600 -tC12A7328-F81F-11D2-BA4B-00A0C93EC93B /dev/disk2
sudo gpt add -i2 -b409640 -t48465300-0000-11AA-AA11-00306543ECAC /dev/disk2

Then use Disk Utility (or preferably Disk Warrior) to repair the directory structure.

Here is the output of the above commands for my USB Flash drive I was trying to repair:

# gpt recover /dev/disk2
gpt recover: unable to open device ‘/dev/disk2’: Device not configured

# diskutil list
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:      GUID_partition_scheme                        *121.3 GB   disk0
1:                        EFI EFI                     209.7 MB   disk0s1
2:          Apple_CoreStorage                         120.3 GB   disk0s2
3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:                  Apple_HFS Macintosh HD           *120.0 GB   disk1
#:                       TYPE NAME                    SIZE       IDENTIFIER
0:                                                   *8.2 GB     disk2

# dd if=/dev/zero of=/dev/disk2 bs=512 count=10 conv=sync,noerror

10+0 records in
10+0 records out
5120 bytes transferred in 0.012109 secs (422825 bytes/sec)

# gpt destroy /dev/disk2
gpt destroy: /dev/disk2: error: device doesn’t contain a GPT

# gpt create /dev/disk2

# gpt add -i1 -b40 -s409600 -tC12A7328-F81F-11D2-BA4B-00A0C93EC93B /dev/disk2
/dev/disk2s1 added

# gpt add -i2 -b409640 -t48465300-0000-11AA-AA11-00306543ECAC /dev/disk2
/dev/disk2s2 added

# diskutil repairdisk disk2
Repairing the partition map might erase disk2s1, proceed? (y/N) y
Started partition map repair on disk2
Checking prerequisites
Checking the partition list
Adjusting partition map to fit whole disk as required
Checking for an EFI system partition
Checking the EFI system partition’s size
Checking the EFI system partition’s file system
Repairing the EFI system partition’s file system
Creating a new EFI system partition


Viola. The partition table was recreated and the USB Flash drives are again usable. After that you can unmount the USB Flash drive and mount it again, then use Disk Utility tool to create partition or format it.


I hope you found this article useful and helpful to solve USB Flash drives problems you might have experienced. A word of warning: The above steps would erase all data on your flash drive and would format it blank, so make sure you are OK with losing all the data before executing the commands. This approach is also not guaranteed or recommended by all USB Flash drive manufacturers, so please check and confirm before using it. I will not be liable for any lost of data or damages you might experience by using the above steps.

If you USB Flash drive contains data and you are trying to recover digital files from it, but the drive cannot be recognized at all, then consider these memory card and USB Flash Drive recovery tools and services: How To Recover Photos From Memory Card

About the Author:

Trifon Anguelov Photography is a Premiere Bay Area Wedding and Events Photography business  based in Mountain View, CA 94040 and serving clients in San Francisco Bay Area. You can read more about the author and follow his work on his Bay Area Wedding Photography Site



How To Recover Photos from Memory Card

Wires by Trifon Anguelov PhotographyAsk few wedding photographers what is the biggest fear they have and the majority would most likely answer: Losing the digital images after a wedding. It’s the absolute nightmare as these images cannot be easily recaptured.

Try to replay the wedding so a wedding photographer can capture the images again?
Most likely won’t happen. Imagine how the bride and her family would feel if all of their wedding images have been lost forever. No wonder many file lawsuits against the wedding photographer they have hired and request hefty compensations.

Digital cameras and specifically DSLRs have gained huge popularity and are the most widely used type of digital cameras by professional photographers currently. They use CF (Compact Flash) or SD (Secure Digital) memory cards to capture and store the digital images and sometimes the images cannot be read or retrieved from the memory cards. The reasons and how to prevent this from happening are topics for another blog which I am planning to write soon.
For now we will focus on the question: What are the options to recover digital images from memory card and what is the software or services available?
There are three types of photo recovery solutions currently available on the market:

  • Memory Card Vendor Solutions
  • Independent Software Application Developers
  • Data Recovery Service Providers

Memory Card Vendor’s Solutions:

Many memory card manufacturers offer digital image recovery solutions to the customers who purchased their memory cards. It is part of the post-sales support which differentiate them from the competition and all of these are doing pretty good job on recovering digital images.
Although these are offered by a specific memory card manufacturer for their specific memory cards, they are capable to recover images from memory cards from different manufacturers.
The recovery software is designed for the specific memory card specifications these manufacturers produce and sale, have been tested on the manufacturer specific memory cards and are usually supported by their software development teams.

The recovery software is offered for a specific period for free with the purchase of a new memory card. The software download link and activation code is provided into the memory card package. The only catch is that the activation code is valid for a specific period or time after which am yearly renewal is required at additional cost.

Related: How To Prevent SD and CF Memory Card Corruption

Below are two image recovery software solutions from SanDisk and Lexar which do pretty good job and are affordable considering the sentimental or professional value of the images they can recover:

Image Rescue from Lexar:

SanDisk Pro Rescue from SanDisk:

  • URL:
  • Price: $40 (Standard Edition), $60 (DeLuxe Edition), $250 (Commercial Edition) for 1 year subscription
  • Features: Available for Windows operating system only. Recovers images, video, email, documents or simply anything stored on the memory cards. Supports wide variety of memory cards. Allows you to see a preview of the file to be recovered which is useful if you are looking to cherry pick a file to recover. Formats and securely removes files from the memory card.

RecoveRx from Transcend:

  • URL:
  • Price: Free
  • Features: Offered for both Windows and Apple OSX operating systems. Recovers digital files, documents, audio and video files from all types of memory cards, MP3 music players, USB flash drives, external hard drives and solid state drives. If also offers memory cards formatting and password protection in addition to recovery data files.

Related: How To Repair Corrupted USB Flash Drive

Independent Software Application Developers:

Apart from digital recover solutions by memory card manufacturers, there are software programs created by independent software development companies which are competing into this lucrative market. These software developers have created a solutions capable of recovering photos from all major memory card brands. The cost varies from free to below $100 per activation and their capabilities and user interface friendlies varies.

Software development is a very competitive business, so when considering which solution to purchase or use, check the memory card compatibility and latest updates available before making the final selection and purchase.

Here are few software solutions which do pretty good job on recovering pictures from memory cards:


  • URL:
  • Price: Free or $25 for registered commercial license
  • Features: Can recover a single file only and securely deletes files from the memory card. Setup Wizard is useful to do the initial setup. Can recover mp3, images, videos and documents

Zero Assumption Recovery (ZAR):

  • URL:
  • Price: Free or $60 (single user) / $200 (site license) for commercial license
  • Features: Available for Windows operating system only. It has been around since 2001 and was first used in MS-DOS on 486 CPUs so it is very successful and reliable.

Card Rescue:

  • URL:
  • Price: $40 (single licenses)
  • Features: Available for Windows and Mac operating systems. Recognizes all major file formats (JPEG, TIFF, PSD, etc) as well the RAW formats from all major camera manufacturers (Canon, Nikon, Sony, Olympus, Panasonic, Fuji). The scan for recoverable files takes between 5-20 minutes and the success rate if about 90%.

Photo Rescue:

  • URL:
  • Price: $30
  • Features: Available for Windows and Mac operating systems. Created back in 2001 but has been updated lately which is always good to have more recent version available. Recovery utilizes a Wizard which makes the recovery process even easier. One time license is good so there are no additional perpetual cost after the purchase.

Card Recovery Pro:

  • URL:
  • Price: $50
  • Features: Available for Windows OS only. Created back in 2002 and can recover multiple file formats: images, audio, video and documents from digital cameras, memory cards, mobile phones and iPods. It supports RAW digital image formats from all major digital camera manufacturers including Canon, Nikon, Sony, Fuji, Olympus, etc.


  • URL:
  • Price: Free (although donations are accepted and help the developer’s of the project)
  • Features: Available for both Windows, Mac and Linux operating systems. It’s an open source software released under GPLV v2+. It recognizes more than 440 file formats (check the documentation for full list) and has been tested with major camera models.

Photo Recovery:

  • URL:
  • Price: $39 (Basic) or  $78 (Platinum Edition)
  • Features: Available for Windows and Mac operating systems. Recovers RAW files from all major digital camera manufacturers (including Canon, Nikon, Sony, Fuji, Pentax, Sigma, Olympus, Panasonic, etc). The company claims their software can recover digital images even from formatted memory cards which is impressive and has 30% improved files scan.

Data Recovery Service Providers:

Apart from the photo recovery software a photographer can use to recover images on its own, for those who don’t have the time to recover images or are able to recover the photos by using the applications above, there are also photo recovery services. These services are specializing into data and image recovery from data storage media (hard drives, memory cards, USB sticks, etc).

The advantage of using these services is that they have perfected the recovery process and have proprietary software and technicians able to recover photos from memory cards. They work with both government agencies, corporate clients and individuals and can deal with various types of data loss reasons. Their services are fairly priced considering the value they provide. The cost varies but it’s generally below $60 for a memory card. Considering the value of wedding images on a single 64GB memory card, this is very affordable.

Here are two photo recovery services a photographer can use:

  • Tekserve ( in New York City, NY is a service provider and provides data recovery services. They have been in business since 1987 and are Premiere Apple Service provider. The company is offering free estimate for the recovery cost and guaranteed their services by no charge policy for data that cannot be recovered. Rush service is available and this is a real time saver for any emergencies.
  • Flashback Data Recovery ( in Austin, TX. They do data recovery for the FBI, but anyone can use their services. Free estimates are available online and it’s simple as filling an online form with the data recovery request and receiving an estimate within 1-2 hours. And if you lost images from your computer’s hard drive or external storage array, they have Class 10 clean room to repair the hard drive before attempting to perform the recovery. They also have No-Data, No-Fee policy so you would only pay for their services if they are actually able to recover your data.
  •  1st Data Recovery ( with locations in USA, Canada and UK and 22 years of data recovery experience offers support for lost data on: hard drives, RAIDs, NAS arrays, data tapes, digital camera memory cards and sticks. Supported files are RAW, JPEG, TIFF, PCX, DWG, etc. They event support recovery of data from dead, deleted, formated, corrupted, fire and water damaged hard drives, removable media and data tapes. Check their FAQ section for types of recovery they perform, but the list looks impressive.
  • Data Recovery ( has four clean-service full-labs in USA and Canada. Founded in 1998 is has long history of data recovery and currently has Class 100 Data Recovery Clean Room. You will get 24×7 support and assurance that your data will be recovered. The proof?  NASA, Lockheed Martin, Microsoft are just few of their clients. Not only their can recover photos from a memory card but all sorts of files from a single hard drive, arrays, iPhone or laptops. Online chat and recovery request available for your convenience.


I hope that, you as a photographer or simply an owner of digital camera would never need to recover your pictures from a memory card, but in case you have to do it, you have a good guide on what options are currently available to you. The data recovery is a field in which many software companies specialized for many years as well there are many new entrants who are trying to establish themselves.

I am not sure after 2-3 years these same companies would be still offering digital image recovery solutions but one thing is for sure: With the rate of which consumers generate pictures the amount of memory cards and photos being captures has exploded over the past 5 years. Even as the Wi-Fi enabled cameras and cloud storage solutions for digital photos are getting available and more affordable, the memory cards are here to stay for at least another 10 years.
If you found this information useful  and think your friends could benefit from it, please share it by using the multiple sharing options on the bottom. Agree, disagree, have comments or feedback? Think I am missing a point or two or three? Drop me a line in the comments section and I will consider adding it (with full credit to you, of course).

About the Author:

Trifon Anguelov Photography is a premiere wedding and events photography business  based in Mountain View, CA 94040 and serving clients in San Francisco Bay Area, CA. You can review his current Wedding and Events Portfolio and Book an Online Appointment for one of his services.


Five Easy Steps to Prevent Memory Card Corruption and Losing Your Photos

Grid Picture by Trifon Anguelov Photography Long is gone the time when analog photography was the only option to capture memories or images from everyone’s life. It used to be the only option back in early 2000, but in the last 10-12 years with the emergence of the digital imaging this arcane technology gave way to the digital cameras.

The old film rolls which were bulky and could store between 24 to 36 frames where quickly obsoleted by memory cards which were able to store thousands of images and didn’t require a trip to a photo lab in order to see the final images.

With the digital imaging and memory cards, everyone who had a digital camera could see instantly the captured image, retake it immediately if the first image was not as expected and can instantly share the digital images with everyone as soon as they finished downloading them from the digital cameras.

Welcome to the digital revolution and instant gratification!

But as with every new technology there are some caveats which consumers have to face. In the case of the memory cards the caveat is the probability of having a corruption or data loss on the memory card. This ranges from memory card reader not being able to recognize the memory card, to memory card read errors, to no images found on the memory card, to read errors for some of the images while the rest of the images are downloaded just fine.
While some of the above errors could be contributed to memory card hardware failures or permanent damage to the memory cells on the memory card, some of the failures are from not properly using the memory cards or simply caused by the users themselves. Each memory card and digital camera manufacturers have guidelines on how to operate their cameras and use the memory cards, but very few consumers bother to read these guidelines and even so follow them.

Well while not an absolute guarantee for 100% memory card corruption free experience, here are five easy steps along with the explanation why they are important to avoid memory card corruption and lost of your precious digital images:

1. Always Format Your Memory Card Before Using It:

Each memory card storage is divided into two parts: one for the images metadata and one for the images itself.

The metadata contains the pointer to the location where the images are stored, image type, the date the image was taken, image size, etc. It is the catalog or index of the images stored on the memory card.

This is the most likely reason while the images cannot be accessed or read from the memory card. Without the metadata (or index) the memory card readers cannot index the images or read them. The metadata corruption unless caused by corrupted memory cells can be prevented by formatting the memory card after each successful downloading of images and before each use. The formatting resets the metadata (zeros the pointers to the existing images) and prepares it for new use.

The other reason is that the images have been stored on a corrupted memory cells and cannot be read later. This is nothing you can do about it and the best fix is to discard the memory card and purchase a new one.

To format your memory card, you would need to insert the memory card into your digital camera and navigate the setup menu to the option “Format Card”. Please, consult your digital camera manual on how to do that. Keep in mind that there is another camera option “Erase all images” which is different from the “Format Card” option. The memory card metadata is reset only with the later and not the former option.

Formatting the memory card would reset the images metadata on your memory card (this is the pointers to the digital images stored on the card). The images itself would remain in tact until they are being overwrite with the new images you will take. This is the reason why the images can be recovered even after the card is being formatted (granted you have to use the card after the formatting). The image recovering software reads the stored images on the card and reconstructs the metadata on the memory card, so the images can be read and accessed again.

2. Never Delete Images On the Memory Card From Your Computer:

Some users delete the images from their computer (Mac or PC) simply by going to the mounted memory card which appears as a storage device, navigating to the folder where the images are located and deleting them.

What this does is that it removes the pointers to the pictures WITHOUT properly updating the metadata (I hope you read point #1 above) on the memory card. This leads to inconsistent metadata which could cause your existing and new images to be mixed up later.

The proper way to delete all images from your memory card, so you can release the used space is to use your digital camera menu and format your memory card before using it again.

If you are deleting photos from your memory card from your computer, it has been confirmed that Canon camera users will encounter the ill famed ERR-99 error messages. Although this is a camera generic error not specific to a memory card problems, it has been confirmed that memory card corruption is one of the reasons for this error.

Related: How To Repair Corrupted USB Flash Drive

3. Use Memory Card Readers Instead of Downloading From Your Camera:

Each digital camera manufacturer provides drivers for their cameras so they interface with the major operating systems and computer systems consumers use to download their images. Each digital camera needs to be connected via USB cable to a PC or Mac to download the images and the connection and images transfer is made possible if the software drivers are installed and kept up to date in each computer.

If the drivers are not installed or corrupted, so the pictures download or access could become corrupted too. This is the case when consumers use different digital camera models or trying to download or share the memory card on another computers.

The advantage of using memory card reader is that most likely this reader has already the required software drivers installed and all memory cards are compatible so the chances to have a corruption is minimized.

4. Use Smaller Size Memory Cards:

Memory card with smaller storage capacity have smaller number of memory cells compared to memory cards with larger storage capacity. It is just a numbers game: The more memory cells a memory card contains, more of them can become corrupt and fail. Using a memory card with enough capacity to capture all images from your event plus 30% buffer is a good idea instead of buying a memory card with the largest available capacity.

Another advantage is that is you buy eight 16GB memory cards instead of one 128 GB memory cards and one of these 16GB memory cards has a hardware failure you would still have seven 16 GB memory cards (or 112GB of storage) while if the single 128GB memory card encounters memory cells failures you will have zero memory cards available and zero storage. And if you are still not convinced of using smaller size memory cards rather than larger, take this recommendation from Lexar: Smaller cards use less battery power from you camera, so you can shoot longer with the same battery too.

As the saying goes: Never put all your eggs in a single basket! Although the memory card manufacturers would give you an incentive to do otherwise by making the large capacity memory cards cheaper than multiple smaller storage memory cards providing the same storage capacity.

Related: How To Recover Photos From Memory Card

5. Don’t Use the Same Memory Card For Multiple Events:

If you have adequate number of memory cards, using a single one for one event or session only can prevent you from losing the pictures from multiple events in case a memory card corruption occurs. I usually change the memory cards for each event and never record two events or sessions before first downloading the images from the first session.

Memory cards are very affordable nowadays and this is a good way to further protect you from losing precious pictures.


The five steps listed above are easy to follow and perform even if you have a point-and-shoot portable camera and taking images on a family event. These are good practices which would minimize the probability of software memory card corruption and save you time and money trying to recover your pictures.

Remember that memory cards are using NAND flash memory which first varies from a manufacturer to manufacturer and second it wears off after usage. While you can prevent software corruption the hardware corruption is hard to predict and prevent. Still there is one thing you can do: If you are thinking to purchase second-hand memory cards, inquire about how and for how long the previous user has been using the memory card. Frequent writes and deletes contributes to the wear of the memory card and you might be better off spending a bit more money for a new memory card and peace of mind.

If you found this information useful  and think your friends could benefit from it, please share it by using the multiple sharing options on the bottom. Agree, disagree, have comments or feedback? Think I am missing a point or two or three? Drop me a line in the comments section and I will consider adding it (with full credit to you, of course).

About the Author:

Trifon Anguelov Photography is a premiere wedding and events photography business  based in Mountain View, CA 94040 and serving clients in San Francisco Bay Area, CA. You can read more about the author on his Wedding Photography Site.