Tuesday, August 25, 2015

Step by Step Raspbian Installation on Raspberry Pi 2 using OS X Yosemite

Step by Step Raspbian (2015-05-05 Debian Wheezy) Installation on Raspberry Pi 2 Model B using OS X Yosemite


Download Raspbian
Download Raspbian image from Raspberry.org Downloads page

Verify downloaded Raspbian Image
Verify checksum of downloaded Raspbian image, it should match the SHA-1 from rasberrypi.org website. Open Terminal and execute openssl sha1 [path to image] command.

$ openssl sha1 2015-05-05-raspbian-wheezy.zip

SHA1(2015-05-05-raspbian-wheezy.zip)= cb799af077930ff7cbcfaa251b4c6e25b11483de




Extract image from the Raspbian ZIP file
Open Terminal, extract Raspbian image via unzip command

$ unzip 2015-05-05-raspbian-wheezy.zip
Archive:  2015-05-05-raspbian-wheezy.zip   
  inflating: 2015-05-05-raspbian-wheezy.img




Format microSD Card
1. Insert the MicroSD card into Standard SD Card adapter





















2. Insert the SD Card into the SD Card Slot of your OS X Machine. SD Card will be mounted automatically.
















3. Open Disk Utility, select the SD Card from the listed drives and click the Erase tab.  Define a name for the partition in the Name field. Erase SD Card using MS-DOS (FAT) Format by clicking the Erase.. button.

Determine the BSD Name

Option 1 via Disk Utility. After erasing/formatting the SD Card, select the newly formatted/erased partition and click First Aid tab. Make sure the Show details is checked and then click Verify Disk button. Take note of the lines of text that appear and look for something like /dev/diskxx. Taken from the example below its ** /dev/rdisk2s1 .



Option 2 via Command line. Open Terminal, issue "df -h" command from the console. Take note of the SD device highlighted below e.g. /dev/disk2s1
 
$ df -h
 
Filesystem      Size   Used  Avail Capacity   iused    ifree %iused  Mounted on
/dev/disk1     465Gi  381Gi   83Gi    83% 100065414 21739407   82%   /
devfs          186Ki  186Ki    0Bi   100%       644        0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%         0        0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%         0        0  100%   /home
/dev/disk2s1    15Gi  2.3Mi   15Gi     1%         0        0  100%   /Volumes/UNTITLED



Using the device name of the partition determine the raw device name for the entire disk, by omitting the final "s1" and replacing "disk" with "rdisk" e.g. the BSD for the /dev/disk2s1 is /dev/rdisk2


Unmount the SD Card partition
Open Terminal, unmount the SD card partition (NOTE: do not Eject) using diskutil unmount command

$ sudo diskutil unmount /dev/disk2s1
Password:*
 

Volume UNTITLED on disk2s1 unmounted


Write Raspbian image to SD Card
Open Terminal, issue the dd command to convert and copy image to raw device. Take note of the correct raw disk device name e.g /dev/disk2s1 => /dev/rdisk2, /dev/disk3s1 => /dev/rdisk3..

$ sudo dd bs=1m if=2015-05-05-raspbian-wheezy.img of=/dev/rdisk2
Password:
 

3125+0 records in
3125+0 records out
3276800000 bytes transferred in 252.814853 secs (12961264 bytes/sec)




Eject SD Card
After the dd command finishes, eject the SD Card

$ sudo diskutil eject /dev/disk2
Password:
 

Disk /dev/disk2 ejected


Install Raspbian
Insert SD card into Raspberry Pi, plug-in device and follow installation instructions.