Jan 212013
 

If you, like me, end up having a lot of SDHC test cards (before releasing them to our RPI shop we have to test them!) you may end up wondering whether there is still something important on them, or if you can re-flash them with the newest and greatest Raspbian, XBian or whatever.

the-magician-shows-two-sdhcs-trickUse Raspberry Pi itself

Well – one way is to use the Raspberry Pi itself with another SDHC card which boots, to look at the contents. Raspbian can look at a broad array of different filesystems. Another advantage: you will be able to write to these SDHC cards, too. For instance, you could fix a broken boot sequence or wrong config.txt parameters which prevent you from using the Raspberry Pi.

Read SDHC cards on Windows

But there’s also an option to do this on Windows. If your Windows box happen to be on, or you have only one SDHC and it’s “bricked”, you may want to recover some data from it before reflashing.

We recommend you to get the Diskinternals Freeware Linux-Reader – it will show you a list of partitions, and even has a file preview box where you can see the file’s contents.

Nov 112012
 

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?

Say, you’ve got a Raspberry Pi and two SDHC cards – one is already set up with Raspbian, you can boot into it, and get your Pi online. The other one is empty – and you want to install Raspbmc on it.

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!.

Prerequisites

  • 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

Instructions

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).

cd /tmp
wget http://download.raspbmc.com/downloads/bin/ramdistribution/installer.img.gz

  • Unpack it

gunzip installer.img.gz

  • 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

image

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:

mount -l

image

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.

image

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
root@raspberrypi:/tmp# ls

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-network-installer

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-on-Raspberry-Pi

Raspbmc even supports GrooveShark Anywhere:

raspbmc-Grooveshark-Anywhere

Optimization WordPress Plugins & Solutions by W3 EDGE