Raspberry Pis need to be backed up from time to time. Here we show how to make a backup of a Raspberry Pi's operating system using a disk imager.
Table of contents
Introduction to making a Raspberry Pi backup
This post will show how to make a backup of a Raspberry Pi’s operating system (OS) using a disk imager. The pros and cons of disk images to make backups of Raspberry Pi’s and the requirements will also be discussed.
Pros & cons of using a disk imager to make backups
By using disk imagers to make backups of a Raspberry Pi operating system there are only a few basic steps, it is straightforward and it will work with any Raspberry Pi operating system. Disk imagers make a cloned copy, bit-by-bit and is a very accurate way of storing data on a different medium for later use.
On the downside, this method does come with some flaws. Apart from being manual, the additional hardware and an additional stand-alone/separate PC that is required, the retrieval of a backup image needs a larger-sized SD card. Let’s call it the “ever-expanding image problem” where an 8Gb SD card will need a 16Gb card and a 16Gb will need a 32Gb card etc., etc.
Compared to other ways of making backups, this process is quite SD card intensive from a reading perspective. It should therefore be limited to as needed or once a week, meaning the risk for data loss is greater (compared to other processes which are less intensive and can be done more frequently.) From all the Raspberry Pi backup options available, making cloned copies also takes the longest to complete.
As discussed on the basics of installing a new operating system for your Raspberry Pi, the Raspberry Pi needs some sort of an operating system installed from an .img file to an SD card. This process is basically the reversal of that. This will show how to create a backup copy of the Raspberry Pi operating system as an .img file.
Apart from a SD card reader and a working SD card, the following will also be required:
- A PC already running an operating system (I will be using Microsoft Windows 7) with enough HDD space (attached) to store one or two instances of your Raspberry Pi operating system image. (I recommend at least 3x the size of the SD card being backed up.)
- Win32DiskImager downloaded and installed onto this PC. You can also choose a different disk imager depending on your own operating system.
Using Win32DiskImager to make a backup of a Raspberry Pi
- Remove the SD card from the (switched) off Raspberry Pi, pop it into a SD card reader and then pop it into the PC.
- To create an .img from a SD card, open Win32DiskImager and use the folder button and browse to the directory on your HDD where you want to save the .img file too.
- Type in the complete file name to save the image as (include the .img extension).
- Make sure the correct drive letter of the SD card is selected on the Device drop-down menu.
- Press the Read button (vs. Write button).