Contents


Introduction

This document describes experiences with a Network Storage Link for USB, a small (130x21x90 mm, 160 g), low power (10w, so could use 803.3at PoE), Linux box based on an Intel IXP420 running big endian, with 32MB (upgradable to 64 or 256) and 6MB (upgradable to 16).

It has two USB ports for connecting USB memory. It has the concept of a permanently connected, cold plugged (it does see new hot-plugged discs), partitioned, ext3 formatted disc; and a hot plugged Flash Memory Stick, which can be FAT formatted. The former can go in either slot, but the latter only in the second.

See other pages such as the and at nslu2-linux.org: NewUserGuide and HomePage

This page was started a few days before the machine arrived, and is developing. See /usr/groups/linux/extra-packages/unslung/ for files etc

Using the Linksys Firmware

It should be possible to use the Quick Install Page from a M$ box to get started (but it doesn't work for me).

See the User Guide.

The default address at RedBoot is 192.168.0.1, but when booted, it defaults to static IP address of 192.168.1.77, with no Gateway or DNS servers.

User Accounts

Creating a user account creates an entry in /etc/passwd with the `Comment' in the GCOS field, creates a new group in /etc/group, and adds the use to the group everyone.

If requested to `Create Private Folder (Share)', it is created in /share/hdd/data/ (AKA /) and /etc/samba/smb.conf updated to allow access by groups administrators and the user's group. However, /etc/passwd does not have a home directory, and the shell is /dev/null, so ssh, ftp and the like have problems. This includes such users as guest and admin (which use /home/user/$user).
Tweaking /etc/passwd allows FTP and ssh access as expected.

USB memory sticks

These can be inserted at any time into the ``Disk 2'' slot and are immediately visible, using their installed FS. They should be removed by using the M$ Storage Link application's `Safely Remove Drive'.

For a quiet (no moving parts) server, accessing existing files, use a memory stick.

USB discs

It formats any USB discs using the web interface, with three primary partitions: an ext3 data partition, an ext3 config partition, and a swap partition. It makes the data partitions available using samba.

Note that the LinkSys FW cannot mount M$ partitions on discs.

Do take a backup of the configuration written to any disc, use "Config Backup" to save the contents of /share/config/hdd.

Basic setup

Connect to the web interface as user admin/admin and select LAN and enable `IP Address: Obtain IP Address automatically (DHCP client)'.

Basic use: SMB and HTTP

The basic services the std SW provides are SMB and HTTP access to the shares.

M$ access to SMB

Ensure that the workgroup is correct (Start -> My Computer (righ click) -> Properties -> Computer Name -> Workgroup) and then select Start -> My Network Places.

Linux access to SMB

To find the server's name, address and workgroup, use the command findsmb.

Assuming a server name of LKG0FDE7D, the available shares can be listed with `smbclient -L //LKG0FDE7D/ -N' and assuming that lists 'DISK 1', an anon connection can be made using `smbclient //LKG0FDE7D/DISK\ 1 -U guest -N'

To mount the FS, use a command such as `smbmount //LKG0FDE7D/DISK\ 1 /mnt -o username=GUEST,guest' or `mount -t smbfs -o username=GUEST,guest //LKG0FDE7D/DISK\ 1 /mnt' or have an fstab entry such as `//LKG0FDE7D/DISK\0401 /mnt smbfs username=GUEST,guest 0 0' and then type `mount /mnt'. Note that the spasce character in the share name has to be encoded as a backslash followed by the octal representation of a space, and that options such as `noauto,user' cannot be included (at least under SuSE 9.3).

Its IP address can be determined: e.g. `smbclient -L //LKG0FDE7D/ -N -d 2' might produce `Got a positive name query response from 192.168.1.8 ( 192.168.1.8 )' In most cases, the server name can be replaced by its IP address.

access to HTTP

If the IP address of the server isn't known, try one of the methods above to find it.

Connect to the home page using the IP address, and select the required Public (or Private) Data. The URL will include the share name, e.g. http://192.168.1.8/DISK%201/

SW Evolution: uNSLUng to extend LinkSys functionality

uNSLUng takes the LinkSys FirmWare and adds features to make customisation easy. To extend it, the internal Flash Memory is copied onto a disc, and when booting, the magic file /.sda1root is detected, and the disc's FS is used as root, rather than the internal Flash (which is in /initrd. It also mounts it as /share/hdd/data/, allowing /public to be accessed as /share/hdd/data/public). Thus if anything breaks, booting without the disc installed reverts to the basic configuration, and the disc can be worked on either on the NSLU2 itself, or a Linux system.

Upgrade from Linksys FW

Download the FW from unslung, unzip the file, then select Administration -> Advanced -> Upgrade (as user admin/admin) and select the file (e.g. Unslung-5.5-beta.bin). If it says "Not Enough Space", reboot. Click on OK to start the upgrade. The Read/Status light flashes red and green and the cursor is an hour glass for 3 minutes (the popop says 5 mins), then opens a pop-up saying "Upgrading OK! System will reboot in 10 seconds!'). When it's completed check it remains LinkSys compatible, (except that upslug is needed to do subsequent upgrades). It should say `Firmware Vsrion: V2.3R29-uNSLUng-5.5-beta' or some such at the TRHC (it's now 6.8 Beta which is based on V2.3R63).

Upgrade from uNSLUng FW

Follow the README file, check TelnetIntoRedBoot, or use a paperclip to get the top "Ready/Status" light flashing ge/rd. "sudo ./upslug -i eth1 -u Unslung-6.8-beta.bin" to install it. It prints 0..f four times, with "*"s if a 512b block fails1. The ge/rd continues, and the ethernet light flashes off as there is traffic. It then verifies the Flash.

unsling

If using a memory stick as the disc, partition it with most of the disc as the first ext3 (basic + openssh + bash takes under 20MB), a small (needs just over 1MB) config ext3 partition, and a 128KB (or less) swap partition. Insert it in the Disk 1 USB port on the NSLU2. Go to Administration -> Advanced -> Status and it should be seen as 'Disk 1: Type: Not Formatted'. If not, reboot. telnet in as root (Password: uNSLUng, having enabled telnet using http://192.168.1.77/Management/telnet.cgi?action=Enable Telnet ) and nobble /sbin/fdisk (cd /sbin; mv fdisk fdisk.old; echo "#!/bin/sh" > fdisk; chmod +x fdisk) so that Administration -> Advanced -> Disk -> Format Disk 1 works and doesn't repartition the disc. Click OK to lose all data on Disk 1. (`mv /sbin/fdisk.old /sbin/fdisk' to restore it).

Follow the instructions in Unslung-5.5-beta-README.txt to unsling the disk. `unsling disk1' to do the basic install (5.5) :

# unsling disk1
Target disk is /share/hdd/data
Copying the complete rootfs from / to /share/hdd/data.
19096 blocks
Linking /usr/bin/ipkg executable on target disk.
Creating /.sda1root to direct switchbox to boot from /share/hdd/data.
#
or 6.8:
# /sbin/unsling disk1
Checking if able to unsling...

Waiting for /share/hdd/data ...

Target disk is /share/hdd/data
Checking that /share/hdd/data has been properly formatted...
Checking that /share/hdd/data is clean...

Please enter the new root password. This will be the new root
password used when the NSLU2 boots up with or without disks

Changing password for root
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Re-enter new password:
Password changed.

Copying the complete rootfs from / to /share/hdd/data ...
21024 blocks
Preserving existing ipkg database on target disk.
Linking /usr/bin/ipkg executable on target disk.
Linking /etc/motd to the unslung motd on target disk.
Updating /home/httpd/html/home.htm with target disk info.
Creating /.sdb1root to direct switchbox to boot from /share/hdd/data.

Unsling complete.

Leave the device disk1, /dev/sdb1 plugged in, and reboot
in order to boot this system up into unslung mode.
#
Reboot to move to using the new root.

Re-enable telnet and connect as root. Update the ipkg info (having ensured that there is a gateway (e.g. route add default gw 192.168.1.1) and suitable DNS (>> /etc/resolv.conf echo nameserver 194.74.65.68)) (ipkg update; ipkg install unslung-feeds; ipkg update)

Delete the ourtelnetrescueuser:sPuRQwXaya5YE:100:100::/home/user:/bin/sh entry from /etc/passwd

File Access Methods

With the Linksys FW, access is by SMB shares and web access. Additional packages allow NFS, FTP and ssh based access (e.g. scp, rsync).

Note that edits made to to /share/hdd/conf/share/share.info are lost on reboot

Reduce wear on FLASH memory

If using a memory stick, `touch /.ext3flash' to let the system know not to hammer the flash memory and wear it out (note that /var/ is on ramfs so all logs are lost on reboot).

ssh for secure access and as an application relay

Install openssh (rather than dropbear) using `ipkg install openssh', `mkdir ~root/.ssh', install suitable public keys (with access from 192.168.1.*) in ~root/.ssh/authorized_keys, and tweak the sshd config to be more secure. This allows the machine to act as an application relay for ssh, using agent forwarding (-A).

Tweak /etc/passwd to ensure that the user, group, HOME and shell are right.

NFS server

Install using `ipkg install nfs-utils', edit /opt/etc/exports to remove no_root_squash and anything else which is needed, and start using `/opt/etc/init.d/S56nfs-utils'.

Tweak /etc/passwd to ensure that the user, group, HOME and shell are right.

rdist

sudo

sudo can be used as a really like replacement, by adding `$user ALL=(ALL) ALL' to /opt/etc/sudoers

bash

Having added bash using `ipkg install bash', create a user entry in /etc/passwd which uses /opt/bin/bash (echo /opt/bin/bash»/etc/shells; ln -s /opt/etc/profile /etc/.).

ftpd - vsftpd

Having added vsftpd using `ipkg install vsftpd', `echo ftp stream tcp nowait root /opt/sbin/vsftpd /opt/etc/vsftpd.conf >> /etc/inetd.conf', edit /opt/etc/vsftpd.conf so that it has `vsftpd_log_file=/var/log/vsftpd.log' rather than /opt/var/log/vsftpd.log.

It seems to need a manual restart of xinetd.

Tweak /etc/passwd to ensure that the user, group, HOME and shell are right.

For anonymous FTP, ensure `anonymous_enable=NO' is commented out and that HOME is set to not be writable by the server, e.g. make it be /. If uploads fail, check the setting of `anon_upload_enable'.

ftpd - proftpd

An alternative is proftpd which includes SSL/TLS.

ntpclient

`ipkg install ntpclient' installs /opt/bin/ntpclient and /opt/sbin/adjtimex but does nothing to cause it to be run.
How should it be done? The package page gives examples

Other packages

Then add other useful packages

SW Revolution: opeNSLUg to start from scratch

OpenSlug goes back to basics, and doesn't bother with LinkSys compatability.

HW: optional Mods (not used)

The box can be used ASIS, or can have some simple tweaks. None are currently needed for any local uses.

un under clock

For some strange reason, Linksys have set the syetem to run at half speed. Removing R83 (desoldering or just breaking) causes it to run at full speed, at almost no cost in power and thus power dissipation.

Auto Power on

By default the box does not switch on when power is applied, the on button having to be manually pressed. For a few pence, an MCP120-450DI/TO (available from MicroChip under their sample programme) voltage supervisory device allows the box to auto power on

serial port

Adding a serial port involves soldering on a header, and using a serial dongle.

Footnotes

... fails1
sh-3.1 [IMAGE png]


Piete Brooks 2006-05-25