Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Monday, 29 April 2013

Formatting SD Card with a Mac

Normally before I re-install Linux onto an SD Card for my Raspberry Pi I reformat the SD Card. This also has the added advantage of returning the SD Card to the state it was in before putting Linux on there, which allows me to use it for other things. Although this is an easy thing to do, it did take me a while to figure out how, so I thought it worth sharing.

So how to you reformat it using an Apple Mac?

First you need to load Disk Utility. To do this click on the Applications folder, and chose Utilities.




Within Utilities select Disk Utility.




Now plug the SD card you want to format into a USB SD Card reader and plug this into a USB port on the mac.

You should see this SD Card appear in the left hand window. Take care with the next step, as you could lose valuable data if you format the wrong thing! I normally tell by checking the size of the disk. My SD Card is 8GB, so it should be fairly obvious which one it is.

You need to Right Click on this disk in the left hand column, then select 'Erase', with the left button, from the menu which appears.





You now have the option to change the Format of the SD Card and to rename the card if you require. Leave the Format as MS-DOS (FAT). I usually leave the name as UNTITLED. 

Then click 'Erase...'




A warning window will appear asking if you want to erase the disk. This is the point of no return, only click 'Erase' if you are 100% sure this is the right disk.




In several seconds time you will have a fresh formatted SD Card, ready to use.

All that remains is to eject the SD Card. Right click on the UNTITLED disk icon on your desktop, and select 'Eject "UNTITLED"'.

Tuesday, 26 February 2013

Raspberry Pi SD Card Setup Using a Mac

There are a lot of instructions available on how to set up a Raspberry Pi SD Card using a Windows PC. I thought I would share my method of doing this on an Apple Mac.

First download the image you would like to burn onto the SD Card. Generally I use Raspbian, and think this is a good place to start. The latest image can be found from here.

http://www.raspberrypi.org/downloads

The file is fairly large so can take several minutes to download, depending on your internet connection, so it is worth starting the download before proceeding.

Now it is important to take a note of the locally mounted disks before inserting the SD Card. To do this you will have to open the Apple Mac Terminal. This is found under Utilities within the Applications folder.



Once in the terminal on the mac type the following:

df -h

This should list all the locally mounted drives.




Now connect the SD Card into a USB port. I have a small USB SD Card reader for this purpose. If you need one these they can be picked up very cheaply from the internet.

Once the card is inserted you need to again type:

df -h




You should now be able to compare the first and second instances of df -h. As you can see I now have an additional drive /dev/disk2s1 connected to my Apple Mac.

It is worth checking that the additional drive looks as expected. I know my SD Card is 8 GB unformatted, and is called UNTITLED, which ties in with the 7.4GB (always less when formatted) stated against /dev/disk2s1. Getting the name wrong could have disastrous consequences. You have been warned...

In the command line now unmount the disk by typing:

diskutil unmount /dev/disk2s1




If your file has finished downloading you will need to unzip it before continuing with the installation.

To do this double click on the .zip file you have downloaded and this should start to unzip.




Again this next part is important so care should be taken.

If your SD Card inserted shows up as /dev/disk2s1 you will have to type rdisk2 in the next stage i.e. you ignore the /dev/ and the s1 part, but add an r in front of disk.

Next you need to know which directory you downloaded and unzipped the file into. Normally this is in your Downloads folder. If you downloaded it elsewhere you should change the path to the file. Ensure you also change the filename to match the file you have downloaded. For a file called 2013-02-09-wheezy-raspbian.img in the Downloads folder I would type:

dd bs=1m if=~/Downloads/2013-02-09-wheezy-raspbian.img of=/dev/rdisk2



If you get a permission denied message use sudo before the command. i.e.

sudo dd bs=1m if=~/Downloads/2013-02-09-wheezy-raspbian.img of=/dev/rdisk2

Then type your Apple Macs password when asked.

This stage takes several minutes, so please be patient.

Finally type:

diskutil eject /dev/rdisk2



again modifying this to match as previously discussed.

Your SD Card is now ready with the latest version of Raspbian installed. Enjoy!