Updated on January 5, 2020
Backup Your Robot Software Regularly
Whenever you get a new robot, or make major changes to the configuration, it’s a good idea to make a backup of the software.
It’s an important step that will allow you to restore to a known good state, in case there is any difficult to resolve configuration problem, or if the SD card that holds the software gets corrupted. One of the best and most reliable methods is to simply make a copy of the entire SD card. You can do this by purchasing a similar card (the closer the better).
The card we use on Mini-Turty is the SanDisk Ultra 16GB Ultra Micro SDHC UHS-I/Class 10. You could easily find one online.
How To Backup Your SD Card
To make a copy:
1. Begin by shutting down your robot, switching it off, and then carefully removing the SD card from the Raspberry Pi board
2. Insert the card into a Linux PC with sufficient disk space (you’ll need at least 4 GB)
3. Check which device your SD card is mounted to, by typing:
The last two lines show the SD card (in our case, yours may differ), which is mounted as ‘/dev/sdb1’ and ‘/dev/sdb2’.
For additional information and confirmation, directly after you inserted the SD card, you could also type:
dmesg | tail
Again, this shows that the card was mounted as sdb1 and sdb2. There are two mount points because there are two partitions on the SD card (the boot partition and the Linux partition).
4. Unmount the SD card, by typing:
The above is just an example. Your SD card may appear as a different device.
5. Begin the copy from the SD card to the PC, by running the following command:
sudo dd if=/dev/sdb of=mini_turty2.img bs=4M count=5000
Be careful to get the above command right, because it could corrupt your PC if you accidentally modify the PC HDD. Be patient. The above command will take a long time to complete, and it may look as if nothing is happening. Also, you may need to adjust the parameters to suit your system (eg. your SD card might appear as ‘sdc’).
6. Once the copy to the PC is completed, remove the original SD card and insert the new card.
7. Now copy from the PC to the new card by typing:
sudo dd if=mini_turty2.img of=/dev/sdb bs=4M count=5000
When the copy is completed, reboot your robot with the new card to confirm that your backup card is working.
We’ll cover another method to backup your robot software on a Windows-based system in a later post.