Clone and backup your Raspberry SD Cards with dd command

One of the most useful tools in Linux world, especially when you spent zillion hours configuring that perfect setup on your Pi and you don’t want to lose it, is DDTool.

This OS image management tool is not new, but it has become even more relevant since the introduction of Raspberry Pi and its SD cards that contains OS and storage. With dd command you can do the following awesome things.

Before you do anything fancy, insert your Micro SD Card into a USB adapter and plug it into your Linux PC. On a typical Debian/Ubuntu/Mint CLI, check and remember your location of SD card by:

dmesg | tail

Or:

su
fdisk -l

Make sure you don’t get mixed up with your local hard disk, or regret forever. Location of local hard disk usually looks like this:
/dev/sda and an SD card path could be: /dev/sdb

  • Backup an SD card content into a single image file:
    dd if=/dev/sdb of=/home/me/mybackuppath/myRaspbianRobot2016.img bs=2048 conv=noerror,sync
  • Deploy an image file onto SD card from :
    dd if=myRaspbianRobot2016.img of=/dev/sdb bs=4096 conv=noerror
  • Disk wipe, to erase a faulty install or wipe out confidential content:

           dd if=/dev/zero of=/dev/sdb bs=4k

bs = Block size, a unit measuring the number of bytes that are read, written, or converted at one time.

Further reading:

(Visited 1,708 times, 1 visits today)