First install of the Raspberry Pi

I finally got my Raspberry Pi, the highly sought after $35 computer.  This live-blog will document my installation process on a 2009 MacBook Pro.

  • Hardware setup was pretty straight forward.  I used a HDMI to DVI cable to attach the Raspberry Pi to a spare monitor, and plugged an ethernet cable between my Pi and my Time Capsule internet router.  I had a spare USB to USB-Mirco cable left over from an old digital camera, and plugged that into an old iPhone power adaptor’s USB port.  Raspberry Pi recommends at least 700 mAmps at 5Volts.  The iPhone power adaptor will handle 1 Amp, so it will work fine.  The iPad’s power adaptor will handle 2 Amps, which is even better.  If I ever plug in a WiFi dongle to the Raspberry Pi, I will definitely want to switch to an iPad adaptor.
  • Download Linux image from the Raspberry Pi Downloads page.  I downloaded the Debian version, since that’s the distro that’s most supported by Raspberry Pi at the moment.  I may switch over to the Arch Linux distro at a later time, as it’s a bit leaner.  Unzip the image by double clicking.
  • Stick SD Card into the MacBook’s SD card reader. The first card I stuck in was read-only, despite my double-checking that the write lock on the SD card was off.  After Googling around, I discovered that many people have had trouble with a MacBook’s card reader not recognizing the write lock unless it’s moved halfway between locked and unlocked.  This advice inexplicably worked for me, and I was able to write to the SD card.
  • Open up the terminal app.  Everything else will be done on the terminal.
  • (Before you try, just know that OSX’s Disk Utility app won’t work, so don’t bother trying.)
  • run “df -h” on the command line.

chris3000-MBP:~ chris$ df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s2 432Gi 225Gi 207Gi 52% /
devfs 202Ki 202Ki 0Bi 100% /dev
map auto_home 0Bi 0Bi 0Bi 100% /home
/dev/disk10s2 930Gi 655Gi 274Gi 71% /Volumes/Time Machine Backups
/dev/disk4s1 7.5Gi 27Mi 47Mi 37% /Volumes/NO NAME
  • Look for the line that has the name of your SD card, which is probably “NO NAME” .  Confirm that the drive has a size that’s approximately the same size as the SD card.  It’s important to be extra sure you’re accurately picking the right line, because we’ll soon erase that drive and replace it with the Raspberry Pi operating system.
  • On my machine the SD card is at /dev/disk4s1.  Your machine is probably different, so for your install, replace “/dev/disk4s1” in my notes with your disk location.
  • Become root for the rest of the installation by running “sudo bash” on the terminal.
  • Unmount the disk my running “diskutil unmount /dev/your-disk-location”, replacing “your-disk-location” with the path to the SD Card.  For Example, on my machine I ran “diskutil unmount /dev/disk4s1”.
  • Run “dd bs=1m if=/path/to/debian6-some-date/debian6-some-date.img of=/dev/your-disk-location”, substituting your path to the debian distro and the location of your SD disk.  You’ll need to slightly modify the disk location by adding “r” in front of “disk”, and removing the “s1”.  For example, “/dev/disk4s1” becomes “dev/rdisk4”.
  • If the SD card is unmounted, remove it from the reader, and plug it back in again.  change directories into the SD card.  For example, if the name of the card is “NO NAME”, then run “cd /Volumes/NO\ NAME”
  • run “ls -al” and remove any file or directory that has a “.” at the beginning by running “rm -rf .the-file” and replacing “the-file” with the actual files.  These hidden files are added to the disk by OSX and could interfere with the boot process of the Raspberry Pi.  On my machine, there are two directories that I need to delete: “.Trashes” and “.fseventd”.
  • I’m including my terminal commands below as a reference.  DO NOT copy and paste the commands directly from my output, as that will run the risk of deleting a drive other than your SD card.
sudo bash
df -h
diskutil unmount /dev/disk4s1
dd bs=1m if=/Users/chris/Downloads/debian6-19-04-2012/debian6-19-04-2012.img of=/dev/rdisk4
cd /Volumes/NO\ NAME
rm -rf .Trashes/
rm -rf .fseventsd/

Eject the SD card and plug it into the bottom of the Raspberry Pi. Once you plug in your keyboard, HDMI Cable, and MicroUSB Power cable, then the Pi should start the boot process. After about a minute or so, the Pi will reboot and you should be greeted with the Raspberry Pi Login (username: pi, password: raspberry on the debian distro).