This guide(a Work In Progress) will explain how to install Debian GNU/Linux "Squeeze" on the LinkStation™ Duo LS-WXL using the Debian "debootstrap" procedure. The original kernel will be preserved, as well as the original bootloader (U-Boot). This Procedure is based on the Lenny procedure of the same name and is offered here as all the procedures for installing Squeeze on the LS-WXL led to an eventual endless reboot cycle. As the "lenny" procedure installs a squeeze kernel in any case and the lenny procedure produces a sane machine I just altered it by the change of the bootstrap fetched and the apt archives accessed in the install procedures.

Basic idea:

create a Debian system with debootstrap

use the data partition as a temporary root

replace the old filesystem with the new one

This guide will ask you to reformat partitions, delete existing data, etc. All of these actions may void your warranty, destroy your data, etc. In general you can receive help from the community or from the Buffalo forums but bear in mind that every problem you may encounter is ultimately up to you to solve. You do it at your own risk.

This guide is based on the procedure for installing Debian on LS-CHLv2 and was developed using the LS-WXL/E version. This guide should also work for the LS-WXL/R1 variants.

This guide suggests to install blstools, a small set of utilities developed for this hardware to enable some operations which would not be possible from a plain Debian install:

turn the unit off from the on-off-auto switch

turn unit blinking LEDs to still blue when boot is complete

resume blinking when the unit is shutting down

use the USB port

Please note that the Armel Debian "micro_evtd" package will NOT work on LS-WXL because of different hardware.

Backup the LS

If you have any important data on the LS you definitely need to make a backup.

Even if you don't, you'd better take a snapshot of the vital disk partitions (first and second partition). So you will be able to easily revert to the original stock distribution. [forum post] explains how to do it.

Prepare a Debian squeeze root filesystem

Debootstrap

This is derived from original debootstrap docs.

From the linkstation console download the Debian debootstrap utility and install it with dpkg:

This step WILL take time. At the end you should get the following message:

I: Base system installed successfully.

Completing the debootstrap and preparing the rootfs

Most commands will be run in the chrooted environment of the newly created Debian squeeze install. In order to enter the chroot type

LANG=C chroot debian-armel-rootfs/ /bin/bash

to leave type exit.

Copy kernel modules from stock kernel

Kernel modules reside in /lib/modules/<kernel version>. Here we are using the stock kernel so we must copy them from the stock initrd to the new rootfs. This must be done from within a chrooted environment in the new system - won't work with stock software.

Installation

We will reuse the existing root partition to store the debian rootfs. The data partition will be used as a temporary root so that this installation will be performed right on the LS itself. It is necessary to have a backup of the data partition if it contains important stuff.

If you want to change the RAID type for the data partition, it is better to use the web interface before switching to the full Debian setup.

Create an initrd

An initrd is necessary to boot debian using a raid partition.

We need busybox to create a minimal initrd. Note that we need to go back to the chrooted environment.

Installing the Debian rootfs

This will be a two step process. We first boot debian using a temporary rootfs and then transfer it to it final partition.

If you are using two hard disks, /dev/md2 will be the temporary partition and /dev/md1 will be the final destination. If you are using a single drive, then /dev/sda6 or /dev/sdb6 will be the temporary partition.

Building the Debian kernel

Caution: Make sure that you have physical access to the drives and a linux box just in case you messed up with the the kernel configuration. At the moment, there is no known way of gaining root access when the device is in EM mode.

The kernel can be natively compiled or cross compiled using an external Debian PC.