Saturday, August 17, 2024

how to clone a pi using dd

# Identify SD card device
lsblk

# Unmount SD card (example for /dev/sdX1)
sudo umount /dev/sdX1

# Create an image of the SD card
sudo dd if=/dev/sdX of=~/raspberry_pi_backup.img bs=4M status=progress

# Verify image integrity (optional)
md5sum /dev/sdX | tee /tmp/original_md5sum.txt
md5sum ~/raspberry_pi_backup.img

# Write image to a new SD card
sudo dd if=~/raspberry_pi_backup.img of=/dev/sdX bs=4M status=progress

# Sync and eject
sudo sync

No comments:

Post a Comment