Raspberry Pi SD Cloning: Difference between revisions

From Wurst-Wasser.net
Jump to navigation Jump to search
(Created page with "This article is about backupping and restoring the SD card of a Pi. == Backup == == Restore == Category:RaspberryPi")
 
No edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article is about backupping and restoring the SD card of a [[Pi]].
This article is about backupping and restoring the SD card of a [[Pi]].
== Installation ==
=== [[Linux]] ===
dd if=/home/h/Downloads/octopi-1.0.0-1.8.7-20230302160739.img of=/dev/mmcblk0 bs=1M
=== [[macOS]] ===
Since the [[Pi]] was running Debian Wheezy (which is AFAIK obsolete) I decided to install [[Raspbian]] Stretch.
* Download it here: https://www.raspberrypi.org/downloads/
I skipped [[NOOBS]] and did the installation myself (with help from https://www.raspberrypi.org/documentation/installation/installing-images/README.md and https://www.raspberrypi.org/documentation/installation/installing-images/mac.md ):
# diskutil list
[…]
/dev/disk5 (external, physical):
  #:                      TYPE NAME                    SIZE      IDENTIFIER
  0:    FDisk_partition_scheme                        *15.8 GB    disk5
  1:            Windows_FAT_32                        58.7 MB    disk5s1
  2:                      Linux                        15.8 GB    disk5s2
# diskutil unmountDisk /dev/disk5
Unmount of all volumes on disk5 was successful
# dd bs=1m if=2019-04-08-raspbian-stretch-lite.img of=/dev/rdisk5 conv=sync
5052+0 records in
5052+0 records out
5297405952 bytes transferred in 486.102151 secs (10897722 bytes/sec)
# diskutil eject /dev/rdisk5
Disk /dev/rdisk5 ejected
#


== Backup ==
== Backup ==
HeiMac:~ root# df -h | grep /Volumes
/dev/<b>disk3s1</b>    56Mi  19Mi  37Mi    34%    /Volumes/Untitled
HeiMac:~ root#


HeiMac:~ root# umount /Volumes/Untitled
HeiMac:~ root# dd if=/dev/<b>rdisk3</b> of=/Users/heiko/Desktop/piBackup.img bs=1m


== Restore ==
== Restore ==
dd if=/Users/heiko/Desktop/piBackup.img of=/dev/rdisk3 bs=1m
umount /Volumes/Untitled
If you restored on a SD card with with higher capacity, remember to use <tt>raspi-config</tt> to expand the filesystem.


----
* More about [[:Category:RaspberryPi|Raspberry Pi]]
* Links
** http://developer-blog.net/en/hardware/raspberry-pi-backup-2/
** http://raspberrypi.stackexchange.com/questions/311/how-do-i-backup-my-raspberry-pi
** http://elinux.org/RPi_Easy_SD_Card_Setup


[[Category:RaspberryPi]]
[[Category:RaspberryPi]]

Latest revision as of 09:26, 22 May 2023

This article is about backupping and restoring the SD card of a Pi.

Installation

Linux

dd if=/home/h/Downloads/octopi-1.0.0-1.8.7-20230302160739.img of=/dev/mmcblk0 bs=1M

macOS

Since the Pi was running Debian Wheezy (which is AFAIK obsolete) I decided to install Raspbian Stretch.

I skipped NOOBS and did the installation myself (with help from https://www.raspberrypi.org/documentation/installation/installing-images/README.md and https://www.raspberrypi.org/documentation/installation/installing-images/mac.md ):

# diskutil list
[…]
/dev/disk5 (external, physical):
  #:                       TYPE NAME                    SIZE       IDENTIFIER
  0:     FDisk_partition_scheme                        *15.8 GB    disk5
  1:             Windows_FAT_32                         58.7 MB    disk5s1
  2:                      Linux                         15.8 GB    disk5s2
# diskutil unmountDisk /dev/disk5
Unmount of all volumes on disk5 was successful
# dd bs=1m if=2019-04-08-raspbian-stretch-lite.img of=/dev/rdisk5 conv=sync
5052+0 records in
5052+0 records out
5297405952 bytes transferred in 486.102151 secs (10897722 bytes/sec)
# diskutil eject /dev/rdisk5
Disk /dev/rdisk5 ejected
#


Backup

HeiMac:~ root# df -h | grep /Volumes
/dev/disk3s1    56Mi   19Mi   37Mi    34%    /Volumes/Untitled
HeiMac:~ root# 
HeiMac:~ root# umount /Volumes/Untitled 
HeiMac:~ root# dd if=/dev/rdisk3 of=/Users/heiko/Desktop/piBackup.img bs=1m

Restore

dd if=/Users/heiko/Desktop/piBackup.img of=/dev/rdisk3 bs=1m
umount /Volumes/Untitled 

If you restored on a SD card with with higher capacity, remember to use raspi-config to expand the filesystem.