Raspberry Pi Tips

Backup RaspPi Data

Raspberry Pi 3 Model B V1.2

$ cat /etc/debian_version

This article is for explaining how to backup Raspberry Pi data to Mac.

1: Pull off SD card from Raspberry Pi(after shutdown Raspberry Pi)

2: Insert SD card into Macbook Pro using adapter device and run following command from terminal.

  $ diskutil list  
  /dev/disk2 (external, physical):
      #:                       TYPE NAME                    SIZE       IDENTIFIER
      0:     FDisk_partition_scheme                        *15.9 GB    disk2
      1:             Windows_FAT_16 boot                    45.2 MB    disk2s1
      2:                      Linux                         15.9 GB    disk2s2

3: Unmount the disk of SD card for backup

  $ diskutil umountDisk /dev/disk2
  Unmount of all volumes on disk2 was successful

4: Backup Data using dd command (dd if="disk name" of="backup file" bs="buffering size"). This command takes around 30 miniutes in case of 16GB SD card.

  $ sudo dd if=/dev/disk2 of=~/RaspPi/backup/raspi-backup.img bs=1m
  15193+1 records in
  15193+1 records out
  15931539456 bytes transferred in 2752.699622 secs (5787605 bytes/sec)

Refs: Raspberry Pi Backup Restore for Mac(Japanese blog)