I just installed Raspbian for the second time on my Raspberry Pi (I needed the SD card for my digital camera a while ago…) and had some troubles at first getting the SD card to work on Mac OS because of a “Read-only file system” error. Here’s some instructions, in case you happen to come across the same problem!
- Download Raspbian, the operating system to run your Raspberry Pi. I download the latest version here.
- Unzip the file you’ve just download – you will get a file with the extension .img.
- Make sure the little lock on the SD card is in the “unlocked” position.
- Plug your SD card into your card reader.
- Check if the SD card is writable: Open the “Disk Utility” on your Mac and click the SD card, then go to the “Erase” tab. If the “Erase…” option (see image) is grayed out, the SD card is not writable. Also, if you try to delete or modify any existing files on the SD card, you may receive a “Read-only file system” error.
- I don’t know exactly what causes the “Read only file system” problem, but fortunately I found a solution online:
Plug in the SD card and go to “System Preferences” > “Sharing” on your Mac. Select “File Sharing” and then the little + sign under “Shared Folders”. Here, you can select the SD card (in my case it’s named “CAMERA”) as a shared folder (see image below). The SD card will now be writable! - Close the System Preferences and return to your Terminal. I got the following instructions from Dag-Inge Aas’ website.
- Change into the directory where you have downloaded and unzipped the Raspbian image. In my case I saved the file in “Downloads”:
cd ~/Downloads - Identify the device name of the SD card by typing:
df -h - The device name will probably be something like disk1s1 or disk2s1. Then unmount the disk, using the SD card’s device name if it is different from “disk1s1”:
sudo diskutil unmount /dev/disk1s1 - And finally, install the disk image file to the SD card. Make sure the raw disk name, that is the “rdisk1” at the end, is right. It will be rdisk1, rdisk2, etc. depending on the device name above:
sudo dd bs=1m if=2012-12-16-wheezy-raspbian.img of=/dev/rdisk1 - Wait for a few minutes until the image is installed on the SD card. You will then see a message right at the end.
- Eject the SD card, plug it into your Raspberry Pi, and off you go!