Raspberry SD Card backups

Raspberry SD Card backups

My Raspberry 4 operates on a SD card. The SD cards will burn out (sooner or later).
The following command creates a backup onto an identical SD card

sudo dd if=/dev/mmcblk0 of=/dev/sda bs=1M

This command creates a physical copy of the raw device. It doesn't know about file systems and partitions!
This command gets executed with root privilege it can create severe damage if the target will be incorrect. Check the following things upfront:

  • There is a second SD card with the same size attached. Most likely through USB. It doesn't matter whether the SD card is mounted or not. The original file system will be destroyed.
  • The target USB SD card should be on /dev/sda
  • It reads from /dev/mmcblk0
holodoctor Wed, 08/31/2022 - 12:46