This is the first post ever on this blog. So, first of all – a hearty welcome! We hope you have a pleasant stay.
What’s this post about?
There are graphical installers, of course, and other “easy” ways to do it from your main computer, assuming you have one.
But what, if not? Or if you simply want to use a Raspberry Pi to bootstrap another Raspberry Pi?
Well – it’s pretty easy! And of course this procedure can also be used to bootstrap all other known systems for the Pi out there!.
- Raspberry Pi, connected to the Internet, booting into Raspbian or another distribution with command line access
- SDHC card reader
- second SDHC card
- enough space on the first SDHC card to download and decompress the image you intend to use
We assume you run as normal user (pi), thus you need to prefix some commands with sudo
- Attach your SD reader with the second SDHC card inserted, on which you want to install Raspbmc. The SD reader should be attached to a powered hub.
Attention!!! All data on the second SDHC will be overwritten by this installation procedure. If in doubt, do not proceed!
Attention 2: If you attach your SD reader directly to the Raspberry Pi, it may become unstable and crash during the writing process (as result of a power deficit during writing to the SD card). Even if your SDHC can be readable just fine, writing to it may use more power and thus lead to unpredictable results.
- Log into your Raspberry Pi shell
- Download your image to the /tmp directory using wget. We will use the Raspbian network install (to save space on the first SDHC card).
- Unpack it
- Install dcfldd (Note: if you do not want to install dcfldd just use dd instead – dcfldd displays a progress message)
sudo aptitude install dcfldd
- Check that your SDHC card is being recognized properly. Most probably, you will recognize it by its size
sudo fdisk -l
The SDHC we are going to write to is /dev/sda – I identified it by its size, 16 GB. In the screenshot above you can also see the partitions in each drive.
Attention: Please ensure that you are going to write the the correct target!! Once again, the data on the target WILL be lost. If in doubt, please shutdown your Raspberry Pi and remove all unneeded storage devices – only leave the internal SDHC card and the SDHC you are going to bootstrap.
Attention: Before proceeding, check that you really do NOT need the data on the respective drive anymore. If in doubt, plug it into another machine, for instance an Ubuntu desktop machine to review it’s contents. Please note, that Windows will not recognize Linux partitions.
The other “disk” here ( /dev/mmcblk0) is the SDHC card inserted into the Raspberry Pi directly, from which it boots. As you see, I’ve used a 4 GB card, here.
- check that no partitions from your target SDHC card are mounted:
You have to look for /dev/sdaxx here (the device we are going to write to in a second). In this first screenshot, no partitions from this drive are mounted.
In this screenshot, we have /dev/sda1 (the first partition) mounted on /mnt/my_mountpoint. If that is the case, you have to unmount it:
sudo umount /dev/sda1
Change the device name accordingly to the partition(s) mounted in your setup. Also recheck using mount -l whether the unmount was successfull.
Writing to the SD Card
- Now we can write the image to the new SDHC card:
dcfldd bs=4M if=/tmp/installer.img of=/dev/sda
Assuming your image’s name is installer.img, and your device name (the SDHC card) is /dev/sda. Please change accordingly!! The block size 4M should be OK – if it does not work for you (errors …), try 1M instead.
This will take a while – once it is finished, it should display something like this:
root@raspberrypi:/tmp# dcfldd bs=4M if=/tmp/installer.img of=/dev/sda
18+1 records in
18+1 records out
Booting into Raspbmc
If you followed the instructions, you should be all set to boot into Raspbmc. Turn off your Raspberry Pi (using halt for instance), switch the SD cards and turn it back on again!
The network setup of Raspbmc will try to connect to the Internet – ensure that the LAN is attached to a DHCP router connected to the Internet, and download the latest release. It will show you a couple of dialogs during the setup, but mostly it is a very straighforward thing. Go grab a cup of coffee, like the installer recommends.
Raspbmc will by default install and expand to the entire SD card.
The device will then reboot itself – and you can start to enjoy Raspbmc!
Raspbmc even supports GrooveShark Anywhere: