Hey! I'm available for hire (and I appreciate tips)  



TL;DR

If you're too lazy to be bothered reading and you're quit familiar with what to do, here's the summary:

WARNING: This section is for people who already know what they're doing. If that's not you, scroll down to the next section.

# Find the SD Card in the disk list
diskutil list

# Unmount
# diskutil unmountDisk /dev/{{your-disk}}
diskutil unmountDisk /dev/disk4

# Wipe the partition
# DANGER: replace disk4 with YOUR disk, or suffer the consequences
# sudo diskutil partitionDisk /dev/{{your-disk}} 1 MBR "Free Space" "%noformat%" 100%
sudo diskutil partitionDisk /dev/disk4 1 MBR "Free Space" "%noformat%" 100%

# write img out to /dev/RDISKx
# sudo dd bs=1m if=/tmp/raspbian.img of=/dev/{{your-disk}}
sudo dd bs=1m if=/tmp/raspbian.img of=/dev/rdisk4

That will take a long time, where "long time" probably means in the realm of 5 minutes.

If it takes more than 15 minutes it's probably because you used /dev/disk4 instead of /dev/rdisk4 and it may never finish.

  1. Use an External SD Card Reader

I've never had success building the sd card using the built-in SD Card reader on my Macbook Pro.

YMMV, but I always use on of those Kingston brand (seems to be the most reliable manufacturer) 37-in-one (or 42-in-one or whatever they're up to these days) USB card readers.

  1. Use decent SD Cards

Not all Class 10+ (UHC) cards are created equal. I'm a fan of the two-tone SanDisk cards (the ones that are half either silver or gold and half red) because they're fast and reliable, but other brand name cards will work well. Don't use off-brand SD cards. It's less expesive to buy 2 working SD cards than 4 that don't, yknow?

Not that the RPi is picky, but I find the discount cards are pretty much the reject cards from the SanDisk factory (and if you google a bit you'll find a few articles on such 'moonlight run' electronics).

  1. Double check the SD write lock

Some cards and micro sd adapters have looser slide locks than others. If the lock slides down during insertion you'll get a bunch of permission errors when you try to format it.

  1. Determine which SD Card to use

Put the card in the slot and determine which thing-ma-bob it is:

Remove any other usb drives and sd cards

diskutil list

Example

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *256.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:          Apple_CoreStorage                         255.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *1.5 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                  Apple_HFS Data                    1.5 TB     disk1s2
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           *254.8 GB   disk2
                                 Logical Volume on disk0s2
                                 4CFE5C28-3488-4770-BE30-4F33FE9535AE
                                 Unlocked Encrypted
/dev/disk4
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *7.9 GB     disk4
   1:                        EFI EFI                     209.7 MB   disk4s1
   2:                  Apple_HFS Install OS X Yosemite   7.6 GB     disk4s2
  • /dev/disk0 650MB Recovery HD
  • /dev/disk1 1.5TB Data (where I put my data)
  • /dev/disk2 255GB Macintosh HD (encrypted)
  • /dev/disk4 7.9GB Install OS X Yosemite (my sd card, previously loaded with an OS X installer).
  1. Prepare SD Card (/dev/diskX)

From the prior command you'll probably discover that your SD card is /dev/disk3 or perhaps /dev/disk2.

Just make sure GBs match and the name isn't Macintosh HD and you'll probably be okay.

# Unmount the card
# diskutil unmountDisk /dev/{{your-disk}}
diskutil unmountDisk /dev/disk4

# wipe the partition
# DANGER: replace disk4 with YOUR disk, or suffer the consequences
# sudo diskutil partitionDisk /dev/{{your-disk}} 1 MBR "Free Space" "%noformat%" 100%
sudo diskutil partitionDisk /dev/disk4 1 MBR "Free Space" "%noformat%" 100%
  1. diskN vs rdiskN

If you want this process to take only a few minutes, use /dev/rdiskX.

If you'd prefer it to take hours, use /dev/diskX instead (meaning, don't use /dev/diskX).

Other than that, I don't know what the difference between the two is. Linux doesn't behave this way - just OS X.

Download the Raspbian image (or whatever) directly from the Raspberry Pi website, or download it from me: 2015-01-31-raspbian.zip.torrent. If you're downloading from me, you'll need Transmission (or some other torrent client).

Note: In case you're unfamiliar: torrent: is a protocol, just like https://, that allows you to download files. And it allows you to do it very fast for very large files, which is why many people use it to download movies. torrent: is good but, just like computers and the internet itself, some people use it for less-than-good purposes.

# Get your user name
whoami

# Copy your download to /tmp
# Example: rsync -av /Users/{{whoami}}/Downloads/{{SOME-VERSION}}-raspbian.img /tmp/raspbian.img
rsync -av ~/Downloads/2015-01-31-raspbian.img /tmp/raspbian.img

# DANGER: replace rdisk4 with YOUR rdisk, or suffer the consequences
# Example: sudo dd bs=1m if=/tmp/raspbian.img of=/dev/{{your-RDISK}}
sudo dd bs=1m if=/tmp/raspbian.img of=/dev/rdisk4
# NOTE: rdisk, not disk
  1. Enjoy your spoils

Wait until Terminal gives you a message like this:

Then wait a little bit longer until the blinky light goes back to solid or off (whatever your SD card does when it's not in use).

Then, just to be safe eject the disk before unplugging.

# Unmount
# diskutil unmountDisk /dev/{{your-disk}}
diskutil unmountDisk /dev/disk4
  1. Uninitialized Disk

If you get some Error message from OS X about how the disk is in the wrong format, ignore it. Most of the disk is in a Linux format, which OS X can't read (and doesn't need to).

  1. Happy Pi-ing

Now go put the card in your pi and boot it up connected to your network.

The pi will give itself the name raspberrypi.local (like .com, but for your network only).

ssh pi@raspberrypi
# the password is 'raspberry'

CHANGE THE PASSWORD and then continue with the rest of the configuration options.

raspi-config

By AJ ONeal

Was this useful to you? Share it!

Also, you can give me a tip or hire me.


Published

2015-2-5

Categories


Tags