Victor Meldrew in the 21st Century

Main menu

Post navigation

Installing Linux on an ALIX.2D3

I was lucky enough to come by a PC Engines ALIX.2D3 low-power server and set about getting a decent operating system onto it, to hopefully replace my existing over-powered Fedora home server.

This project was far from simple, so for the benefit of anyone else embarking on this endeavour, below is a brain dump of what was required. This is not intended as a complete step-by-step guide as I am doing this from memory, but I believe I have captured most of the pertinent information to get you through.

First things first. The 2D3 does not have a video adaptor and so you will require a null-modem serial console cable. I also needed a serial to USB adapter so I could connect from a MacBook.

The second ‘issue’ is that even though the 2D3 has USB ports, it will only boot from a Compact Flash card. I ordered a Kingston 40x 4GB CD card for under a tenner.

After the CF card arrived I spent a frustrating few days trying to install Debian Lenny.

With the 2D3 connected via serial I powered it on and hit ‘S’ during the memory test to enter the system BIOS settings. I then changed the baud rate to 9600 (9), enabled PXE boot (E) and enabled HDD wait (W).

I also had to slightly modify some of the Debian netboot files to add serial console support. More information and the diffs can be found in this Debian bug report – serial console boot not possible

For compatibility sake I wanted to install ‘Lenny’ and not the latest ‘Squeeze’, however the install menu was not obliging. To choose Lenny I had to switch to an advanced install.

After booting from the network (which was attached to my MacBook), I swapped to an open Internet connection and configured an IP address. This allowed me to carry on with the installation and downloads without having to proxy via the MacBook.

When the installation got as far as detecting the hard disk, which in my case was a Compact Flash card, no matter what I did it would not detect the storage. This foxed me for a few days until by chance I had a USB hard disk connected during the installation and this somehow caused the flash disk to be discovered too.

After selecting the CF card (/dev/hda) I was able to partition the disk and finish the Debian installation.

To protect my CF card from way too many read/writes I opted to permanently add a conventional USB hard disk for the more dynamic data partitions – swap, /tmp, /var and /home.

I simply created appropriate partitions using fdisk on the USB drive (/dev/sda), ext3 formatted the partitions using mkfs.ext3 (mkfs.swap in the case of the swap partition) and set about copying the data from the CF card to the USB disk. Don’t forget to mark the swap partition as type 82 (Linux Swap). I used a 525MB swap partition for this 256MB board.

I arranged my partitions as follows:

/dev/sda1 /tmp (Linux ext3) 518.20MB

/dev/sda2 swap (Linux swap) 526.42MB

/dev/sda3 /var (Linux ext3) 3010.46MB

/dev/sda4 /home (Linux ext3) 496050.19MB

Format the partitions:

mkfs.ext3 /dev/sda1

mkfs.ext3 /dev/sda3

mkfs.ext3 /dev/sda4

mkswap /dev/sda2

Create mount points:

mkdir -p /mnt/tmp /mnt/var /mnt/home

Mount the partitions:

mount /dev/sda1 /mnt/tmp

mount /dev/sda3 /mnt/var

mount /dev/sda4 /mnt/home

Set the ‘sticky’ bit on the new /tmp:

chmod 1777 /mnt/tmp

Copy the data from /dev/hda to /dev/sda:

cp -a /var/* /mnt/var

cp -a /home/* /mnt/home

After the copying has completed I added the USB disk partitions to /etc/fstab so that they would mount at boot time. First we need the device IDs:

Note that I added the ‘noatime’ option to prevent inode access times from being updated.

Make sure that the previous (now unused) mount points are commented out (including swap).

I also wanted to move root’s home directory to the USB disk and so created a new /mnt/home/root directory and added the following mountcommand to the end of /etc/rc.local:

mount --bind /home/root /root

Finally, before the reboot you’ll need to add a forced delay into the boot sequence to allow the USB drive to be detected before the mountall script starts. More details of this can be found in my previous blog post – Wait for USB.

Now it’s time to be brave and issue a reboot! Don’t forget to disable PXE boot in the BIOS settings as you shouldn’t be needing that again.

After the reboot:

Use ‘mount’ to check that all the partitions are present and correct:

# mount

/dev/hda1 on / type ext3 (rw,noatime,errors=remount-ro)

tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)

proc on /proc type proc (rw,noexec,nosuid,nodev)

sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)

udev on /dev type tmpfs (rw,mode=0755)

tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)

devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)

/dev/sda1 on /tmp type ext3 (rw,noatime)

/dev/sda3 on /var type ext3 (rw,noatime)

/dev/sda4 on /home type ext3 (rw,noatime)

Use ‘swapon -s’ to check that swap is mounted on the correct partition (should be /dev/sda2):

# swapon -s

Filename Type Size Used Priority

/dev/sda2 partition 514072 564 -1

You can now start to add packages and configure your server as you want it. As the 2D3 does not come with a RTC battery one of the first things I did was install ntpd to keep the time accurate.

Hi there. Hows possible, that Alix try to boot from Serial Console connected to Management Console of Switch or from USB connected to UPS. Is there some possibility disable boot from serial or USB port?