3. Writing Raspbian to an SD Card
19 Jan 2018Note: this information is very similar to the information on this page.
download the Raspbian jessie lite image I prepared for the class (it's called
sc_raspbian_stretch_01152018.img.gz
) from dropbox to your computer (look for the link via email)download and install the
SDFormatter
from hereplug your
microSD
card into anSD
card adapter and insert into your laptopopen
SDFormatter
, which should automatically identify yourSD
card, and selectOverwrite Format
, then click theFormat
button. After a while the application will tell you that it is done erasing all data from theSD
cardwith
SD
card plugged in to your computer enterdiskutil list
in the terminal to locate the 8GB SD cardexample output:
/dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *500.3 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_CoreStorage HD 499.4 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 /dev/disk1 (internal, virtual): #: TYPE NAME SIZE IDENTIFIER 0: Apple_HFS HD +499.0 GB disk1 Logical Volume on disk0s2 F0EE8AE2-966C-4461-8AB7-DAC4A66164B5 Unencrypted /dev/disk2 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *8.0 GB disk2 1: Windows_FAT_16 RECOVERY 1.2 GB disk2s1 2: Linux 33.6 MB disk2s5 3: Windows_FAT_32 boot 66.1 MB disk2s6 4: Linux 6.7 GB disk2s7
unmount the
SD
card so we can do write our new image to it by entering the following command into the terminal:diskutil unmountDisk /dev/disk<disk# from diskutil>
for example:
diskutil unmountDisk /dev/disk2
next, uncompress and copy the data from the
.img.gz
file to yourSD
card by entering the following in the terminal:gunzip --stdout nameofimage.img.gz | sudo dd bs=1m of=/dev/disk2
for example:
gunzip --stdout rpi_fieldwork.img.gz | sudo dd bs=1m of=/dev/disk2
this takes a VERY LONG TIME, so go get a cup of coffee or take a walk or something.
Eventually you should see something like this in the terminal confirming that
dd
is done writing the.img
file to theSD
card:3833+0 records in 3833+0 records out 4019191808 bytes transferred in 1642.354445 secs (2447213 bytes/sec)
eject the
SD
card from your computer with the following command:sudo diskutil eject /dev/disk2
put the
SD
card into your pi, plug power cable in, and confirm that it boots up (if theACT
LED is flashing green than it has successfully booted up)