Manually unpacking a tar ball of Debian on NSLU2
If for some reason you cannot use the installer on NSLU2, you can manually unpack a tar ball which I have prepared for these systems. You simply need to attach the USB drive to a PC running Linux first to prepare it according to the following instructions. If you're not running Linux on your PC, you can use a Linux live CD, such as Knoppix or Debian Live.
Preparing the hard drive
First, you have to partition the disk (we'll use /dev/sdb in the following examples but you have to replace this with the device name of your disk). I have used the partition scheme where a separate partition is used for /home. Therefore, you need to create /dev/sdb1 for the boot partition, /dev/sdb2 for the root partition, /dev/sdb3 as an extended partition from which swap (sdb5) and home (sdb6) are created. You can use a different layout but in this case you need to adapt /etc/fstab after unpacking the tar ball. The root partition has to be /dev/sdb2 since this is hard-coded in the ramdisk.
I used the following layout. There's no particular reason for using this partitioning layout. I simply used something similar to what debian-installer would create but you're welcome to use a different layout (in which case you need to update /etc/fstab though).
Device Boot Start End Blocks Id System /dev/sdb1 * 1 31 248976 83 Linux /dev/sdb2 32 882 6835657+ 83 Linux /dev/sdb3 883 9729 71063527+ 5 Extended /dev/sdb5 883 913 248976 82 Linux swap /dev/sdb6 914 9729 70814488+ 83 Linux
Use fdisk to partition your disk (let's call the disk sdb for now). Mark sdb1 as a bootable partition (press the key a in fdisk) and make sure that the partition is labled as a Linux partition (type 83). Make sure that the root partition is large enough to install all the applications you're interested in (at least 2-3 GB on a hard drive, and whatever you can spare if you're using a USB stick). Now format the drive:
% mkfs.ext2 /dev/sdb1 % mkfs.ext3 /dev/sdb2 % mkfs.ext3 /dev/sdb6 % mkswap /dev/sdb5
Mount the disk somewhere:
% mount /dev/sdb2 /mnt % mkdir /mnt/boot % mount /dev/sdb1 /mnt/boot
Downloading and installing the Debian base system
Download the compressed base system (about 111 MB; it will require about 335 MB of disk space when you unpack it). This contains a basic system with a standard set of packages of Debian 5.0.3 (lenny, 2009-09-22).
% wget http://people.debian.org/~tbm/nslu2/lenny/base.tar.bz2 % wget http://people.debian.org/~tbm/nslu2/lenny/base.tar.bz2.asc
Verify that the GPG signature matches:
% gpg --keyserver subkeys.pgp.net --recv-key 68FD549F % gpg --verify base.tar.bz2.asc base.tar.bz2
Now untar this system onto the drive as the root user and unmount the disk:
% cd /mnt % tar -xjvf ~/base.tar.bz2 % cd / % umount /mnt/boot % umount /mnt
Boot the system
Put your NSLU2 in upgrade mode and write the lenny firmware image (md5sum: d7c8c29081fe92ab5e8f829a5f9e89ad) using upslug2. Connect your hard drive immediately when upslug2 is done and then your device will reboot. The first time you boot, the system will probably check your drives. Please wait patiently until this is over. When the drive check is done, your NSLU2 will reboot again and directly boot into your new Debian system.
The system includes support for the Intel IXP4xx network chip (including the proprietary microcode that is required for operation) and will try to obtain an IP address via DHCP on eth0. SSH is installed and remote root logins are allowed. The password is root. There are no users yet. The RSA key of the host is:
ec:d7:79:86:a1:f9:98:00:3c:df:63:b2:a5:19:00:83
What to do now
You now have a working system. There are a few things you should do, though:
- change the root password
- add normal user accounts
- regenerate the SSH key (since the private key is included in the base
system on my web page) by running:
rm /etc/ssh/ssh_host* ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N "" ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ""
- edit /etc/apt/sources.list and use a Debian mirror close to you and then type: apt-get update
- run ntpdate pool.ntp.org to make sure the clock is always up-to-date; otherwise attempts to install new packages might fail due to GPG verification errors (for the first time, you'll probably have to setup the clock manually using the date command).
- upgrade your system using apt-get dist-upgrade to make sure you have the latest updates.
- change the timezone with dpkg-reconfigure tzdata
- setup locales with dpkg-reconfigure locales
- edit /etc/hostname to change the hostname.
- Finally, you may be interested in reading some tips for running Linux on a flash device (in case you didn't install Debian on a hard drive but a USB flash stick) and for reducing memory usage.
Go back to my Debian on NSLU2 page.