Create and restore a Backup of a complete data carrier
The best way to backup the Raspberry Pi is to create an image of the entire SD card.
This is best done with the tool dd (/dev/sdb is the volume to be backed up).
The command is as follows:
sudo dd if=/dev/sdb of=/home/Dokumente/Backup.img bs=1M && sync
Restore the disk from the image with dd
Restore the disk from the image with dd
First, clean up the destination drive:
sudo dd if=/dev/urandom of=/dev/sdb bs=1M && sync
Then play back the image:
sudo dd if=Backup.img of=/dev/sdb bs=1M && sync