As with all computers, it is a good idea to back up your Raspberry Pi's SD (or microSD) card from time to time; I'm just going to call them 'SD cards' from here on. This is especially true when you first get a pre-installed card from a retailer or friend.You will need a second computer, or a second Raspberry Pi operating system on an SD card. How you back it up will depend on the computer you have. Whatever computer you have, you will need an SD or microSD card reader. Using WindowsOne of the best tools to backup and restore SD cards is Win32 Disk Imager.
Download it from and install it. BEFORE starting the software, insert your SD card into the SD card reader on your PC. Often this will open the file explorer showing you the contents of part of your SD card, which should look something like this:This is not the whole of the contents of your SD card - only part of the card contents is readable by Windows.
Win32 Disk Imager is a simple disk imaging utility to write IMG files to SD and USB cards and allow booting from these devices. Just point to the IMG file and then select the removable device to write to. Note that this utility is intended for flash media and cannot burn CD-ROMs.
The rest is not readable by your PC.Once you open Win32 Disk Imager, use the blue folder icon to choose the location and the name of the backup you want to take, and then choose the drive letter for your SD card.Click on the Read button. The card will then be backed up to your PC.If you have a problem with your sD card and it becomes unreadable for any reason (e.g. It becomes corrupted), just follow the above instructions, choosing the image you created as the image file, and click on Write to write it back to the SD card. In fact, you can write it back to another SD card of the same size, giving you an exact duplicate. Using OSXInsert the SD Card into a card reader on your Mac. Open Terminal and enter the following command to locate your SD Card: diskutil listAll your disks will be listed, and will look something like below:Look for your SD card by looking for a disk of the right size and name.
In the above example, the SD Card is /dev/disk1.Next, in Terminal, enter the following command to create a disc image (.dmg) of your SD Card in your home directory. Sudo dd if=/dev/disk1 of=/SDCardBackup.dmgWait until the SD card has been completely read; the command does not show any feedback, so wait for the command prompt to reappear in the terminal window once it is complete.Again, if you corrupt your SD card or need to make a copy at any time, you can restore it by following the same approach as above to locate your SD card.
Before you can write to the card you have to 'unmount' it so that the operating system does not try to write to it at the same time.
Fix a USB flash drive after use by Win32 Disk ImagerThis short article provides instructions on how to recover the full capacity of a USB flash drive following use with the Win32 Disk Imager software.Fix instructionsWin32 Disk Imager is a great tool for taking an ISO disc image and writing it to a USB flash drive so that you can install an Operating System such as Linux on another PC without needing an optical drive or to waste a DVDR disc. However, one disadvantge with using this tool is that it tends to mess up the USB flash drive.