Wiki

Wiki

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

SD card Cloning

We have two ways to do it till now:

  • Using Disk Utility

Disk Utility

The disk utility can also be utilized to create the back up or clone of SD card. It is readily availble in ubuntu and doesn't require nay installation. Use this method when the SD card shows error in cloning using clonezilla stating the size of the SD card isn't big enough to contain the image. To create disk image, click the aplication icon, and than search for disk utility.

  • Plug in the card that needs to be cloned (the one which is already configured)

  • Select the SD card and it will show the details of partitions present on the disk. Click on the options (three dots on upper right) to ge the option to create disk image. Clickon create disk image.

  • After selecting to create the disk image, rename to select a proper name to the image file and than click create image. Enter the password if asked for.

  • This will create the disk image that can be used later to restore it on new SD card. After completion of the process, the saved image can be used to be restored on new SD card.

  • USING DD

    • to backup remotely we can use following two commands
#run from remote computer
dd if=/dev/sda | gzip -1 - | ssh user@local dd of=image.gz
# run from local computer
ssh user@remote "dd if=/dev/sda | gzip -1 -" | dd of=image.gz
  • So we wish to clone SD card which is currently on RPI and both are on network then from our computer we can run as following
 sudo ssh ubuntu@192.168.0.230 "sudo dd if=/dev/mmcblk0 | gzip -1 -" | dd of=image.gz
  • using SSH we can do this :

    • ssh ubuntu@192.168.0.230 will give us access to RPI from our local PC
    • "sudo dd if=/dev/mmcblk0 | gzip -1 -" this will compress the RPi SD card with different level
    • Saving directly to present working directory as image.gz
Last updated 2 weeks ago
Was this helpful?
Thanks!