Installing Ubuntu Linux on an ALIX 2D13

Trunet's Place - Portfolio
Jump to: navigation, search

I bought an Alix 2d13 from pcengines. It's a great and small board that fits perfectly to a home server or a firewall/router.

I tried to install a pfsense firewall first but the 1.2.3 version is a little old and the wireless drivers are not that great and I'd have some problems with performance and range of my wireless network even with a 600mW wireless card. The 2.0 version is VERY buggy, so I give up with these pfsense things for a while.

So, let's do it in the hard way...

First, I recommend that you buy an SLC compact flash instead that MLC because of perfomance and durability. The SLC has 10x more durability and the performance is way better. With 1Gb you can fit perfectly a ubuntu lucid minimal with ssh, it'll use 500Mb of your compact flash.

Start by plugging the compact flash using a cf reader in your actual ubuntu. fdisk the drive(in my case I'll assume that the CF is /dev/sdc). Remove ALL partitions and than create only one using all the space. Swap is not good as it'll burn your CF fast because of high write number it'll perform. It's better kill processes with out of memory than your CF die in 6 months in my opinion.

What's very important is to reassign the console to serial, disable the other terminals as you don't have a monitor plugged and make sure to do a correct grub-install to configure the bootloader.

I've made a checklist to help me installing my boards:

  • fdisk /dev/sdc (remove all partitions and create only one full partition)
  • mkfs.ext2 -L/ /dev/sdc1
  • mkdir /mnt/cfroot && mount /dev/sdc1 /mnt/cfroot
  • mount -o bind /proc /mnt/cfroot/proc && mount -o bind /sys /mnt/cfroot/sys && mount -o bind /dev /mnt/cfroot/dev
  • cp /etc/resolv.conf /mnt/cfroot/etc/resolv.conf
  • chroot /mnt/cfroot /bin/bash
  • source /etc/profile
  • vim /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu oneiric universe multiverse
deb-src http://archive.ubuntu.com/ubuntu oneiric universe multiverse
  • apt-get install language-pack-en-base
  • apt-get install linux-image-generic grub2
  • echo proc /proc proc nodev,noexec,nosuid 0 0 > /etc/fstab
  • echo UUID=`dumpe2fs /dev/sdc1 | grep UUID | awk '{print $3}'` / ext2 defaults,noatime 0 1 >> /etc/fstab
  • edit /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="verbose console=ttyS0,38400n8 reboot=bios"
GRUB_SERIAL_COMMAND="serial --unit=0 --speed=38400"
GRUB_TERMINAL=serial
  • rm /etc/init/tty?.con
  • create /etc/init/ttyS0.conf
# ttyS0 - getty
#
# This service maintains a getty on ttyS0 from the point the system is
# started until it is shut down again.
 
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
 
respawn
exec /sbin/getty -8 38400 -L ttyS0
  • edit /etc/hostname
yourhostname.yourdomainname
  • edit /etc/hosts
127.0.1.1 yourhostname.yourdomainname yourhostname
  • aptitude install rsyslog sudo
  • passwd root
  • grub-install
  • update-grub
  • chmod 644 /boot/grub/grub.cfg
  • /boot/grub/grub.cfg
sed 's/\(hd1,0\)/\(hd0,0\)/g' /boot/grub/grub.cfg
  • chmod 444 /boot/grub/grub.cfg
  • aptitude install ssh vim iputils-arping dhcp-client ubuntu-minimal
  • update-rc.d ssh defaults

Help/Support

As always, if you need any help, ask on my forum. I'm always looking and answering things there.