Saving or cloning the SD card 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 card 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 card usually used for recording photos or video on digital cameras or cameras. An SD card 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 card reader to connect the card on which you want to make a clone of backup. The internal drive contains the card (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 card present in the USB drive backup map. 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 card 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 card 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 card 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 card. 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 card.
sudo dd if=/dev/disk3 of=~/sauvegardeCarteSD.dmg
The operation takes some time (depending on the size of the SD card to save). The SD card 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 card 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 card.
Some tips to avoid disasters
The advantage of using an SD card 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 card 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 card
Banish noname SD cards. Don’t hesitate to spend a few extra euros for a card from a manufacturer recognized in (SanDisk, Samsung, Kingston…). choose a card very fast (guarantee of performance of your RPI), at least class 10.
Stop RPI before unplugg the SD card
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 card 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 card on a different computer, remember to eject (or disconnect) the card 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 card. If I forgot to mention a solution, comments are there for that.
- New Raspberry Pi 3 Model B+ 2018 @1.4GHz, Gigabit Ethernet, Ethernet POE Daughter Card, Flash Sale at $49.99 on Gearbest
- Retrogaming Retropie Mini Console on Raspberry Pi 3 with 3.5 ” HDMI LCD Touch Screen
- #Test LCD 3.5” HDMI touch screen (via GPIO) with acrylic case for Raspberry Pi 3 under Raspbian (480×320 to 1920×1080 pixels)
- Install the Pixel Desktop on Raspbian Stretch Lite. 10 essential software for the Raspberry Pi 3
- Configure VNC on Raspbian to remotely access the Pixel desktop of the Raspberry Pi
- Make a DIY Recalbox or Retropie retro gaming arcade with joystick and 8 buttons for less than €85