Author: Wilfred Nilsen - BarracudaDrive
How to create your own online document/data server. Host your documents in the cloud on a small device that runs 24/7 and uses a maximum of 4 Watts of power.
SlugOS is a Linux distribution for the Linksys NSLU2. Installing SlugOS and installing the various tools are normally a daunting task if you are either new to Linux or have never used Linux before.
The following guide will help a person with little or no Linux experience install SlugOS on the NSLU2 and configure the NSLU2 to run the BarracudaDrive server. When you have the BarracudaDrive server running on the NSLU2, the server can be used for more that just a NAS. In addition to functioning as a NAS, with the BarracudaDrive server, your local network can also be accessed remotely. BarracudaDrive lets you or multiple users access and work with electronic documents or any type of data stored on your NSLU2 from remote locations.
The following video shows how to use the WebDAV server:
| Hardware: | Software: |
|---|---|
|
Click the above links and install the software on your PC now.
PuTTY is used when connecting to the NSLU2. You do not need to understand the Linux commands we present; just make sure you follow exactly as explained. The commands presented below are designed to be copied and pasted into the PuTTY terminal window.

The SlugOS Linux distribution and BarracudaDrive will be installed on the flash drive. The idea is to use flash memory for the BarracudaDrive applications such as the Content Management System and the standard USB hard drive for storing documents and files. The standard USB hard drive will automatically spin down when not in use. The drive will only power on when used by the Web File Manager or the WebDAV server -- i.e. when being used as a NAS. All other access to the BarracudaDrive server is via the USB flash drive. This setup will provide a system that will be very reliable for many years to come.
Before installing OpenSLug, power on the NSLU2 with the default Linksys software. You can find the drive on your network by using the supplied CD. The default address for the NSLU2 is 192.168.1.77, thus you can access the server from your browser using http://192.168.1.77.
The recommendation for the NSLU2 is to use a static IP address. However, we recommend using a dynamic IP address if you have a router that gives you a list of the connected DHCP clients. For example, Linksys and D-Link routers provide a DHCP client list when you login to the router's web-interface. You can easily spot your NSLU2 if your router gives you the information. In addition to providing a DHCP list, many routers allow you to lock a DHCP client such that the IP address will never change. For example, on a D-Link, you click the DHCP button and lock the NSLU2's IP address using "static DHCP".
If you would prefer to use DHCP with the NSLU2, browse to the NSLU2's web-interface and change the settings such that it uses DHCP. Reboot the NSLU2 and verify via your routers DHCP list and verify that you can access the NSLU2's web-interface by using the IP address listed by your router. We suggest that you physically unplug the power to the router and the NSLU2 if you use the static DHCP settings in the router. Plug the power cables back in and turn on the devices.
Note the NSLU2 must be powered off when you start the following procedures:
The PuTTY configuration window and the terminal window when logged into the NSLU2:
The commands presented below are designed to be copied and pasted into the PuTTY terminal window. You do not need to understand the commands.
The following procedure initializes the NSLU2.
#---------------------------------------------------- turnup init #----------------------------------------------------
When the above command is running, the following will be printed on the console. You must enter a new password. The other options are optional. Press enter to use the default values.
root@BarracudaDrive:~# #---------------------------------------------------- root@BarracudaDrive:~# turnup init Please enter a new password for 'root'. The password must be non-empty for ssh login to succeed! 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: <-- Enter a new password Re-enter new password: Password changed. Host name [BarracudaDrive]: <-- Select a name for the NSLU2 Domain name [workgroup]: Boot protocol (dhcp|static) [dhcp]: <-- We use dhcp
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: <-- Enter a new password Re-enter new password: Password changed. Host name [BarracudaDrive]: <-- Select a name for the NSLU2 Domain name [workgroup]: Boot protocol (dhcp|static) [dhcp]: <-- We use dhcp
The following procedures: save the above settings, format the USB flash memory, and copy the SlugOS to the USB flash memory.
#---------------------------------------------------- turnup preserve umount /media/sda1 mkfs.ext3 /dev/sda1 turnup memstick -i /dev/sda1 #----------------------------------------------------
You will see lots of information being printed in the terminal window. Wait for the commands to complete.
You must now reboot the NSLU2. You will have to reboot the NSLU2 a few times to complete the installation.
To reboot:
We must install some software before we can install BarracudaDrive. The following commands create a swap disk and install a number of required programs.
#---------------------------------------------------- echo "Create swap and install required packages" dd if=/dev/zero of=/swapfile bs=1M count=32 mkswap /swapfile echo '/swapfile swap swap defaults 0 0' >>/etc/fstab swapon -a opkg update opkg -force-overwrite install joe nano bash file gawk util-linux procps coreutils ntpclient openssl echo "Set correct time and date" ntpclient -s -h pool.ntp.org echo "Reducing memory: Disabling getty" sed 's?S:2345:respawn:/sbin/getty 115200 ttyS0?#S:2345:respawn:/sbin/getty 115200 ttyS0?' /etc/inittab >/tmp/inittab cp /tmp/inittab /etc/inittab #----------------------------------------------------
It will take some time before the above commands are completed. Wait for the commands to complete.
You must now reboot the NSLU2 again. Follow the reboot procedures as previously explained.
We are now ready to install BarracudaDrive. The procedures below: create a dedicated Linux user for the BarracudaDrive server, download BarracudaDrive, install BarracudaDrive, configure BarracudaDrive, and start BarracudaDrive.
#---------------------------------------------------- echo "Creating the bd (BarracudaDrive) user" #http://linux.die.net/man/1/busybox adduser -G daemon -h /home/bd -s /bin/bash -D bd cd /home/bd echo "Downloading BarracudaDrive" wget http://barracudaserver.com/products/BarracudaDrive/bd.OpenSlug.tar.gz echo "Unpacking BarracudaDrive" tar xvzf bd.OpenSlug.tar.gz echo "Installing BarracudaDrive (Linux boot auto start)" cd InstallDaemon ./install.sh cd .. echo "Setting BarracudaDrive Linux login user to 'bd' in boot script" sed 's/BDUSER=root/BDUSER=bd/' /etc/init.d/bdd >/tmp/bdd cp /tmp/bdd /etc/init.d/bdd chmod +x /etc/init.d/bdd echo "Installing the SSL certificate wizard" #Requires OpenSSL, which we have already installed cd applications wget http://barracudaserver.com/products/FreeLspApps/unix/sslcert.zip cd .. echo "Cleaning up" rm -r InstallDaemon rm bd.OpenSlug.tar.gz chown -R bd /home/bd chgrp -R daemon /home/bd chmod -R o-w * chmod -R o-r * chown root bdd bd.zip chmod 750 bdd bd.zip echo "Starting BarracudaDrive" /etc/init.d/bdd start #----------------------------------------------------
The BarracudaDrive server should now be running. To access the BarracudaDrive server enter http://the-NSLU2-IP-address in a browser. Example: http://192.168.1.77/
What you see is the BarracudaDrive Content Management System. The next step is to configure BarracudaDrive. Enter the URL http://the-NSLU2-IP-address/setup/ in a browser. Example: http://192.168.1.77/setup/
Follow the configuration wizard. We suggest watching the configuration video by clicking the video button in the top left corner of the configuration wizard.
If you plan on adding the extra drive, insert the USB plug into "disk 2" in the NSLU2 now. It is OK if you have already plugged the drive in.
Warning: You should not have anything on the drive as the drive will be formatted!!!
Copy and paste the following commands into the PuTTY terminal window. The command formats the drive using a Linux file system. We do not use use a DOS file system as there would be problems with access rights for the BarracudaDrive server.
#---------------------------------------------------- umount /media/sdb1 echo "Formatting the drive using a Linux file system" mkfs.ext3 /dev/sdb1 #----------------------------------------------------
It will take some time before the drive is formatted. Wait for the command to complete before proceeding.
Copy and paste the following commands to set the access rights for BarracudaDrive. The commands below also install a tool that will make the hard drive spin down manager in BarracudaDrive function.
#---------------------------------------------------- chown -R bd /media/sdb1 chgrp -R daemon /media/sdb1 echo "Creating link from WFS root directory to external disk @ USB 2" ln -s /media/sdb1 /home/bd/disk/external chown bd /home/bd/disk/external chgrp daemon /home/bd/disk/external echo "Installing Optware so we can install sdparm using ipkg" setup-optware.sh ipkg update echo "Installing sdparm, which is used for HD spin down" ipkg install sdparm echo "Setting sudo bit so BarracudaDrive can spin down the disk" chmod a+s /opt/bin/sdparm #----------------------------------------------------
When you login to the BarracudaDrive Web File Manager or use the WebDAV server, the directory "external" should be visible. This directory is your new extra disk you just installed. Anything outside of the "external" directory is on your USB flash drive.
The next step is to learn more about the Web file Manager and the WebDAV server so you can use the NSLU2 as a local or external NAS. Go to the Web File Manager home page and click the video. The hard drive spin down manager can be found at the following URL: http://the-NSLU2-IP-address/spindown/
Do the following after you have installed BarracudaDrive on the NSLU2 if you are upgrading or moving BarracudaDrive from another operating system.
© 1996 - 2010, Home Toys Inc. - All Rights Reserved
Powered by LJB Management Inc.