Okay, so the first step should be to get your bootable media in order. Since the Raspberry Pi only knows about the SDCard as it's bootable media (compared to a desktop that might actually look for hard drives) we need to format and partition an SDCard so we can continue our baremetal series.
In this series I will be using Ubuntu 10.04 (Lucid Lynx) so if you are using a different distro your mileage may vary. See the man pages of your distro for any questions regarding the commands I will be going over.
Prepare Your SDCard
You should first insert your SDCard into your laptop or desktop. Depending on what distro you are using, it may or may not auto-mount it. If it does auto-mount, you have to unmount it before continuing. Once the SDCard is inserted, type the following command to see what physical disks exist on your system (user must be in the sudoers file or a root user):sudo fdisk -l
Identify your SDCard
The fdisk command allows you to view and edit partitions of the fixed disks attached to your systems. Fixed disks are basically any kind of permanent media, such as hard drives and the SD Card you just inserted. Each entry is preceeded by a header which describes the fixed disk. This includes the system identifier, which you will write down, and the size. You might see several entries, look for the one that matches the size of your SD Card.In my case the following is printed for a 2GB SD Card inserted:
Disk /dev/sdb: 1967 MB, 1967128576 bytes
!!IMPORTANT!! Failure to correctly identify your SD Card will result in data loss.
I am not responsible for any data loss or damage you do to your system.
Proceed at your own risk!
If you are sure you have the correct disk, double check, and then write down, or remember, the system identifier. That's the part that begins with /dev in the header. In the above case it is /dev/sdb. Again, it's very important that you get this correct or you will lose data and there is no easy way to regain, so if you are at all unsure seek someone more knowledgeable than you to help. It's better to be safe than sorry. As they say, measure twice, cut once.
Now on to the cutting.
Create Partitions
I have created a script which should help you through this process. This script is designed to work on Ubuntu 10.04, but I don't guarantee the execution on any distro. There are some requirements, which you probably already have installed, but the script will show errors if you haven't installed those requirements yet. You should install any missing requirements with apt-get.You can download the script here: https://github.com/scottmccain/raspberry-pi-sd-card-prepare-script/tarball/master.
Type:
wget https://github.com/scottmccain/raspberry-pi-sd-card-prepare-script/tarball/master --output-document=prepare-script.tar.gz
Next untar the tarball you just downloaded:
tar -xvzf prepare-script.tar.gz
And change directory to newly created directory:
cd scottmccain-raspberry-pi-sd-card-prepare-script
!!IMPORTANT!!
Improper usage of this script, EXPECIALLY NOT IDENTIFYING THE CORRECT SDCARD, will result in loss of data and you could potentially render your system unbootable. It is important that you identify your SD Card correctly at the begging of the script. If you have any doubts, press Ctrl-C and seek someone more knowledgable than you. Proceed at your own risk.
DISCLAIMER
I am not responsible for any data loss or equipment failure and I make no claims, promises, or guarantees about the accuracy, completeness, or adequacy of the contents of this script, and I expressly disclaim liability for errors and omissions in the contents of this script. No warranty of any kind, implied, expressed, or statutory, including but not limited to the warranties of non-infringement of third party rights, title, merchantability, fitness for a particular purpose or freedom from computer virus, is given with respect to the contents of this script.
(make sure you have umounted the SDCard before running this script)
sudo ./preparesd.sh
Follow the script prompts and you should have an SDCard formatted and partitioned, ready to copy the boot loader files.