Linux: Cloning SD Card

From Catatan IBM
Jump to navigation Jump to search

For a Raspberry Pi with many data or even critical data, it’s a good practice to create an image of the entire storage.

  • on Windows, Win32 Disk Imager is the best tool to do this.
  • On Linux, the dd command can do this.
  • And on macOS, ApplePi Baker is the best choice for a graphical solution.

Recommended USB card reader: https://geni.us/l7m7

Linux commands

Device list:

sudo fdisk -l

Read: (clone sd card / hdd / ssd TO image)

sudo dd bs=4M if=/dev/sda of=/home/piyourimage.img

Write: (Restore image TO sd card / hardisk / ssd)

sudo dd bs=4M if=/home/pi/yourimage.img of=/dev/sda