Zet een image op SD via CLI

Command line

  • Open a terminal, then run:

    diskutil list

  • Identify the disk (not the partition) of your SD card, e.g. disk4, not disk4s1.
  • Unmount your SD card by using the disk identifier, to prepare it for copying data:

    diskutil unmountDisk /dev/disk<disk# from diskutil>

    where disk is your BSD name e.g. diskutil unmountDisk /dev/disk4

  • Copy the data to your SD card:

    sudo dd bs=1m if=image.img of=/dev/rdisk<disk# from diskutil> conv=sync

    where disk is your BSD name e.g. sudo dd bs=1m if=2018-04-18-raspbian-stretch.img of=/dev/rdisk4 conv=sync

    • This may result in a dd: invalid number '1m' error if you have GNU coreutils installed. In that case, you need to use a block size of 1M in the bs= section, as follows:

      sudo dd bs=1M if=image.img of=/dev/rdisk<disk# from diskutil> conv=sync

    This will take a few minutes, depending on the image file size. You can check the progress by sending a SIGINFO signal (press Ctrl+T).

    • If this command still fails, try using disk instead of rdisk, for example:
      sudo dd bs=1m if=2018-04-18-raspbian-stretch.img of=/dev/disk4 conv=sync

      or

      sudo dd bs=1M if=2018-04-18-raspbian-stretch.img of=/dev/disk4 conv=sync