20

I want to make a back up of my raspberry pi because I have done a lot of work and repeating the process would take a lot of time. How does one go about making an image of a Raspberry Pi SD card for the following operating systems:

  • Windows
  • Linux
  • macOS

A step by step guide would be very helpful!

ob1
  • 489
  • 1
  • 3
  • 13

3 Answers3

26

On Linux or OSX I use dd to make a backup from SD card. Reverse if and of (i.e. to where they point - source and destination) afterwards to restore, but be careful not to restore to a wrong disk. It will be destroyed without a warning!!!

First use fdisk to get the device id of you SD card (check the size)

fdisk -l

then I use dd to make a diskimage (change /dev/sdb with what you found with fdisk -l):

dd bs=4M if=/dev/sdb of=image1-`date +%d%m%y`.img

or this to make a compressed imag:

dd bs=4M if=/dev/sdb | gzip > image1-`date +%d%m%y`.img.gz

on OSX find device with:

diskutil list

then dd with something like if=/dev/rdisk1 (the 'r' in rdisk1 stands for raw which is faster)

On OSX you can also use 'Disk Utility'

by making a crontab like this it will give you a status every minute:

* * * * * /usr/bin/pkill -USR1 -x dd
Greenonline
  • 2,969
  • 5
  • 27
  • 38
zarvox
  • 371
  • 1
  • 3
  • 6
16

I recently had to make a backup image for my Raspberry Pi 3 Model B and found an incredibly helpful guide from Beebom.

The guide outlines the process for cloning and restoring a Pi SD image for all three operating systems. (Windows - Linux - MacOS). For this detailed and helpful guide visit:

How to Clone Raspberry Pi SD Card on Windows, Linux and macOS

Terry
  • 103
  • 3
ob1
  • 489
  • 1
  • 3
  • 13
0

There exists a backup tool for Raspberries called raspiBackup. If you restore this backup on a different SD card you're actually cloning your Raspberry.

framp
  • 896
  • 7
  • 17