Cloning a working Debian Slug (NSLU2)
some notes for when I have to do it again

Objective

1) Copy the slug firmware and USB harddrive contents from a working Slug to a new Slug
2) Modify files to set a new LAN address - in this case change from 192.168.0.51 to 192.168.0.52
3) Modify with new files to test new applications etc.

I bought a "new" Slug off eBay and wanted to clone the working Slug I had spent hours setting up to the new hardware.


Clone the USB hard disk

1) Copy all files from the existing USB hard disk (57 GBytes) to a folder in Linux on VMWare on my Mac
2) Plug a new USB hard disk (80 GBytes) into the Mac and drag and drop all files onto this - I think this disk was Ext2 not Ext3 - not sure if it matters.
3) Test this disk on the original Debian Slug - it works!


Copy the Firmware

On the original Slug do -
cd /data <--on the hard disk
cat /dev/mtdblock* > image.bin

plug the disk into the Mac and copy the firmware file image.bin to a folder in Linux on the Mac

Set the Slug for firmware upgrade
- hold the reset and power switches on - count to 10 - see the Ready/Status flashing between 2 colours
(I think it was red and green in the new Slug (it must be an old model) - dark orange/light orange in more recent ones)

In a Linux terminal cd to the folder containing image.bin in the Linux on the Mac
do -
upslug2 --image="image.bin"

Wait 5 minutes after it has loaded - switch off - plug in the hard disk - power up - disconnect the old slug from the LAN since both are at 192.168.0.51 at present
In the Mac terminal - ssh root@192.168.0.51 - it works!


Now change 192.168.0.51 to 192.168.0.52

There are config files all over the place !

These are the ones I found -


etc/hosts

127.0.0.1 localhost
192.168.0.52 Slug52local

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts


etc/hostname

Slug52local


/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.52
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.230
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.0.230
dns-search example.org


This one needs no change - it is the ADSL router

/etc/resolv.conf

search example.org
nameserver 192.168.0.230


etc/samba/smb.conf

[global]
syslog = 0
syslog only = yes
workgroup = WORKGROUP
server string = Slug 52 samba
security = share
encrypt passwords = yes
guest account = nobody
local master = yes
name resolve order = lmhosts hosts bcast

[Slug52local]
comment = /
path = /
browseable = yes
public = yes
writeable = yes


etc/lighttpd/lighttpd.conf - (if you need to set a differnt port than the usual 80)

## bind to port (default: 80)
server.port = 8051


 

ssh ftp and (even) samba now all work on 192.168.0.52 !!!!

- now to see if I can get an old webcam to run.........