-1

Because I have installed a bunch of things for a larger project on my Raspberry Pi 3 Model B, I would like to backup the entire (bootable) SD card on my Mac.

I tried to insert the SD card into my Mac and subsequently copy the whole SD card image using sudo dd bs=4m if=/dev/sdb of=raspbian.img, as specified in: https://www.raspberrypi.org/documentation/linux/filesystem/backup.md

However, when I plug the SD card into my Mac (running the latest OS), it tells me it cannot read the medium and gives me 3 options: Initialize... | Ignore | Eject.

I tried clicking "Ignore" and ran the command sudo dd bs=4m if=/dev/sdb of=raspbian.img, while I replaced the if path correctly (using "disk2" instead). It then tells me that there is an input/output error.

The SD card is booting up my Raspberry Pi completely ok, however, so I do not think it is corrupted.

  1. Is it safe to let my Mac "Initialize..." the SD card and will this help me to back it up?

  2. How can I back up the SD card in this scenario without losing the current state of it?

Help on this would be very much appreciated.

  • You didn't specify a size. If the error is at the end of the SD-Card than this can be perfectly fine. It is just telling you that it ran to the end of media at a given address/offset. It would have been nice to put the actual output of `dd` in the question. – kwasmich Jun 18 '20 at 06:15

1 Answers1

0

It is unclear from your question what you actually did - "follow these instructions" leaves us to wonder if the instructions are wrong or you didn't follow them, although in this case the instructions DO NOT cover use of a Mac.

I use the following

https://raspberrypi.stackexchange.com/a/72047/8697

DO NOT initialize (sic) i.e. ERASE the card if you want to keep the contents.

PS I always check using diskutil list to see what is mounted, and the script includes this as an extra check.

Milliways
  • 54,718
  • 26
  • 92
  • 182
  • Thank you for the answer. The instructions say that they would work for a Mac by replacing "4M" with "4m". Sorry about being unclear about what I did, I edited the question accordingly. – raspberry_bc Jun 20 '18 at 12:53
  • @raspberry_bc the instructions neglect to mention the need to eject the card before copy and that unless raw disk mode is used the copy can be glacially slow - although this is worse on write (it can take hours to write a 16G card) – Milliways Jun 20 '18 at 13:00
  • Unfortunately, also ejecting the card before copy did not help. Although the script you proposed might be working, I would really like to get the "standard" way as described in the tutorial working first. Thank you! – raspberry_bc Jun 20 '18 at 13:13
  • @raspberry_bc My script is the "standard" way - using raw disk mode, as recommended by most and is done by this line `time sudo dd if=/dev/r$DSK bs=4m | gzip -9 > $OUTDIR/Piback.img.gz` Most of the rest is just error checking to stop you making mistakes (I once overwrote one of my Time Machine backups). macOS is very particular about formatting - there is probably some error on your card, but `dd` will copy it regardless. – Milliways Jun 21 '18 at 00:42