Debian on a Raspberry Pi

Been having fun getting Debian up and running on my Raspberry Pi, this a note of the software and config tweaks I made to get it running how I wanted

I downloaded the Debian ARM image from here and copied the image in to an SD card I had, a 4GB SanDIsk SHDC class 4 (There’s a handy list of Raspberry Pi working SD cards here.)

dd if=debian6-19-04-2012.img of=/dev/disk1 bs=1m

The image uses around 2GB arranged as:

  • 1.5GB root fs
  • 200 MB /boot
  • 256 MB swap

To make use of the rest of the 4GB card I popped the card into a spare debian box I had and resized it with Gparted. I noticed the root fs was already at 80%, so I extended that a bit then made a new 1.25 GB partition for /home (ext4) and added the necessary entry to /etc/fstab. The card now looks like this:

  • 200 MB /boot
  • 2.3 GB /
  • 1.25 GB /home
  • 256 MB swap

My first boot failed with a kernel panic. It looked like a hardware/IRQ thing to me so I whipped the keyboard and mouse out of the USB sockets and tried again and it booted fine.

I headed back to the supported hardware page again showed me that my cheapo Argos keyboard was not gonna play so I found a different keybord, tried again and this time it booted up perfectly and I logged in (default user/pass on these Debian images is pi/raspberry).

For video I used the HDMI out as my telly has a spare HDMI socket in the back. Running ‘startx’ brings up the Xfce GUI, and I added ‘disable_overscan=1’ to the file /boot/config.txt get rid of the fat black borders around the desktop.

I plan to make some ports available on the internet (a web server and sshd at least) so there were a couple of sysadmin tasks I needed to do: I added a new user account for myself, logged out and in as me, and then removed the default ‘pi’ account. I also removed users ‘pi’ and ‘suse’ from the sudoers file.

Doing this reminded me to install vim, did that and changed the default $EDITOR from joe:

sudo apt-get install vim
sudo update-alternatives --config editor

(If you’re new to Debian then this page is useful.)

The openssh-server is installed but not enabled by default, to start it and get it to restart on a reboot I ran:

sudo service ssh start
sudo update-rc.d ssh defaults

I installed Apache with

sudo apt-get install apache2

The server will fail to start on install so you’ll want to

sudo groupadd -f -g33 www-data
sudo /usr/sbin/apachectl graceful

Sound wasn’t enabled by default, to get it going I loaded the snd_bcm2835 kernel module and installed the alas-utils package:

sudo apt-get install alsa-utils
sudo modprobe snd_bcm2835

I then added snd_bcm2385 to /etc/modules so it auto-loads on boot, and added the line ‘hdmi_drive=2’ to the /boot/config.txt file to force sound via the HDMI output.

That’s pretty much it. The online community and documentation for the Raspi is great. I found this troubleshooting guide particularly useful in getting up and running.

Leave a Reply

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

You are commenting using your 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