The NSLU2 from Linksys is a fantastic accessory for any home user to have attached to their network. It is a way of connecting any external hard drive (be it a HDD or a memory key) to your network, allowing it to be accessed from anywhere.
The greatness of this little device however, expands ten-fold when you replace the official firmware with any of the multitude of replacements available for it. If you’re still using the official firmware and you’re happy with it, that’s perfectly fine, but if you’re looking for a little bit more, take a look at the offerings available over at the NSLU2-Linux site.
In a previous post, i detailed that i had replaced the firmware on my slug with Debian. I opted for Debian as i am quite used to working with linux machines, and it offers me total control over every aspect of what happens on the slug.
This post will show you how to firstly upgrade your Debian/NSLU2 install from Etch to Lenny, and also how to fix the only problem i encountered during my upgrade process.
Firstly, as the upgrade steps for the Debian/NSLU2 are the same as any other linux upgrade, they’re extremely simple so i’ll put them here for anyone who might be a bit lost and / or hasn’t yet upgraded.
Disclaimer: you will need root access for this process. As root access comes with responsibility, please take care, and know that while the upgrade process itself is mostly safe, the possibility always exists that something might go wrong, rendering your linux install useless. ALWAYS make a backup first.
- SSH into your NSLU2
- su to root.
- run ‘vim /etc/apt/sources.list’
- provided you’ve not messed with your sources.list file previously, you will still have a clean sources file. if this is the case, your list should contain a couple of lines that look somewhat like the following :
deb http://http.us.debian.org/debian etch main contrib non-free
deb http://security.debian.org etch/updates main contrib non-free
The entries all contain either the word stable or the word etch. (If all of your entries have the word stable in them, you should skip to step 7)
- replace all mentions of the word etch, with the word lenny.
- your list should now contain entries like the following :
deb http://http.us.debian.org/debian lenny main contrib non-free
deb http://security.debian.org lenny/updates main contrib non-free
- quit vim, and back at your root terminal, type the following commands one at a time, hitting enter after each.
apt-get update
apt-get upgrade
apt-get dist-upgrade
During the upgrade and dist-upgrade process you may be asked on occasion whether or not you want to accept what it’s going to do, you will need to type y or yes, depending on the question’s expected answer at each prompt to complete your upgrade.
Note: at step 5, you may change the mentions of etch to “stable” instead. The effect of doing this will be to have your slug upgrade automatically to the newest stable release automatically during your normal ‘apt-get upgrade’, ‘apt-get dist-upgrade’ use. People sometimes prefer to know precisely when they are about to upgrade to a new distro version release, and so specifically name the release (ie. etch / lenny) instead of using stable. They would then force the update by changing the sources.list file as is done in these steps.
Choose whichever system suits you best.
Once your Debian/NSLU2 is upgraded, it will need a reboot.
Here, however, is where my problem kicked in.
Apparently, somewhere in the upgrade process, someone thought it would be a good idea to rename the ethernet port from eth0 to eth1. The problem with that is that, when you reboot your slug after the upgrade for the new kernel to be loaded, the slug’s network/interfaces file tells the slug to bring up eth0, which no longer exists…!
Thankfully, despite its alarming nature, it’s a simple fix.
The easiest way to do it, in hindsight, is to edit your interfaces file before rebooting after your upgrade, but if you’ve found this page by googling “problem with etch to lenny nslu2 upgrade” or something similar, chances are you don’t have the option to do this.
Still, not to worry – simply shut down your slug, unplug your hard drive from it and mount the hard drive in another machine. The file you need to edit is in the slug’s ‘/etc/network/interfaces’.
Make sure you’re editing the file on the slug’s hard drive and not the /etc/network/interfaces file of the machine the hard drive is currently mounted in!
Within the file, the easiest fix is to just replace any mention of eth0 with eth1.
This issue is mentioned near the bottom of the Debian/NSLU2 Troubleshooting page.
Post-upgrade and post-reboot, make sure to take a look at what is no longer necessary – probably things such as old kernels which are now not in use. Just run ‘aptitude’ and it can quickly tell you and help remove you what you no longer need.
Hopefully this entry is of some help to fellow Debian/NSLU2 users – enjoy your new Debian Lenny install !
For more information on apt in debian see the official manual entry. That page also contains details on the sources.list file if you run into trouble.