Saving or cloning the SD board of a Raspberry Pi mini-PC (Orange Pi, Odroid …) is an essential maintenance operation to be carried out regularly. Do not hesitate to clone the SD board before each upgrade or upgrade of the Linux distribution. To make Raspberry Pi so economical, many compromises had to be made. There is no power button and shut down, and storage is entrusted to an SD board usually used for recording photos or video on digital cameras or cameras. An SD board costs almost nothing but it is best to choose it carefully and take care of it. At all, it’s all your hobby work that’s stored on it. Here’s how to make backups from Raspbian, Windows and
Mac OS macOS.
Make a backup from Raspbian Jessie
Raspbian Jessie now includes a useful backup utility called SD Card Copier which is found in the Accessories Menu. Use a USB SD board reader to connect the board on which you want to make a clone of backup. The internal drive contains the board (Internal SD Card) on which we start the Raspberry (can’t write on this target by security).
Restore a backup on Raspbian Jessie
It is possible to restore an old backup. To do this, simply start Raspbian from the copy on the new board present in the USB drive backup board. The Foundation offers however no guarantee on the operation of the procedure on the other distros that NOOBS.
The most well-known (and free) utility on Windows, and Win32 Disk Imager . You can download and install it from the SourceForge site at this address. After installing Win32DiskImager, insert your SD board into the reader.
Click the icon in the form of tree to the right of the entry of the path field. Specify a path and a file name for the backup (it will have the img extension). Finally click on Read to start the backup.
Restore a backup on Windows
Win32DiskImager will allow us to perform the reverse operation disaster.
Start show the path of the backup image by opening the file picker. If you don’t have a single board plugged in SD, it is selected automatically. Finally press Write to start the restore.
On macOS, you have to go through the command Terminal. Open the Terminal and insert the board into the SD reader, then run the following command
All the drives connected to your Mac are listed by this command. It just only to find the path to the SD board. In my case it is/dev/disk3
With the following command, we will create an image of the disc to the format dmg (Mac OS Classic). Don’t forget to replace the path with one that corresponds to your SD board.
sudo dd if=/dev/disk3 of=~/sauvegardeCarteSD.dmg
The operation takes some time (depending on the size of the SD board to save). The SD board image was created at the root of your account under the name sauvegardeCarteSD.dmg.
You can let Time Machine put in a safe place your backup on your Time Capsule now. Before removing the SD board in the reader remember to eject it from the Finder, or using the command
Restore a backup
To restore a backup, we always use the dd command, but this time, we reverse the source and the destination that gives
sudo dd if=~/sauvegardeCarteSD.dmg of=/dev/disk3
Do not forget to change the path of your file backup and the SD board.
Some tips to avoid disasters
The advantage of using an SD board to operate Raspbian and the very low blow of this storage compared to a typical hard drive or an SSD. For daily use, a SD board is almost as fast as an SSD. After all, the Raspberry Pi is not designed to play. Be that as it may, here are three commands to apply:
Choose a quality SD board
Banish noname SD boards. Don’t hesitate to spend a few extra euros for a board from a manufacturer recognized in (SanDisk, Samsung, Kingston…). choose a board very fast (guarantee of performance of your RPI), at least class 10.
Stop RPI before unplugg the SD board
Never remove the SD Card without having stopped the system (and waited the full stop up to the black screen…). Indeed, the system writes permanently on temporary files, a sudden stop can corrupt the board and make it unusable. Unlike a typical hard drive, it is possible to restore bad sectors.
Under Raspbian, go to Menu then Shutdown . From the Terminal or SSH, run
Similarly if you use the SD board on a different computer, remember to eject (or disconnect) the board before you remove it from the computer.
Make regular backups
Normally, you should have everything you need to do stress more you with your SD board. If I forgot to mention a solution, comments are there for that.
- Waveshare launches two Raspberry Pi 400 + 7″ or 13.3″ touchscreen bundles
- Motorized microscope with HQ camera for Raspberry Pi and HTML interface (Python)
- Drive a Nema 17 stepper motor with the RpiMotorLib Python library for A4988
- Open an HTML page when starting Raspberry Pi OS with Chromium Browser in full screen (kiosk mode)
- Pi Imager and the configuration wizard simplify the installation of Raspberry Pi OS (old Raspbian)
- New Raspberry Pi 3 Model B+ 2018 @1.4GHz, Gigabit Ethernet, Ethernet POE Daughter Card, Flash Sale at $49.99 on Gearbest