Using a SD card in Mac OS X terminal
Posted: March 11, 2012 Filed under: Operating Systems | Tags: Mac OS X 1 Comment »Since all Macbook Pros, come with a SD card drive, the other day I started to work on a set of automated scripts that would backup all my data in a SD card. This means I had to learn how to read and write data into a SD card using the Mac OS X terminal.
Step #1- When you insert a card into the system, you need to find out what is the system identifier for that particular SD card. So go to the console and type:
And you will get something like:

In my case, the SD card is identified as disk1.
Step #2- In order for you to write anything directly into the SD card, you need to know where it is mounted. Go to the console and type:
And you will get something like:
In my case, the mount point for the SD card is /Volumes/BEAGLE_BONE.
Step #3- To actually copy something into the SD card, just type any unix command considering the mount point for the SD card as a normal directory. For example:
This command will create a new file (tmp.txt) in the SD card with a listing of all files in the current directory.
Step #4- When you are done, make sure to unmount the SD card by typing, something like:

Didn’t think it was this straight forward! Want to put a 2D array of data for calendar dates (on and off times for electronic devices) onto an Arduino to run a lab experiment for 365 days unattended. Putting the data onto an SD card, then onto an SD card reader shield (small mountable board for Arduino), gives the micro controller all the data it needs to run for a year. Thanks!