Monday, December 8, 2014

Ceph Pi - Making Pi ( With A Mac )

This article describes getting Rasberry Pi B+ loaded with Linux and booted.  I used the NOOBS packaging of the Raspbian distro (a Debian Wheezy packaged up with the extra proprietary binary packages that make the Rasberry Pi B+ work).  As of this writing this writing in December 2014, that is the latest stable.

The Raspberry Pi B+ takes Micro SD cards.  It does not come with one, so make sure you buy/order it together with the Pi.  Its really helpful to get one with a full size SD adapter or a USB key that can take a MicroSD.  Otherwise loading the software from your Mac can be awkward.


  1. Download the image from www.raspberrypi.org.  I chose the NOOBS image for Offline and Network Install.  I am personally a fan of using BitTorrent for the download, since I usually get much better throughput.

  2. Even as you wait for the download to complete, its time to start formatting the SD card.  It does not matter if it is brand new (I tried skipping this step to no avail). This takes a long time (in the 10 minute range) so prepare mentally.  Download the SD Formatter application and install it.

  3. Open SD Formatter and choose your SD Card in the top drop down.  Also make sure you choose the Overwrite Format (again - I tried to skimp, but nada).  You should probably also give your card a name, but that is up to you.

    Go have some tea or coffee or reddit.

  4. When the download of NOOBS ends, unpack it by double clicking on the zip file.  A new directory will appear with a similar name.  Double click on it to enter the directory.  Select all entries in the directory and copy them to the SD card.

  5. When the copy ends, make sure you properly eject the SD card by clicking the little eject button next to it in Finder before you yank it out.

  6. Make sure the Raspberry Pi is not connected to power.  Make sure the HDMI cable is connected to a display.  Put the MicroSD card in its slot and connect the power cable.

  7. NOOBS will launch into a graphical installer, giving you a menu of different OS flavors to install.  Choose Rasbian and continue through the install.  The card you used will be erased and formatted with the OS you chose.  When the install is done, the Pi will reboot.

  8. Upon reboot, you will land in the Raspberry config tool raspi-config.  Use this chance to change the default password.  The default credentials are user: pi   password: raspberry

  9. Go to Advanced Options and choose Hostname.  Set the hostname for this unit.  When building a cluster it helps to have the Pis clearly enumerated.  

  10. Go to Advanced Options again and choose Memory Split.  Since we won't be running any graphically intense applications, set the GPU allocation to 32MB.  (I tried 16, but even after a reboot, the setting did not take.  It seems 32 is the minimum viable setting).
  11. Exit raspi-config.  You are done.  It may take a reboot for the memory setting to take effect, but this part is over.
At this point of time, I went into my router and in DHCP settings assigned a static lease to each of my 3 Pis.  I like this better than a static config, because if I ever go somewhere else, I can still rely on DHCP to get me up and running initially no matter what the local subnets look like.  I also updated the local host file.

This may be a good time run 
sudo apt-get update
sudo apt-get upgrade

Internet sharing with Mac ( WiFi to Ethernet to switch )

Interesting note here for my particular setup.  You need Internet to get updated packages.  I don't have an ethernet jack handy in the room I was working on.  I also did not buy WiFi adapters for the Pis, since I don't intend to connect them non-wirelessly once I deploy them.  What I did was to use my Mac as a wireless bridge. Simply go to System Preferences -> Sharing.  Then on the left hand side under sources, select Internet Sharing and on the right hand side select USB Ethernet or whatever your Ethernet adapter is.  Then just plug your Mac into your switch.  It will be serve up DHCP and act as a NAT gateway.