Raspberry Pi

Installing a Distro on the Raspberry Pi

Info here is gleaned from the links below, thanks very much to the authors of same. I'm running Fedora 15, so commands will be specific to that distribution.

Here's how I downloaded and flashed the Raspian distribution. Comments begin with #.

Get the distribution, I'm going with the latest Raspian.

> transmission-cli http://downloads.raspberrypi.org/images/raspbian/2012-07-15-wheezy-raspbian/2012-07-15-wheezy-raspbian.zip.torrent
...elided for brevity...

The sha1sum should match 3947412babbf63f9f022f1b0b22ea6a308bb630c (from the Raspberry Pi website)

> sha1sum 2012-07-15-wheezy-raspbian.zip
3947412babbf63f9f022f1b0b22ea6a308bb630c 2012-07-15-wheezy-raspbian.zip

Excellent! We have a zip file that matches what we expected. Now extract the disk image and write it to the SD card.

> unzip 2012-07-15-wheezy-raspbian.zip
Archive: 2012-07-15-wheezy-raspbian.zip
inflating: 2012-07-15-wheezy-raspbian.img

My SD card is known as /dev/sdb on my desktop, your's may differ. Let's unmount it, and flash the new filesystem image. We use dd to copy the filesystem image to the SD card, a normal copy command will not work here as it will only copy the image to the existing partition on the card. We want to replace the existing partitions with those in the image file. I make sure that everything is written by performing a sync at the end.

> su
Password:
> sync; umount /dev/sdb1
> dd bs=1M if=Downloads/2012-07-15-wheezy-raspbian.img of=/dev/sdb
1850+0 records in
1850+0 records out
1939865600 bytes (1.9 GB) copied, 277.236 s, 7.0 MB/s
> sync

Here's the partition table for the newly flashed SD card.

> fdisk -lu /dev/sdb

Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000714e9

Device Boot Start End Blocks Id System
/dev/sdb1 8192 122879 57344 c W95 FAT32 (LBA)
/dev/sdb2 122880 3788799 1832960 83 Linux

I then re-partition the SD card to reclaim the empty space. I use gparted here, because it makes it easy to align partition starts on 1MB boundaries (fdisk instructions to follow shortly). I subsequently find out there is a utility in the raspbian distribution to do this that can be accessed on first-boot (I'll do it this way next time).

> gparted /dev/sdb
> # Added a data partition and swap partition in the GUI.
>
> # The result is:
> fdisk -lu /dev/sdb
> ...output from fdisk coming...

I'm ultimately not happy with this result, and I'd like to grow the root partition for installation of more packages (the current root partition is pretty full). Also, the swap partition doesn't appear to be used, as a swap file is used instead. I can either remove the partition, or change the system to use it. More on this later.

Ok, now I'm ready to boot the Pi! On first attempt I get the red power light lit but no other lights and no image on the screen. On closer inspection, after powering down, I notice that the SD card slot has a switch to determine whether the card is inserted fully - it is not. After correcting that the Pi boots fine.

I now find out there is a first-boot utility that allows you to grow the root partition, but as I've already done so, I don't explore this option. I foolishly accept the default for all locales, and then have to wait many hours as each locale is installed - won't do that next time!

Links

HTML5 Powered with CSS3 / Styling, and Semantics