This guide will explain how to install Debian GNU/Linux "Lenny" 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).

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.

Obtain root access to the linkstation

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

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.