Installing Raspbian on the Raspberry Pi

Download Image

1. Download the latest Raspbian release (Wheezy) from http://www.raspberrypi.org/downloads (e.g. 2013-05-25-wheezy-raspbian.zip).

2. Check that the hash of the downloaded file matches the one on the download site.

$ sha1sum 2013-05-25-wheezy-raspbian.zip
131f2810b1871a032dd6d1482dfba10964b43bd2  2013-05-25-wheezy-raspbian.zip

Write Image to SD Card

3. Extract the SD card image file from the archive.

$ unzip 2013-05-25-wheezy-raspbian.zip

4. Write the image to the SD card.

$ sudo dd bs=4M if=2013-05-25-wheezy-raspbian.img of=/dev/sdc

where /dev/sdc is the path to the SD card device.
IMPORTANT: The path varies; using the wrong path would cause the wrong disk to be overwritten.

Resize Root Partition on SD Card

5. Run parted on /dev/sdc.

$ sudo parted /dev/sdc

6. Print the partition table.

(parted) unit chs
(parted) print
Model: Generic STORAGE DEVICE (scsi)
Disk /dev/sdc: 482,18,47
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 482,255,63.  Each cylinder is 8225kB.
Partition Table: msdos

Number  Start     End         Type     File system  Flags
 1      0,130,2   7,165,29    primary  fat16        lba
 2      7,165,30  235,214,42  primary  ext4

7. Remove the existing root partition.

(parted) rm 2

8. Re-create the partition, filling the entire disk.

(parted) mkpart primary 7,165,30 482,18,47
(parted) quit

where 7,165,30 is the starting chs (cylinder, head, sector) number of the original (deleted) partition, and 482,18,47 is the ending chs number of the disk. The information is available in the original partition table.

9. Check and repair the root partition.

$ sudo e2fsck -f /dev/sdc2

10. Resize the root partition.

$ sudo resize2fs /dev/sdc2

Login to Raspberry Pi

11. Insert the SD card into the Raspberry Pi and switch it on.

12. Access the Raspberry Pi remotely using SSH.

$ ssh pi@192.168.1.2

where 192.168.1.2 is the IP address assigned to the device. The default username is pi, and the password is raspberry.

References

[1] http://www.raspberrypi.org/downloads
[2] http://elinux.org/RPi_Easy_SD_Card_Setup
[3] http://elinux.org/RPi_Resize_Flash_Partitions

Advertisements

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s