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
  • 459
  • 1
  • 3
  • 13

3 Answers3

25

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,740
  • 4
  • 23
  • 36
zarvox
  • 361
  • 1
  • 3
  • 6
13

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
  • 459
  • 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
  • 910
  • 7
  • 17
  • I have no clue why the link doesn't work for you. The URL is valid. You can visit https://raspibackup.linux-tips-and-tricks.de to get a quick overview about raspiBackup. Next I suggest to use your favourite search engine and search for raspiBackup. You'll get a lot of hits :-) – framp Dec 14 '23 at 19:16
  • It does now. I've deleted my comment. – tomh Dec 20 '23 at 07:35