How to write Raspbian OS image file to SD cards on Apple macOS / OS X

www.laut‮rut‬i.com
How to write Raspbian OS image file to SD cards on Apple macOS / OS X

To write a Raspbian OS image file to an SD card on macOS or OS X, you will need to follow these steps:

  1. Download the Raspbian OS image file. Download the Raspbian OS image file from the Raspberry Pi website or a mirror site. The image file will have a .img extension.

  2. Insert the SD card into your computer. Make sure to use an SD card that is large enough to hold the Raspbian image.

  3. Find the device name of the SD card. Use the diskutil list command to list the disks on your system, and find the device name of the SD card. The device name will be in the form /dev/diskX, where X is a number. Make sure to note the device name, as you will need it in the next step.

  4. Unmount the SD card. Before you can write the image to the SD card, you need to unmount it. To unmount the SD card, use the diskutil unmountDisk command, specifying the device name of the SD card as an argument.

For example, if the device name of the SD card is /dev/disk2, you can unmount it using the following command:

diskutil unmountDisk /dev/disk2
  1. Write the image to the SD card. Use the dd command to write the image to the SD card. Specify the path to the image file as the input file, and the device name of the SD card as the output file.

For example, to write the Raspbian image raspbian.img to the SD card /dev/disk2, you can use the following command:

sudo dd if=raspbian.img of=/dev/disk2 bs=1m

This will write the image to the SD card. The bs option specifies the block size, which can improve the performance of the dd command.

  1. Eject the SD card. After the image has been written to the SD card, you can eject it using the diskutil eject command:
diskutil eject /dev/disk2

You can then remove the SD card from your computer, and use it to boot your Raspberry Pi.

Created Time:2017-10-29 22:08:41  Author:lautturi