• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.


Hard Drive Installation

Page history last edited by PBworks 14 years, 11 months ago


How to Install to the Hard Drive


This is the traditional method preferred by uNSLUng users familiar with Linux, because it converts the NSLU2 into a tiny, very versatile Linux PC, with a DOS-like command-line interface. To learn more go to NSLU2-Linux.Org. You'll be amazed, perhaps even unslung, by all the cool things people do with uNSLUNG NSLU2's.


I chose this approach for my personal NSLU2 because will enable me to more easily incorporate updates (e.g., to uNSLUng or TwonkyMedia), add-ons, and modifications that present themselves in the future. Whichever method you choose, know that you can always restore the NSLU2 to its original Linksys firmware and start over.


Assuming you've assembled the ingredients, let's get started.

Verify Normal NSLU2 Operation

The first step is to verify that the computer, NSLU2 and USB hard drive are all talking to each other. Because uploading firmware to the NSLU2 is a critical procedure it is best to connect your PC directly to the NSLU2—no switch, no hub, no LAN—just a CAT5 cable between the two devices. I used a laptop PC connected directly to the NSLU2 with a standard CAT5 cable.


  • The NSLU2's default IP address is If yours is not using this address you'll have to transpose these instructions.
  • For your PC to communicate with the NSLU2 the PC must be in the same subnet. Set the PC's IP address to 192.168.1.nnn (where nnn is any number other than 77).
  • Connect the target USB hard drive to the NSLU2's "Disk 1" port.
  • Power up the NSLU2 and the drive. Wait several seconds for the NSLU2 to beep.
  • Open your web browser and in the Address field enter:
  • "Go" there.
  • If the NSLU2's GUI appears and the hard drive appears next to "USB Port 1", you're ready to move to the next step.

Start with a Clean Slate

To help ensure that this recipe will work I suggest resetting the NSLU2 to its default configuration unless it is new, right out of the box, or its default configuration has never been changed. I also suggest reformatting the drive using the NSLU2's built-in disk format function. For this recipe to succeed the drive must have been formatted by the NSLU2. I've read that it is possible to install uNSLUng and TwonkyMedia on an already in-use NSLU2 and drive, with files and folders on the drive; custom users, groups, shares and other personal settings in place; but I didn't want to take any chances. You can skip the next two steps if you feel confident about doing your own translating between my recipe and your unique configuration.


Restore NSLU2 Default Configuration

  • As above, browse to
  • Click  Administration .
  • Click  Setup .
  • Scroll down and click  Restore Default Config  .

  • Before proceeding I think it's a good idea to change some of the NSLU2's settings and fill in some of the empty fields. Here's a list (menu names included):
    •  Administration - LAN - Gateway  your router's IP address (but leave blank if the NSLU2 will not be used on a LAN connected to the Internet)
    •  Administration - LAN - Primary and Backup 1 DNS Server addresses  provided by your ISP (but leave blank if the NSLU2 will not be used on a LAN connected to the Internet)
    •  Administration - System - Server Name  NAS is my choice because it's memorable and you can substitute //NAS for // in the browser and Windows Explorer.

Format the drive

If the NSLU2 has not yet formatted the drive, do it now. I've read that the NSLU2's format function works best on a drive with a single FAT32 partition; in other words: not a drive with multiple partitions, not even a drive previously formatted by an NSLU2. USB drives usually come pre-formatted as a single FAT32 partition, which is perfect. (Note that using another program to format the drive for EXT3 will not work; the NSLU2 creates one big partition and two small ones, and my impression is they must be created by the NSLU2. Otherwise, the NSLU2 may not recognize the drive—a problem that frequently appears in the various NSLU2 forums.)

  • Click on  Administration .
  • Enter admin for both user name and password.
  • Click  Advanced .
  • Click  Disk  
  • If "Disk 1 Status" is "Not Installed" click  Format Disk1  and take a break. Eventually, the NSLU2 will display "Formatted" next to  Disk 1 Status  after it's finished.

Install uNSLUng Firmware

You will use the NSLU2's built-in firmware upgrade feature to install uNSLUng.


  • Download the Unslung 5.5 beta firmware here.
  • Unzip/Extract the file "Unslung-5.5-beta-firmware.zip" to an easily found folder, like "C:\unslung".
  • Power off your NSLU2.
  • Disconnect or power off the drive attached to your NSLU2.


Be sure the hard drive is either disconnected or switched OFF


  • Power up the NSLU but do not power up the hard disk.
  • Using a web browser go to the NSLU2's GUI at (or //NAS if you renamed it).
  • Click on  Administration .
  • Enter admin for both user name and password.
  • Click  Advanced .
  • Click  Upgrade .
  • Click  Browse  and find the “Unslung-5.5-beta.bin” file.
  • Click  Start Upgrade . A popup window will appear saying that "The upgrade progress(sic) will take 5 minutes". Press  OK  to continue.

  • Wait several minutes for the process to finish.
  • After the upgrade finishes a popup window will appear saying "Upgrading OK! System will reboot in 10 seconds." Click  OK  and wait until the NSLU2 beeps to indicate it's fully rebooted, then shut it off using its power button.

"Unsling the Drive"

Put the hard drive in a towel and fling it across the room. Uh, not really. "Unslinging the drive" means: transferring the NSLU2's root file system to "Disk 1". Once this is done the NSLU2 will boot from the hard drive (which, incidentally, should always be connected to the NSLU2 now that it's been "unslung").


The nNSLUng ZIP file includes an excellent README document. You will not be able to read it with Notepad because it'll display as one long block of text. Since you'll probably need a Linux-compatible editor later in this recipe anyway, find one now (e.g., Cream). WordPad will work okay for reading a Linux text file or script, but don't try editing one with it.


  • Connect the hard drive to "Disk 1" on the NSLU2.
  • Power up the NSLU2 but do not power up the hard drive. The hard drive must not be powered up until I tell you.
  • Using a web browser go to the NSLU2's GUI at
  • Click on  Administration .
  • Enter admin for both user name and password.
  • Click in the browser's Address field and change it to read:
  • "Go" there.

  • A very simple screen will appear with an  Enable Telnet  button. Click the button and wait a few seconds until it changes to read  Disable Telnet .
  • Open a Windows Command Prompt (aka. "DOS box").
  • At the prompt type telnet and press Enter.

  • The NSLU2 will respond with "NAS login:"
  • Type root and press Enter.
  • The NSLU2 will respond with "Password:"
  • Type uNSLUng, capitalized exactly as shown, and press Enter.
  • You'll see the following screen.

  • Enter the command help and you'll see a list of commands. If you cannot get the NSLU2 to respond to the telnet command see this page.


You're now logged in as the "root" user, which has special significance in Linux. It was necessary to do this with the hard drive turned off because the password "uNSLUng" won't work if the NSLU2 had booted with the drive attached.


Speaking of which, now it's time to connect and turn on the drive. Power it up and wait a minute for the NSLU2 to recognize it.


  • Back in the Windows Command Prompt window, enter the following (L S space minus L, in lower case): ls –l /share/hdd/data
  • You should see a listing of the drive's root-level contents.
  • Now type (no space between disk and 1): /sbin/unsling disk1



There will be some drive activity while the NSLU2's root file system is copied to the drive, after which you'll see the telnet # prompt again.


  • Type exit to return to the DOS prompt. You can leave the window open because you'll return to it in the next section.
  • Back in the web browser click  Disable Telnet .

  • Edit the browser's Address field so it just reads

  • "Go" there.


The NSLU2 home page now shows that it has the uNSLUng firmware.



It's time to shut it off.

  • Click  Administration .
  • Click  Status .
  • Click  Shutdown Now .

Copy the TwonkyMedia Files to a Flash Drive

For this recipe you'll use a FAT32-formatted USB flash drive, plugged into the NSLU2's Disk 2 port, to install TwonkyMedia. There's another reason for using a flash drive, which I'll elaborate on now because it may affect your choice of flash drive.


When I wrote this recipe, the TwonkyMedia software package contained two different installation scripts (actually, three, but "install.nas" + "install.sh" = "install-twonkymedia-on-nslu2.sh"). Despite knowing nothing about Linux, I could see disparities between them. The process of deciphering and comparing these scripts lead me to a couple of discoveries worth mentioning:


In the section of one script that creates twonkyvision-mediaserver.ini, there's a line:



This tells TwonkyMedia its database will be on a USB flash drive attached to the "Disk 2" port. I asked TwonkyVision why they assume the database will go on a flash drive instead of the "Disk 1" hard drive. Reinhard, one of their incredibly responsive support people, replied that a flash drive will yield faster database access because it uses memory I/O instead of disk I/O.


I then recalled reading that flash drives have a limited number of erase cycles (called "write endurance"). Imation says their flash drives have between 10K and 100K erase cycles. Do the math. If TwonkyMedia rescans the drive and rebuilds its database at the default of "every 90 minutes" it could feasibly wear out a flash drive in a couple of years. I thought about this. Since I edit photos and rip CDs on a PC I'll probably copy these files to the NSLU2 in batches, so I can set TwonkyMedia's "scantime" to zero and then manually tell it to rescan the database after I've uploaded a batch of files. This should extend the flash drive's lifespan indefinitely.

So… if you plan on leaving a USB flash drive attached to the NSLU2 permanently, to handle the database, you should choose the drive now and use it for this installation. This dedicated flash drive must be large enough for the database, which TwonkyVision says requires approximately 1MB per 5000 files (then double it because during rescans it creates a copy of itself). Sounds like a tiny 64MB stick should be fine.


If you prefer to have the database on the hard drive, any size flash drive will suffice for this installation. Also, in the dbdir= line of the script shown below change "flash" to "hdd".


In a few minutes you'll plug the flash drive into the NSLU2, but first:


  • Plug the flash drive into your PC so you can copy some files to it.
  • Unzip/Extract the contents of "twonkymedia-nslu2.zip" that you downloaded from TwonkyVision's Members area.
  • Of the extracted files, the following four should be copied to the flash drive:







The first three files have no file extension; they're just generic "files" to Windows.


The fourth file is an installation script. At the time of this writing the installation script needed a few modifications, in my opinion. My modified version is shown below. It incorporates elements from two other scripts found in the ZIP file. If you want to use the modified script you can download it from here, or copy it from the listing below and paste it into a text editor (which will be necessary if you want to change it, for example, to store the database on the hard drive).


You can't edit these scripts in just any text editor. It must be one that supports Linux line endings, which means line-feeds only (no carriage returns). I use Vedit. Cream is one of many you can download for free.


In a pinch you can edit the script using "vi", which is a simple Linux editor found in the NSLU2's /bin directory. Eject the flash drive, plug it into the NSLU2 Disk 2 port, boot the NSLU2 and hard drive. Telnet into the NSLU2 as you've done already, and type the following: /bin/vi /share/flash/data/install-twonkymedia-on-nslu2.sh See this page for "vi" usage instructions.

My Modified Script


# installing TwonkyMedia on NSLU2 with UNSLUNG 3.x
if [ ! -e /opt ] ; then mkdir /opt ; fi
if [ ! -e /opt/etc ] ; then mkdir /opt/etc ; fi
if [ ! -e /opt/etc/init.d ] ; then mkdir /opt/etc/init.d ; fi
if [ ! -e /share/flash/data/twonkymedia ]
	echo TwonkyMedia not found on USB stick, terminating
	killall -9 twonkymedia
	cp /share/flash/data/twonkymedia /opt
	cp /share/flash/data/jpegscale /opt
	cp /share/flash/data/lame /opt
	chmod +x /opt/twonkymedia
	chmod +x /opt/jpegscale
	chmod +x /opt/lame

cat << EOF > /opt/etc/init.d/S99twonky
/bin/mount -t vfat /dev/sda1 /share/hdd/data > /dev/null
/bin/mount -t vfat /dev/sdb1 /share/flash/data > /dev/null
route add -net netmask dev eth0 2>/dev/null
chdir /opt
/opt/twonkymedia -D

chmod +x /opt/etc/init.d/S99twonky

# initial customization
cat << EOF > /opt/twonkyvision-mediaserver.ini

cp /opt/twonkyvision-mediaserver.ini /opt/twonkyvision-musicserver.ini
cd /opt


  • Again, you can download my script from here.
  • Save or copy the modified script to the flash drive.
  • Eject the flash drive from the PC and plug it into the NSLU2's Disk 2 port.

Install TwonkyMedia

If your NSLU2 will be connected to a LAN with Internet access, connect it to your LAN now. Connect the PC you've been using to the LAN, too. Power up the NSLU2. Be sure the hard drive is also on.


The NSLU2 will take longer to boot now because it's booting from the hard drive. There will be lots of LED activity on the NSLU2's front panel but eventually it will beep, indicating it's ready.


  • Assuming your browser is still open, click  Home  (or open a browser and go to
  • Click the browser's "refresh" button.
  • You should see both drives listed.
  • Click  Administration .
  • Enter admin for both user name and password.
  • Click in the browser's Address field and change it to read:
  • "Go" there.
  • The Telnet screen will appear. Click  Enable Telnet  and wait a few seconds until it changes to read  Disable Telnet .
  • Now back to the Windows Command Prompt (aka. "DOS box").
  • At the prompt type: telnet, and press Enter.
  • The NSLU2 will respond with "NAS login:"
  • Type root and press Enter.
  • The NSLU2 will respond with "Password:"
  • Type uNSLUng, capitalized exactly as shown, and press Enter.
  • Type the following (L S space minus L, in lower case): ls –l /share/flash/data
  • You should see a listing of the four files on the flash drive.
  • Now type: /share/flash/data/install-twonkymedia-on-nslu2.sh, and press Enter.



The script runs for a moment and then the telnet # prompt will reappear as shown above.


  • Type Exit and press Enter.
  • Switch to the browser and click on the  Disable Telnet  button.
  • Edit the browser's Address field to just read:
  • "Go" there.
  • Click  Administration .
  • Click  Status .
  • If you put the database on the hard drive click  Shutdown Now .
  • If you put the database on the hard drive unplug the flash drive after the NSLU2 beeps and turns off.
  • If you put the database on the flash drive click  Restart Now .


Verifying the Installation


Power up the NSLU2 if it's off. The hard drive should still be on. When the NSLU2 beeps, it's ready.


  • Open the NSLU2's GUI in a browser.
  • Insert the cursor in the Address field and edit it to read:
  • The TwonkyMedia GUI should appear.


If you see the GUI on your screen, CONGRATULATIONS!! (and skip to the last paragraph).


During one of my tests the GUI didn't appear. I figured I'd slung the wrong sling or something. To make a long story short, it turned out that the NSLU2 was hanging up trying to connect to the Internet because I had filled in the DNS and Gateway fields in its configuration.



Normally, the NSLU2 would be connected to a LAN and thus to the Internet, but while flashing its firmware I had it connected directly to my laptop. That's when I learned the following rule:


If the NSLU2 will not be connected to the Internet, leave the Gateway and DNS fields blank.


Eventually, if not immediately, the TwonkyMedia GUI should appear in your browser's window even if the NSLU2 is not connected to the Internet. If the GUI doesn't appear after several minutes, remember what I said in the Introduction, this recipe has no warranty, express or implied... (In the top SideBar see Troubleshooting.)


Testing the Installation

Once you see TwonkyMedia's GUI, what's next? The GUI is just for configuring TwonkyMedia; I wanted to see what using it is like! At the time I didn't have a Roku or other UPnP player to test it with. So Google found me a software client: Cidero. It's free, and very non-invasive. It doesn't actually play any media, but it does let you see how TwonkyMedia's database gives you various views of your music library.



An alternative client, one that will actually play music and videos, is WinDVD. Be aware that when you install the trial version you'll see messages like "installing 3rd party applications" and "installing Interactual player" so... you may get more than you bargained for.


Before doing anything else, though, I suggest you see my article, Configuring TwonkyMedia.



Comments (0)

You don't have permission to comment on this page.