hacking the d-link dns-323 soho nas

OVERVIEW
I don’t like clutter.  I like a clean desk, I like it to be minimal, and I like little tidy boxes.  I like wireless.  I love my Mac.  I do not like my desktop PC anymore.  I also love music, but I am terrified of losing the library I’ve built up over all these years.

Goal:  Replace my aging desktop PC with a cheap, mostly redundant NAS box.

Services:
- Storage: for all my data - mp3s, movies, tv shows, digital pictures
- Streaming: video content to my xbox 360
- Backup:  Apple time capsule functionality for my Macbook.
- Redundancy:  Replicate only my important data between both disks in the NAS.  Ideally back this important data up to an external disk once a week?  month?

I’m going to start by firing the box up on the network with no drives attached.  Reflash the firmware to the latest version, install both drives, and then hack it up.  Grab a redbull and hold on to your pocket protectors…

LINKS & REFERENCES

Firstly I have to say kudos to the guys at the dsmg600 hack forum and wiki - what a goldmine of information for the 323 hacking community.  Also big ups to fonz for all his work on ffp, and kylek for his work on getting Transmission working with the 323.

Dlink:
firmware:  http://www.dlink.com/products/support.asp?pid=509
supported harddrives:  http://support.dlink.ca/products/view.asp?productid=DNS-323#faq

funplug 0.5:
howto @ http://wiki.dns323.info/howto:ffp
download @ http://www.inreto.de/dns323/fun-plug/
additional packages @ http://www.inreto.de/dns323/fun-plug/0.5/PACKAGES.html

Transmission:
libcurl:  http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
transmission 1.34:  http://kylek.is-a-geek.org:31337/files/Transmission-1.34-ffp0.5.tgz

vi quick reference - don’t leave $HOME without it :)  <groan>

0.  Network Config
Plugged cat5 and power cables in.  Powered up the box with no harddrives.

Log into linksys and find the mac address of the dlink box.  Copy it and set it to a static IP of 192.168.1.128.  This is done on the router so I can leave the dlink to obtain dhcp addresses automatically.  I don’t want to hardcode the IP address into the box if I want to take it with me somewhere and jack into someone else’s network that might not be on 192.168.1.*.

1.  Upgrade Firmware

Came with firmware 1.04 out of the box.  Downloaded v1.05 from dlink’s website and flashed it through the administration tool.

Now that I’m using up to date firmware, time to install the drives.

Hold the blue square “dlink” button down for about 10 seconds until it starts blinking.  This will shutdown the device cleanly.

2. Decision - RAID or no RAID?

I bought two Seagate 1TB drives.  Originally I had planned on using them in a RAID1 configuration but after much deliberation I chose not to.

My reasoning is this:  I’ve always loved the idea of RAID, but I don’t want to be dependent on the array.  If you lose a drive and can’t rebuild the array, you’re screwed.  Also, if for some reason you need to pull a disk out of the array and slam it into another PC, you can’t read the files.  This all sounds rather inconvenient to me.

Let me give you an example.  As drives approach and exceed the 1TB mark, the failure rates go way up.  According to this article,  “over 3% of drives fail each year in the first three years of drive life, and then failure rates start rising fast.” and, even more terrifying for a RAID system, “even today a 7 drive RAID 5 with 1 TB disks has a 50% chance of a rebuild failure”.  Now that is some scary shit.  Ok, so what if the dns-323 only has 2 disks?  I’ve heard enough horror stories about trying to rebuild its 2-disk RAID array (sometimes manually - yikes!) to deter my confidence.

And then I started thinking about what I really need redundancy for in the first place.  What is the criticality of the data I want to be redundant?

The answer is in most cases, it is not critical.  I don’t care if I lose my TV or Movies library, but I do care if I lose my mp3s.  If I had kids, any home pictures/movies would be absolutely irreplaceable.  I also REALLY care if my laptop gets hosed — since I use it for work — or stolen.  I’ve experienced catastrophic drive failure on my work laptop before, and let me tell you it is not a fun experience.  I sync most of my important work documents between my mac and PC via dropbox (with encryption), but I figure for further redundancy I’ll stick a time machine volume on my NAS and let my Mac backup to that like a wireless Apple Time Capsule too.

Lastly, some required reading on why “Smart SOHOs Don’t Do RAID”:  http://www.smallnetbuilder.com/content/view/30060/230/

Conclusion:  So, what I’ve set out to do is install 2×1TB disks in a standard, two-volume configuration.  I’ll sync a “replicated” folder between both drives, and make sure the data I care about is stored inside that folder.  My mp3s and pictures from my desktop PC will go in that replicated folder.  For my work laptop, I’ll set it up to use Time Machine to the 323.    

INSTALLATION PROCEDURE

I bought the 323 (canadacomputers) and 2 Seagate 1TB hdds (ncix).  I also bought a cheap 2gb usb thumb drive in case I wanted to mount that and run all system files off of it.  The first thing I notice is this thing is damn small.  Like, smaller than a kleenex box (that’s a silver pen standing there for comparison):

For you guys at RIM, here’s an example of the size of it with my trusty Pearl on top:

I prepped the two disks by writing “1″ and “2″ on them with a sharpie.  This is probably a good idea in the event of a failure so I don’t get the drives mixed up.  REALLY IMPORTANT NOTE:  Disk 1 goes in the RIGHT HAND SIDE.  Disk 2 goes in the LEFT hand side.  Why?  I don’t know.  Blame d-link.

Pop the front cover off the NAS by lifting up 1/8″ and then pulling it towards you.  Insert the disks by pressing firmly.  No screws or cables required!

Now that the disks are in the box, turn it back on and wait for it to start up.  The square blue LED will blink madly for about a minute.  Now, both drive “cylinders” on the front are lit up.  Bask in the glory of its blinking cool-blue presence:

Navigating to the admin interface, I log in and am presented with this screen:

It sees both disks as 1000 GB.  So far so good.  I choose “Standard” and hit Next.

OH NOES!!!11   Press ok.

2:56pm.  I go make lunch.

About half an hour later, it’s done:

I hit “restart” for good measure.

And:

And, in the finder:

On my windows box:

3.  The Hack

Ok, now the fun part.  Let’s hack this thing to run telnet/ssh so I can get into teh lunix innards.

Download funplug 0.5 and copy the “fun_plug” and “fun_plug.tgz” to Volume 1 of the dlink.

Reboot.

If all goes well, the tarball is exploded upon reboot and deleted.  You should now see /ffp directory in Volume 1.

You should now be able to telnet in:

hackbook:[~] horto$ telnet blinky
Trying 192.168.1.128…
Connected to blinky.
Escape character is ‘^]’.
/ # uname -a
Linux blinky 2.6.12.6-arm1 #29 Wed Apr 30 10:03:59 CST 2008 armv5tejl unknown
/ #

BAM!!

Unfortunately… the hack is so easy it’s not terribly exciting.  No buffer overflows.  I didn’t even have to write any shellcode.  Oh well…

4. Get rid of telnet w/ no password - enable SSH
have to modify /etc/shadow:  pwconv
change root password:  passwd
enter the new root password (twice)
usermod -s /ffp/bin/sh root
test with good old /bin/login:  login

You should see something like:

/ # login
blinky login: root
Password:
Last login: Wed Oct 22 20:49:44 -0500 2008 on pts/1.
No mail.
root@blinky:~#

IMPORTANT:  if you can log in, commit this to flash memory:  store-passwd.sh

root@blinky:~# store-passwd.sh
Copying files to mtd1…
Copying files to mtd2…
Done.

Now let’s move onto enabling sshd:
DO NOT CLOSE YOUR TELNET WINDOW (in case something bad happens)

chmod a+x /ffp/start/sshd.sh
sh /ffp/start/sshd.sh start

You should see something like:

root@blinky:~# sh /ffp/start/sshd.sh start
Generating public/private rsa1 key pair.
Your identification has been saved in /ffp/etc/ssh/ssh_host_key.
Your public key has been saved in /ffp/etc/ssh/ssh_host_key.pub.
Starting /ffp/sbin/sshd
root@blinky:~#

Ok, now we can try to login.  You can use terminal from your mac, or putty for windows:

hackbook:[~] horto$ ssh root@blinky
The authenticity of host ‘blinky (192.168.1.128)’ can’t be established.
RSA key fingerprint is e3:d5:87:72:0f:c7:14:85:76:8b:c9:a5:c4:6d:af:1a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘blinky,192.168.1.128′ (RSA) to the list of known hosts.
root@blinky’s password:
root@blinky:~#

if success, disable telnet:
chmod -x /ffp/start/telnetd.sh

w00t.  You can close your previous telnet session now.

Installing bash
While we’re here we might as well install the bash shell too…

Since this is the first “custom” package we’re installing, create a packages dir:

cd /mnt/HD_a4
mkdir packages
cd packages/
wget http://www.inreto.de/dns323/fun-plug/0.5/packages/bash-3.2-3.tgz
funpkg -i bash-3.2-3.tgz
ls -lF /ffp/bin/bash
-rwxr-xr-x    1 root     root       516792 Apr 14  2008 /ffp/bin/bash*

Double w00t.

5.  Set up bittorrent client

It would be nice to put this little box to work download torrents for you, wouldn’t it?
Ok, no problem, we can do that by installing Transmission.  Then we also get the great web UI (clutch) too.  (Note:  Clutch… works the… transmission?  get it?  ha!)

But I’ll take it one step further… I’ll set it to automatically monitor a folder (say /Volume_1/torrents/ for any .torrent files I save there from Firefox on any of my PCs.  If a .torrent file is found (checking every hour), add it to Transmission’s queue and remove the .torrent file.

Then you can just monitor the status of your torrents using the WebUI at http://<NAS_IP>:9091/transmission/web !

Reference:  http://forum.dsmg600.info/t2719-%5BREL%5D-Transmission.html
libcurl:  http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
transmission 1.34:  http://kylek.is-a-geek.org:31337/files/Transmission-1.34-ffp0.5.tgz

Get Transmission and required libs (curl and uclibc), and install:
(edit 22-10-08:  fonz tells me uclibc shouldn’t be required anymore, so skip those lines).

wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
wget http://kylek.is-a-geek.org:31337/files/Transmission-1.34-ffp0.5.tgz
wget http://www.inreto.de/dns323/fun-plug/0.5/packages/uclibc-0.9.29-7.tgz
funpkg -i curl-7.18.1.tgz
funpkg -i Transmission-1.34-ffp0.5.tgz
funpkg -i uclibc-0.9.29-7.tgz

Now I’ll set up a directory for incoming (downloaded) files:

mkdir /mnt/HD_a2/incoming
chown nobody:501 incoming
chmod 755 /mnt/HD_a2/incoming
REBOOT
Login:  http://192.168.1.128:9091/transmission/web
Click the little gears icon in the lower-left screen
Choose Preferences
Set download folder to /mnt/HD_a2/incoming

Download a torrent (through the webUI) and go!
(The downloaded files will be saved in \\<NAS>\Volume_1\incoming)

6. AUTO-TORRENT-DOWNLOADING!

Okay, so you have Transmission working, but if you’re like me, it’s a pain in the ass to login to the webUI every time you want to download something.  Let’s set das blinkenbox up to monitor \\<NAS>\Volume_1\torrents for any .torrent files we place into that folder, and automatically download them to \\<NAS>\Volume_1\incoming.

Mad haxx ahead:

mkdir /ffp/var/scripts
cd /ffp/var/scripts
vi torrentwatchdog.sh
<paste the script below>  Note: vi commands are i, <paste>, :wq, <enter>
chmod +x torrentwatchdog.sh

#!/bin/sh
#################################################################
# —-[ torrentwatchdog.sh ] —-
# script to monitor a specific directory for new .torrent files.
# if found, queue them up in transmission
# TODO:  make transmission stop after seeding 1:1
# w 10/20/08 horto
#################################################################
TORRENTDIR=/mnt/HD_a2/torrents
WDLOG=$TORRENTDIR/.torrentwd.log
TRANSMISSION_REMOTE=/ffp/bin/transmission-remote

for FILE in $TORRENTDIR/*.torrent; do
if [ “$FILE” != “$TORRENTDIR/*.torrent” ]; then
echo [`date`] “$FILE” added to queue. >> $WDLOG
$TRANSMISSION_REMOTE -a “$FILE”
rm “$FILE”
echo [`date`] “$FILE” deleted from directory. >> $WDLOG
sleep 1
fi
done
exit 0

Create the torrents directory (will show up in \\<NAS>\Volume_1\torrents\):

cd /mnt/HD_a2/
mkdir torrents
chown nobody:501 torrents/
cd torrents
touch .torrentwd.log

Edit root crontab to check this directory for new .torrents, every hour, on the hour:

(edit 22-10-08):
NOTE:  crontab -e to edit (just like vi)
add the following line to the bottom of the crontab:
0 * * * * /ffp/var/scripts/torrentwatchdog.sh >> /mnt/HD_a2/torrents/.torrentwd.log 2>&1

I realized that the 323 annoyingly overwrites the root crontab upon reboot, so here’s a workaround to keep your cron jobs persistent:

cd /mnt/HD_a2/ffp/start
vi editcron.sh <paste script below>
chmod a+x editcron.sh
test:  crontab -l <should list existing crontab, without torrentwatchdog.sh
test:  ./editcron.sh
test:  crontab -l <should now list crontab w/ torrentwatchdog.sh>

#!/bin/sh
##############################################################################
# —-[ editcron.sh ] —-
# script to keep cronjobs persistent (e.g. after reboot)
# w 22/10/08 horto
# ref/credit: http://tinyurl.com/5m2349 - thanks chumby!
#############################################################################
FFP=/mnt/HD_a2/ffp
CRONTXT=$FFP/etc/crontab.txt

# start with existing crontab
# note:  on a fresh reboot, this will always have been reset to standard
/bin/crontab -l > $CRONTXT

# add cronjobs here preceeded by /bin/echo.
# don’t forget to enclose them in double quotes.
/bin/echo “0 * * * * /ffp/var/scripts/torrentwatchdog.sh >> /mnt/HD_a2/torrents/.torrentwd.log 2>&1″ >> $CRONTXT

# install the new crontab
/bin/crontab $CRONTXT

# clean up
/bin/rm $CRONTXT

Notes:

  • * * * * * = minutes, hours, day, month, weekday.
  • So, “0 * * * *” means run every hour at the top of the hour.
  • ” >> /mnt/HD_a2/torrents/.torrentwd.log 2>&1 ” redirects stdout and stderr back into the .torrentwd.log file (since Transmission often returns txt back to the console when adding torrents).
  • The line, “/bin/echo “0 * * * * /ffp/var/scripts/torrentwatchdog.sh >> /mnt/HD_a2/torrents/.torrentwd.log 2>&1″ >> $CRONTXT” should wrap on one line.
  • I’m lazy.  If someone feels like modifying this script to read in a file full of cron jobs, say from /ffp/etc/mycrons.txt with a “for $LINE in mycrons.txt …”, please feel free!

Note:  You should probably check to make sure Transmission starts on boot:
ls -lF /ffp/start | grep trans

-rwxr-x—    1 root     root          807 Aug 26 17:54 transmission.sh*

see executable?  mmk good.

Now it monitors the \\<NAS>\Volume_1\torrents dir:

And writes a log to \\<NAS>\Volume_1\torrents\.torrentwd.log.

7.  Install *nix rar client

Want to unrar your downloads from the commandline?  maybe you do.  maybe you don’t.  if you do:

cd /mnt/HD_a4/packages
wget http://www.rarlab.com/rar/unrar-arm.tar.bz2
tar xvjf unrar-arm.tar.bz2
/mnt/HD_a2/ffp/bin/
cd usr/local/bin
mv unrar /mnt/HD_a2/ffp/bin/

To use:  unrar x <archive> <path_to_extract>

8. USB STORAGE MODULE

Let’s make use of that usb port on the back, shall we?  I’d like to be able to connect my other USB external drives, a USB printer, USB sticks, hell, an entire USB hub full of crap.

mkdir /mnt/HD_a2/.bootstrap
obtain usb-storage.ko
cp /mnt/HD_a2/.bootstrap/user-storage.ko/lib
insmod /lib/usbstorage.ko

TODO!

TESTING
=========

THROUGHPUT

Quick test - enable the dlink ftp server through the dlink admin interface.  Allow anonymous access for now.  Allow r/w access to /mnt/HD_a2/incoming.

Tweak access permissions to my /incoming dir:

/mnt/HD_a2 # cat /etc/passwd
root:x:0:0:Linux User,,,:/home/root:/bin/sh
admin:x:500:500:Linux User,,,:/home/admin:/bin/sh
nobody:x:501:501:Linux User,,,:/home/nobody:/bin/sh
ftp:*:95:95::/mnt/HD_a2/incoming:

See that ftp user?  gid is 95.  I’ll allow /incoming to be group writable by gid 95…

cd /mnt/HD_a2
chown nobody:95 incoming/
chmod 775 incoming (that’s user all, group all, everyone else read/execute)

/mnt/HD_a2 # ls -lF
drwxr-xr-x   12 root     root         4096 Oct 19 22:44 ffp/
-rw-r–r–    1 root     root        48286 Oct 19 22:49 ffp.log
-rwxrwxrwx    1 nobody   501          1778 Oct 18 13:05 fun_plug*
drwxrwxr-x    7 nobody   95           4096 Oct 20 17:00 incoming/
drwxr-xr-x    2 nobody   501          4096 Oct 21 10:43 torrents/

cool.

Now fire up flashfxp on my windows box… start transferring a 700mb file, throughput maxxes out at almost 10mb/sec.  Not bad for being cabled into a linksys wrt54g. (10/100 i think).  YMMV.  Be cool, go gig-e.  Then you can hit almost 25mb/sec with this thing.

COMMON TASKS
================

Installing packages:

1. ssh or telnet to the device
2. cd /mnt/HD_a4
3. mkdir packages
4. cd packages
5. rsync -av inreto.de::dns323/fun-plug/0.5/packages/grep-2.5.3-1.tgz .
6. funpkg -i *.tgz

Replace grep-2.5.3-1.tgz in step 5 with whatever package you want from http://www.inreto.de/dns323/fun-plug/0.5/PACKAGES.html

I suppose you could also use wget instead of rsync if you prefer.

Auto Startup
To check what programs are started on your box automatically execute command:
ls -al /ffp/start
Programs that have ‘x’ in their attributes are invoked when DNS-313 starts, the others don’t.
You can turn them on of off simply by modifying attributes:
chmod a+x <stuff_i_want.sh>
chmod a-x <stuff_i_dont_want.sh>

FINAL IMPRESSIONS
==================

To sum it up in the words of Kanye:  Me likey.

  • At less than $150 for the unit (drives extra), this thing offers great bang for the buck.
  • In my case, it replaces almost everything I use my desktop PC for.
  • It’s Flexible.  Very hackable — meaning you can make it do what you want. With a bit of *nix hackery, quite easily.
  • It’s quiet and doesn’t use a lot of power.
  • It supports HD-spindown.
  • It has a big fan in the back (looks like 80mm) which is rather silent.
  • It has cool blue LEDs.  And they blink A LOT.

Stay tuned.  In Part 2 I’ll show you how to use this thing as a low-cost Apple Time Machine, and I’ll illustrate how I replicate data between both drives for redundancy.

Edit 29-10-08: Check out my other d-link dns 323 articles here.

Edit 11-06-08:  Added additional functionality to the torrentwatchdog.sh script, including doing away with an /incoming directory in favour of /media/ directory and subdirectories to keep my media library organized.  Also added support for Tranmission to stop seeding when the download is complete.  See here.


147 Comments to “hacking the d-link dns-323 soho nas”  

  1. 1 Jerod

    Nice job!
    The blog looks convincing; you should see if D-LINK will sponsor your website! :-)

    firmware 1.05 is supposed to have its own BitTorrent client built in; have you worked with that?

    I’d be curious to see the power savings?
    My server at home usually draws ~ 150W; an older computer with a few drives in it. My newer 65W AMD X2 system draws 100W with a single drive.

    Do you have the ability to scope the power requirements out for this machine?

  2. 2 admin

    Yes firmware 1.05 has its own BT client built in, but there’s a bug with it that (apparently) won’t let you delete downloaded files. I generally don’t trust anything with dlink’s name on it, so that’s another reason why I’m not using much of the out-of-the-box functionality.

    Reviews I have read on the DNS-323 gloat about how little power it consumes. E.g. from http://techdigs.net/content/view/158/46/ see “Power Usage and Noise”. Also see http://wiki.dns323.info/talk:start

    I’ll also point out that this thing is pretty damn quiet.

  3. 3 admin

    ooh, pink comments. wow. that sucks.

  4. 4 w00blyn

    Good day eh
    I as well just picked up one of these fabulous boxes, for the sole purpose of backing up my mp3 and DVD collection. It does this very well.

    I wish I would’ve found your blog earlier! I did pretty much everything exactly the same, right up to the watch folder, except I had to scour many posts when you’ve laid everything out so nicely :D
    I was wondering if you know how detect finished downloads? Perhaps a script that automatically searches for *.rar and decompresses them, maybe even copy finished downloads to a different folder and change the permissions (to edit from a mapped network drive).

    Nontheless, great post!

  5. 5 admin

    Sure, I’ve actually been thinking about adding to my torrentwatchdog script to monitor the output of Transmission to stop seeding at 1:1 (and/or removing torrent files when done).

    transmission-remote -l will list running torrents:

    /mnt/HD_a2/torrents # transmission-remote -l
    ID Done ETA Up Down Ratio Status Name
    3 42% 14 min 0.0 460.7 0.0 Downloading ubuntu-8.04.1-desktop-i386.iso

    What you want to do is write a script to identify the ID of finished torrents. Then remove that torrent.

    Piping into awk will give you the 3 fields you need to check:
    # transmission-remote -l | awk ‘{print $1, $2, $6}’
    ID Done Ratio
    3 42% 0.0

    The rest should be a simple shell script to run every 15 mins or so…
    For each line that does not contain the literal string “ID”:
    If ( done = 100% && ratio > 1 )
    transmission-remote -r -t ID_NUM
    endif
    done

    Maybe I’ll add that in part 2 of this article :)

    …You could also write a script that searches for *.rar in /mnt/HD_a2/incoming/ and automatically uncompresses the files for you, then removes the rars. I like that idea too.

    Even better still, you could set it to move finished downloads by directory by modifying the incoming folder structure slightly… e.g /incoming/tv, /incoming/movies, /incoming/mp3s. Just drop each .torrent into one of those categories, and have the watchdog script search for finished torrents, unrar them if necessary and then move them to something like /library/tv, /library/movies, /library/mp3 respectively. That would take a bit of time to write, but it can be done fairly easily.

  6. 6 lu

    You say above that you can’t read the drives if you pull them and stick them in a pc. This is incorrect, you can read them (install the ext2 fs driver from http://www.fs-driver.org/) and you get r/w access. Or you can insert the drive in a linux box and mount the drive as normal (you may need to specify that the fs type is ext2 depending on the distrib). If you don’t have a linux box you can boot linux (e.g. ubuntu) with a livecd which will allow you to run linux without making any changes to your machine (i.e. run it off the cd) and then mount the drive. The main question is do you want redundancy or backup. If you want redundancy then go for raid, if backup, then another solution (i.e. nightly/weekly sync/backup) from volume_1 to volume_2 is for you. See http://wiki.dns323.info/ (and associated forum) for a few suggested methods.

  7. 7 cheongseeker

    Very nice and clear instruction. Thanks a lot.

    I would like to find out how can I put add 2 user names and passwords for access to /mnt/HD_a2/incoming/ via ftp. Your instruction above looks like anyone can gain access to that folder. I would like to be able to set who I want to grant access to the particular folder.

    Can it also be set for /mnt/HD_a2/torrents as well?

    I thinking of able to ftp to the /mnt/HD_a2/torrents folder while I’m not at home. This way I can still sent .torrents to the folder and let transmission monitor it and add in automatically.

    I’m do not understand linux script or commands, thus would appreciate if you can help me out.

    Thanks.

  8. 8 admin

    lu: thanks. what I meant was if you have two drives in a RAID 1 array, you can’t take a single drive and throw it in a PC (not that you’d ever want to, except maybe for lazy backup purposes before trying to rebuild a failed array). But yes, at the end of the day it all comes down to disk redundancy vs data backup. That is why I started hashing out my requirements by asking those data criticality questions.

    cheongseeker:
    you can change FTP access from anonymous to specific users by not making the FTP server anonymous. I only did so for quick and dirty testing. For password-protected FTP, you can add users through the dns-323 web interface, and then set them up under the FTP tab with appropriate folder permissions. (Do this all from the “advanced” tab).

    if you want to be able to add torrents remotely, there are a couple of options.

    * Option 1 would be through transmission’s web interface on http: //NAS:9091/transmission/web/
    * Option 2 as you described would be through FTP. (Add a user with appropriate permissions to /mnt/HD_a2/torrents).

    In both cases you would have to expose either HTTP (tcp/9091) or FTP (tcp/21 and tcp/20) ports to the outside world. If your DNS-323 is behind a router that means you have to map these ports / poke a hole in the firewall.

    I think Option 1 might be the best choice because a) its less work, and b) it gives you the ability to monitor the status of your torrents remotely.

  9. 9 cheongseeker

    Hi,

    Many thanks for your advice. I’m now trying set up the USB storage module.

    When I key in “obtain usb-storage.ko” I get “-sh: obtain: not found”

    Do not how to rectify this. Need your advice.

    Thank you.

  10. 10 cheongseeker

    Hi,

    I have encountered another problem and it’s the part on auto-torrent downloading. The .torrentwd.log show the following error.

    Unable to parse response “Error: 401″

    I can manually add in the torrent and confirm that it will start the downloading but when trying to do the auto-torrent downloading, I get the above error.

    Your help is much appreciated.

    Thanks.

  11. 11 badmanhop

    Hi, thanks for the good tutorial but i have run into a few problems following your guid could you help me please?

    1. ok i was following the guid and got the transmission software installed then some how got lost around that point and now i cant log on with telnet or shh,
    2. can i correct this problem as the drive is working and i have tested transmission and its working fine but i dont want to reboot the dlink box incase it dont work again.
    3. ran some tests and can get onto some telnet login ref:
    220———- Welcome to Pure-FTPd [TLS] ———-
    220-You are user number 1 of 10 allowed.
    220-Local time is now 19:45. Server port: 23.
    220 You will be disconnected after 2 minutes of inactivity.
    then nothing else i cant move from this point, what have i done wrong can you tell?
    hope you can help me here as all this is new and i have just spent £250 on this little box and dont want to mess it up.
    thanks badmanhop.

  12. 12 badmanhop

    ok im back just rebooted the dns 323 and started putty (shh) in windows vista and it needs a login name and password.
    i tride what i set : admin
    password : ********
    it tells me the password is out of date and must be changed, so i did this and it just keeps looping back to my old password, can you please tell me what im doing wrong so i can follow the rest of your guide as im sort of stuck.
    thanks badmanhop

  13. 13 admin

    cheongseeker: what I meant by “obtain usb-storage.ko” was to actually get the file and transfer it to the 323. See this forum thread.

    No idea why you’re getting an http 401 error. First I would suggest rebooting the device, second, make sure you’ve copied my torrentwd.sh script exactly.

  14. 14 admin

    badmanhop: if you are telnetting to the device and you see pureftpd, you are connecting on the wrong port. telnet is tcp/23. if you are seeing the pureftpd banner, you are connecting on port 21 by mistake.

    what you should do is fire up telnet to the correct port and hopefully you can log in without a username or password. redo the section on setting up ssh, taking care to do the pwconv, passwd, usermod, login part properly.

    if things are really FUBAR’d, you can just delete the “fun_plug” and “ffp” directory from the Volume_1 directory, reboot, and reinstall following the whole procedure over again. Simply removing these files/directories should return everything to normal.

    good luck!

  15. 15 badmanhop

    Hi,
    ok found what i was doing wrong i can now log in with shh and carry on with your scripts, been hard for me as never done this before but thanks to your tutorial its been great, just having trouble setting up the auto torrent checker for downloading torrents automatically from part 6 of your guide.
    still im learning and getting it right as its downloading fine but just not auto-in yet.
    thanks badmanhop.

  16. 16 Russ

    Cheers for this. Got transmission runing nicely thanks to this guide. I also found the script needed to stop seeding after a certain ratio here: http://forum.transmissionbt.com/viewtopic.php?f=7&p=30301
    works like a charm now.

  17. 17 cosmo

    I’ve been trying to get the auto torrenting to work but I keep on getting the following error when I try to run ./editcron.sh:

    Line 17: syntax error: Bad fd number

    Any thoughts?

  18. 18 cosmo

    I figured it out, when copying the text the quotes never came over correctly for the editcron section, manually did them and it works. Thanks for the write up.

  19. 19 admin

    russ: thanks dude!

    cosmo: nope, not sure. what is your line 17? (open up vi, :17 ).
    My line 17 is: /bin/echo “0 * * * * /ffp/var/scripts/torrentwatchdog.sh >> /mnt/HD_a2/torrents/.torrentwd.log 2>&1″ >> $CRONTXT

    Note that if you copy the raw text off the blog entry and paste into vi, you might not have got the quotes properly (”"). Also make sure the 2>&1″ >> $CRONTXT is on the same line (hard to see from the blog quote).

    edit: glad you got it working :)

  20. 20 Oscar Sommerbo

    Hi Horto.
    Nice tutorial and geared to the uniniated. I liked your watchdog-script so I tried to expand on it only to find that busybox isnt exactly bash :) So I will post my unworking unrar script hopefully you can point out what Im doing wrong. It was years since I did any bash-scripting and im pretty rusty.

    #!/bin/sh
    #################################################################
    # .-[ unrarscript.sh ] .-
    # Script to monitor a torrents for completion and unrar them. Inspiration and format from
    # Horto at www.horto.ca
    # TODO: make transmission stop after seeding 1:1.5 and delete rar-files
    # after successful unpacking.
    # 10/26/08 Oscar Sommerbo
    #################################################################
    TORRENTDIR=/mnt/HD_a2/torrents
    TRANSMISSION_REMOTE=/ffp/bin/transmission-remote
    DOWNLOADDIR=/mnt/HD_a2/downloads
    UNRARLOG=$DOWNLOADDIR/.unrarlog.log

    for DIRECTORY in $TRANSMISSION_REMOTE -l|awk ‘{print $8}’; do
    if [”$DIRECTORY” != “Downloading”]; then
    #unrar x -ad -cl -y $DOWNLOADDIR\$DIRECTORY\*.r01
    echo [’date’] $DIRECTORY unpacked.
    fi
    sleep 1
    done
    exit 0

  21. 21 admin

    Oscar: The reason your script isn’t working is because you need to specify the explicit filesystem path to the .rar when passing it to the unrar command. In your case, the $DIRECTORY variable will not grab that. It’s more tedious than it sounds.

    However! I wrote a new script (unpacker.sh) to do the unpacking tasks. It is a completely separate script from the torrent watchdog. You can grab it here: http://www.horto.ca/scripts/

    To use it, run it as a cronjob like torrentwd.sh. Remember that to make cronjobs persistent, you need to use editcron.sh (refer to the article above).

    Therefore to set the unpacker.sh up as a cronjob, append a line in editcron.sh like this:

    /bin/echo “0 * * * * /ffp/var/scripts/torrentwatchdog.sh >> /mnt/HD_a2/torrents/.torrentwd.log 2>&1 >> $CRONTXT
    /bin/echo “30 3 * * * /ffp/var/scripts/unpacker.sh >> /mnt/HD_a2/incoming/.unpack.log 2>&1 >> $CRONTXT

    That will make unpacker.sh run at 3:30am every morning. This way, the cpu-intensive unarchiving takes place once per day. (Instead of once per hour, like torrent watchdog).

    If you have questions email mike at horto dot ca.

    PS: I also updated my torrentwatchdog script to stop completed downloads. You can grab it @ http://www.horto.ca/scripts/ as well.

  22. 22 adde

    Thank you for an awesome guide.. took a while to figure out how VI worked (n00b on linux) but i finally got it up n running..

    Got a question about how often the watchdog is being run.. is it possible to make it check for new torrents ever fifth minute or so? I’ve tried to insert different numbers at different places in the editcron but it doesnt seem to work ;s

  23. 23 Marcus

    Hi,

    thanks a lot for this howto. It saved me a lot of time when setting up my CH3SNAS :-)))

    As you mentioned aslo, I’d like to replicate my data from 1st to second drive.
    Yesterday, I stumbled over dirvish. (http://www.dirvish.org/)

    Dirvish is a perl based backup tool which uses rsync to replicate data - even remotely.
    It could create daily backups and keep these for e.g. 1 week, keep 1 per week for a month and one monthly for every 3 months. (This is totally configurable).

    Did you have a look at that or a similar tool or are you planning to use rsync directly with own scripts?

    I’ll keep you posted if I make progress before you do ;-)

    CU
    Marcus

    PS you can contact me by email to discuss this further

  24. 24 admin

    adde: man cron
    what you want is to change the “0 * * * *” part to */5 * * * *, which will execute the script every 5 minutes. Note that with the script running on harddrive HD_a2, this will prevent that drive from ever spinning down.

    Marcus: I haven’t set up rsync yet - still debating exactly how I want to do it. But check out this thread, and the resulting BackupNetClone scripts. Let me know how you make out!

  25. 25 adde

    worked like a charm, big thnx.

    are you thinking about writing a script that organizes downloads into different folders depending on which “torrentfolder” you’re droping then in? darn i would love that..

    know any great guides for learning to write scripts? :D

  26. 26 cheongseeker

    Hi,

    I think I know the reason for the “Error: 041″.

    I had follow the DSM-G600, DNS-323 and TS-I300 Hack Forum to have a user name and password whenever I access http://:9091/transmission/web

    I follow the following instruction

    “export TRANSMISSION_HOME=/mnt/HD_a2/.transmission”
    “export CLUTCH_HOME=/ffp/share/transmission/web”
    “transmission-daemon -f -t -u -v -a 0.0.0.0/0″

    If this the reason for the error, then how can I put this in the torrentwatchdog.sh script.

    Thanks.

  27. 27 admin

    cheongseeker: if you enabled user/password authentication, then you must pass that same username and password to the transmission-remote daemon.

    At the header of torrentwatchdog.sh, change:
    TRANSMISSION_REMOTE=/ffp/bin/transmission-remote
    to:
    TRANSMISSION_REMOTE=/ffp/bin/transmission-remote -n uname:passwd
    Replace “uname” and “passwd” for the username and password you use to login to the transmission web UI.

  28. 28 badmanhop

    Hi Horto,
    just want to thank you for this page as i went from been a total none script speeking person to getting my 323 up and running and working fine all with your help, keep up the good work and its great to find some one who takes the time to teach others.5*
    and this black box(dns 323) is great i love it but can you answer this for me, i use utorrent on my pc with forced encription behind a firewall and peergaurdian running and my internet provider gives me a good download speed with little speed capping, but now with the black box (dns 323) doing all the work i have noticed the speed capping is back so is there any way to prevent this and can my inernet provider see all on my black box and see and read transmisson now?

    thanks badmanhop.
    (5 stars from me.)

  29. 29 roloc

    Hi,

    I’ve successfully installed transmission, but am trying to log back in as root through ssh to setup auto-torrent downloading and my password isn’t working… After the third failed attempt, I get “Permission denied (publickey,password,keyboard-interactive).” I’m very new at all of this, so don’t know what my options are for resolving this problem. Thanks!

  30. 30 cheongseeker

    Hi Horto,

    Thanks for the advice. I’ve change the TRANSMISSION_REMOTE as per your reply. Now I encounter the following error in the log.

    [Mon Nov 3 02:00:01 CST 2008] /mnt/HD_a2/torrents/OOo_3.0.0_Win32Intel_install_en-US.exe.torrent added to queue.
    -a: No such file or directory

    [Mon Nov 3 02:00:01 CST 2008] /mnt/HD_a2/torrents/OOo_3.0.0_Win32Intel_install_en-US.exe.torrent deleted from directory.

    The file is deleted from the torrents directory but I do not understand “-a: No such file or directory” error.

    Thanks.

  31. 31 cheongseeker

    Hi Horto,

    I’m append the torrentwatchdog.sh script here so that you can help look if there is something that I had done wrong.

    TORRENTDIR=/mnt/HD_a2/torrents
    WDLOG=$TORRENTDIR/.torrentwd.log
    TRANSMISSION_REMOTE=/ffp/bin/transmission-remote -n vertu:Payau81

    for FILE in $TORRENTDIR/*.torrent; do
    if [ “$FILE” != “$TORRENTDIR/*.torrent” ]; then
    echo [`date`] “$FILE” added to queue. >> $WDLOG
    $TRANSMISSION_REMOTE -a “$FILE”
    rm “$FILE”
    echo [`date`] “$FILE” deleted from directory. >> $WDLOG
    sleep 1
    fi
    done
    exit 0

    Thanks.

  32. 32 admin

    cheongseeker: sorry man, not sure why you’re getting that error. maybe try the full transmission-remote -n vertu:Payau81 -a /path/to/file.torrent on the commandline and see what gives… i take it that if the torrent is being added to transmission then its still working!

    roloc: redo the section on setting up ssh, taking care to do the pwconv, passwd, usermod, login part properly. especially store-passwd.sh part, so it saves the new admin password.

    badmanhop: you can set forced encryption via the transmission web interface in the preferences section. I think you can also configure port. however you are right, unlike your PC setup, there is no peer guardian running on the 323. if speed capping is the issue it’s probably got to do with what port you’re running on, or router/firewall issues.

    adde: check the homepage of my blog soon for an updated torrent watchdog script that does away with the /incoming directory and monitors /media instead. this will keep everything organized.

  33. 33 cheongseekr

    Ok. I will try it and let you know what is the outcome.

    Thanks.

  34. 34 adde

    Damn i can’t love you any more.. D-link should definetly give you credit for making their product 10x better.

  35. 35 Judy25476

    @admin:
    I did point 6. AUTO-TORRENT-DOWNLOADING!, but I do not understand how and what I have to change for “Edit root crontab to check this directory for new .torrents, every hour, on the hour:”
    How do I edit the root crontab, what is the name of the file and what do I have to change for checking every hour for new torrents?
    And is it a must to create the editcron.sh to let it work?
    I’d like to say, you did already a great job, txs.

  36. 36 admin

    judy: cron is the unix scheduler, you need to edit the crontab to set up scheduling “every hour on the hour”. if you run the editcron.sh script it will automatically add it — provided the path to torrentwatchdog.sh is the same.

    grab the script from www.horto.ca/scripts because if you copy and paste it from the blog you may have issues with the quotes (stupid wordpress blockquote formatting). You must put the script (editcron.sh) in /ffp/start/ and make it executable if you want it to survive a reboot.

  37. 37 badmanhop

    Hi Horto,
    thansks for the info.
    well like i have said and many others that find your page, you are a “Saint” thanks for all your help and Dlink should pay you for making the little box an esential home buy, its the best £250 quid i have ever spent thanks to your teachings.
    thanks badmanhop.

  38. 38 adde

    Hi again :)
    I’ve encountered another problem, cant edit or delete files that transmission downloads.
    or.. yea i can but i need to ssh on to the box and set chmod 777 for the media folder but when i download a new torrent that folder gets 755 although.

    i’ve also tried to run the daemon under my network share user (so that it would create folders owned by it) but it made the daemon stop responding (dunno if i did it the right way though lol)

    Sooo.. got any solution? :/

  39. 39 adde

    Nevermind i actually managed to fix something myself :p

    Needed to change owner of the .transmission-daemon directory too and now it creates downloaded folders which my user owns.. kickass xD

  40. 40 Judy25476

    @admin:

    Oke, I downloaded the editcron.sh script and placed it on the NAS. Performed every step as you explaine, but still it will not automaticly scheduale/start a torrent file that I placed in Torrents directory. I changed it in the editcron.sh script, the capital T. But it is unclear to me when the script starts, does it start on whole hours 11:00 or 22:00? Already thanks for your help.

  41. 41 Judy25476

    I also read some where that it must be able to connect remotly to your NAS and play the files that are on the NAS, but I can not find it anymore. Does anybody has a link or something? txs

  42. 42 admin

    judy: if you made the editcron.sh script executable, it will kick in after the 323 is rebooting. either reboot the 323, or run the script manually on the commandline (just once) by typing ./editcron.sh — you can then verify that the crontab was modified by using the command ‘crontab -l’ (no single quotes). you should see the updates. and yes, it runs every hour at the top of the hour - 11:00, 12:00, 1:00, etc…

  43. 43 judy25476

    I checked with the command ‘crontab -l’, without the single quotes ;-), and I see this:

    /mnt/HD_a2 # crontab -l
    32 2 * * * /usr/sbin/rtc -s
    30 2 2 * * /usr/sbin/rtc -c
    59 1 * * * /usr/sbin/daylight &
    0 * * * * /ffp/var/scripts/torrentwatchdog.sh >> /mnt/HD_a2/Torrents/.torrentwd.

    I don’t know if this is good?
    So the torrent will not automaticly start, and at a certain time the NAS switches of automaticly??

  44. 44 admin

    judy: no, that’s good, that’s what its supposed to be. and it will automatically start up again on reboot. If you are still having problems with it, then maybe you did not update the torrentwatchdog.sh with the location to your torrents directory correctly. (TORRENTDIR=/mnt/HD_a2/Torrents ?) It is case sensitive, so if your directory is “Torrents” instead of “torrents” you have to edit the TORRENTDIR variable definition in the script.

  45. 45 judy25476

    Nop did changed it correctly?

    #!/bin/sh
    ##############################################################################
    # .-[ editcron.sh ] .-
    # script to keep cronjobs persistent (e.g. after reboot)
    # w 22/10/08 horto
    # ref/credit: http://tinyurl.com/5m2349 - thanks chumby!
    #############################################################################
    FFP=/mnt/HD_a2/ffp
    CRONTXT=$FFP/etc/crontab.txt

    # start with existing crontab
    # note: on a fresh reboot, this will always have been reset to standard
    /bin/crontab -l > $CRONTXT

    # add cronjobs here preceeded by /bin/echo.
    # don.t forget to enclose them in double quotes.
    /bin/echo “0 * * * * /ffp/var/scripts/torrentwatchdog.sh >> /mnt/HD_a2/Torrents/.torrentwd.log 2>&1″ >> $CRONTXT

    # install the new crontab
    /bin/crontab $CRONTXT

    # clean up
    /bin/rm $CRONTXT

    How can I check with the ‘ps’ command that everything is running?

  46. 46 admin

    judy: you have to change torrentwatchdog.sh too. not just editcron.sh.

  47. 47 judy25476

    like this, I forgot to change it, I did it and rebooted. Does it now look oke?

    #!/bin/sh
    #################################################################
    # .-[ torrentwatchdog.sh ] .-
    # script to monitor a specific directory for new .torrent files.
    # if found, queue them up in transmission
    # TODO: make transmission stop after seeding 1:1
    # w 10/20/08 horto
    #################################################################
    TORRENTDIR=/mnt/HD_a2/Torrents
    WDLOG=$TORRENTDIR/.torrentwd.log
    TRANSMISSION_REMOTE=/ffp/bin/transmission-remote

    for FILE in $TORRENTDIR/*.torrent; do
    if [ .$FILE. != .$TORRENTDIR/*.torrent. ]; then
    echo [`date`] .$FILE. added to queue. >> $WDLOG
    $TRANSMISSION_REMOTE -a .$FILE.
    rm .$FILE.
    echo [`date`] .$FILE. deleted from directory. >> $WDLOG
    sleep 1
    fi
    done
    exit 0

  48. 48 admin

    judy: yeah, that would have been your problem. hope it works now …

  49. 49 judy25476

    we are getting somewhere, I thing this will be the last hurdle. I can now see the log file and I see this:

    rm: cannot remove `./mnt/HD_a2/Torrents/Urbanus_-_Live_En_In_’T_Echt.torrent.’: No such file or directory
    [Sat Nov 8 00:00:01 GMT 2008] ./mnt/HD_a2/Torrents/Urbanus_-_Live_En_In_’T_Echt.torrent. deleted from directory.

    Is this a directory right thing?

  50. 50 admin

    judy: check it against http://www.horto.ca/scripts/dns323/torrentwatchdog.sh … somehow the script on your dns-323 has periods where it should have double quotes.

    eg
    if [ .$FILE. != .$TORRENTDIR/*.torrent. ]; then
    echo [`date`] .$FILE. added to queue. >> $WDLOG

    should be

    if [ “$FILE” != “$TORRENTDIR/*.torrent” ]; then
    echo [`date`] “$FILE” added to queue. >> $WDLOG

    there are more lines like that

    if you literally copied and paste from the blog i’ve seen issues where the paste changes double quotes to different characters, like periods.

  51. 51 judy25476

    Sorry for the trouble, but it works. Thank you very much for your direct help.

    Regards..

  52. 52 badmanhop

    Hi Horto,
    can you help me please, everything has been working fine for a week or two then i had a power cut, dns rebooted and now i cant login with ssh all i get is busybox screen tellnet is turned off, and the transmission progam will not download any more, so i checked the settings screen destination folder is set to /mnt/HD_a2/incoming but when i try to start a download all i get is destination folder does not exist. any ideas what has gone wrong please and how do i gain access again to root in ssh, thanks for ya time.
    ps. i dont realy want to wipe my drive and start again as it took me ages to learn from your site and my incoming folder is loaded with my games.
    badmanhop

  53. 53 badmanhop

    Hi Horto,
    sorry to keep pestering you but i have been working on the problems above and regained access by redoing the ffp install, now i have telnet access and transmission is up and runing, the only problem i have is that any new downloads will not start they say the destination folder does not exist and then it pauses, do you know what could be causing this, i have checked the cogs setting and it points to /mnt/HD_a2/incoming.
    thanks again.
    badmanhop.

  54. 54 roloc

    Hi Horto,

    A big thanks for your tutorial and quality responses to all of our questions.

    I have transmission running without issue, except for the fact that when I’m downloading or seeding files my internet connection crawls to a halt on my other computers. This happens regardless of whether I’ve limited my up/down speeds to a really low kb. If I pause all of my torrents (and I only have 6 right now…) the connection returns to normal.

    I know bittorrent speed/connection issues can be tricky, and particular to an individual’s setup, but I’ve forwarded my port properly and have never had this kind of problem when running bittorrent on my PCs. I’m stumped.

    Any advice?

    Thanks again.

  55. 55 Yo!Adrian, eh?

    When I run [funpkg -i curl-7.18.1.tgz] I got the following error:
    tar: Unrecognised file type
    FATAL: curl-7.18.1.tgz: Failed to unpack package

    That looks like a corrupt .tar to me but I deleted and re-downloaded the files, same thing. Any clues..?

  56. 56 topikito

    Hi !!

    I haven’t done this yet (actually I’m at work). I’ll do it when I come home. But I’m so impressed that I would like to thank you for doing this. Also I want to thank you for replying ALL the comments !!! It’s very hard to find someone that wants to HELP people. I know the forums and that kind of sites, but they usually treat you as an incompetent. You have no problems by explaining a noob (like me) that they’re doing wrong.

    Lot’s of thanks again !!

  57. 57 topikito

    Hi !!

    Thanks again for the tutorial. I’ve done it all. But i’ve got a problem (?) with Transmission.

    I save the .torrent in it’s file, the “watching dog” works, and adds the torrent to transmission. It begin downloading, but when it finally connect to a seeder, it shows: Permission Denied.

    What’s the problem ? :S

  58. 58 Najib Hassan

    Hi geek X:D

    Possible to write guide about hotwo upgrading Transmission 1.34 to 1.40?

  59. 59 Eric

    The comments/opinions concerning RAID had me worried.

    However, although not the best of sources, Wikipedia had the following to say:”Additionally, Software RAID1 disks can be read like normal disks, so no RAID system is required to retrieve the data.”
    http://en.wikipedia.org/wiki/RAID

    So the concerns of losing data due to incompatible controllers in the event of controller failure may be an issue in other RAID settings, for RAID1 there is no danger. Any time a disk fails, either replace the failed disk and rebuild the mirror, or use the good disk as is in any other machine. If the controller fails, you have two disks that can be used in any machine.

    So the article linked isn’t actually valid for the case of RAID1.

    I’d be happy to be corrected if my understanding is incorrect.

  60. 60 topikito

    Hi !! I’ve solved the problem… “chmod 777″ the folder of incoming bt downloads :D

  61. 61 Ed

    I tried to change the folders permission, along with the files but the downloaded BT files still cannot be deleted using Windows Explorer. Had to telnet to remove them. :-(

  62. 62 Mathachew

    Can this hack be applied to the DNS-321?

  63. 63 admin

    eric: thanks, that is good to know. might be nice to actually perform a physical test of that with a 323. (build raid1 across both disks, move a test file, yank a drive and mount the drive in another computer.

    matachew: sure… they are the same thing! (on the inside anyway). the only difference is the 321 doesn’t have a USB port.

  64. 64 Savyy

    Hi Man!

    Have you managed to find a way to “Wake on Lan” the dns-323? The story is complicated…:

    I use my old laptop (pc) as my server, and most importantly, torrent downloading station. I use the DNS for my backups, and, for all the torrent files (being downloaded and downloaded). It works smoothly! I’m leaving for vacation for Christmas and want to leave my torrents downloading (and add new ones remotely).
    The thing is, that if there is a power failure for even 1 second, the DNS will turn off and boom. The laptop has a battery, so it’ll survive… It happened to me already twice, that the DNS-323 shut down… How can I turn it back on without “pushing the button”?

    I tried WOL, but it doesn’t even react… saddly… Any ideas?

    Peter

  65. 65 Jake

    I tried to change the folders permission, along with the files but the downloaded BT files still cannot be deleted using Windows Explorer. Had to telnet to remove them. :-(
    —————————

    im having this problem too, anyone got a fix on it? this is driving me crazy. I can delete files but it’s via ssh :-(

  66. 66 admin

    savvy: what if you put it on a UPS?
    jake, ed, etc: make sure you chmod -R to make it recursive! I think this is where everyone is getting confused, sorry …

    change

    chown nobody:501 incoming
    chmod 755 /mnt/HD_a2/incoming

    to

    chown -R nobody:501 /mnt/HD_a2/incoming
    chmod -R 755 /mnt/HD_a2/incoming

    Running the two commands above should fix things!

  67. 67 Savyy

    Yeah, I’m thinking of that - but before i would do that i wanted to be sure there is no other way.

    Well If you bump into any idea, how to turn it on remotely, would be great anyways. But still this site is great! thanks man!

  68. 68 Jake

    hi, thanks a lot for this wonderful guide.. im a mac newbie and linux and luckily i been able to install this thanks to your guide..

    my only problem now is installing the usb-storage.ko, i cant seem to to it? i think there’s a problem with your guide or maybe it’s just me.. Can you please update it for us newbies..

    once again, thanks to you :)

  69. 69 badmanhop

    Hi Horto,

    badmanhop again, just a quick question has transmission been updated yet?
    i noticed from there site they are running on the following now, transmission-1.41b3,
    if so can we update the 1.34 to 1.41b3 with your help.
    thanks again for all your help in the past.

  70. 70 admin

    badmanhop: no, sorry, no immediate plans to upgrade transmission at this point… all of a sudden too busy these days! if you want to take it on, perhaps with the help of those at the dns-323 forum (http://forum.dsmg600.info/f3-DNS-323-General-Discussion.html), please feel free and let me know how you make out.

  71. 71 Vishal

    Hi,
    Thats a great tutorial.

    I have a problem and may be you can help me out.

    I have 2 pc (win XP pro) connected toa router.my dns-323 is also connected to the router.
    I am running a application on both my PC and the database is on dns-323.

    I did map the drive. but every time I restart the pc the application gives error ” Drive not found.”, I can see the drive. It starts working when I browse the drive on explorer.

    Can you please tell me how can map them automatically.

    Thank you

  72. 72 Matt

    Hey man
    Thanks for the torrentwatcher scripts, they work great. I’ve just recently switched over to shaw cable and my torrents speeds have dropped dramatically, I’m not sure if they’re still packet shaping or what. But anyway, I’ve discovered the megaupload happy hour is pretty awesome with the megafix firefox extension and a program called rapget. Do you know of any daemon download managers with webui’s? Similar to transmission I guess but with http/ftp downloading abilities as well.
    Thanks again!

  73. 73 bradco

    just got me a 323 and updated firmware 1.06 and followed the funplug directions to no avail? is there something different with the new firmware that will not let it install on startup?

    please help (if you can)

    love your post. VERY usefull for od n00bs

  74. 74 admin

    hey bradco,

    no i haven’t updated to 1.06 yet, but lots of folks over at the forum have done so without issue.

    i plan on upgrading to 1.05 -> 1.06 shortly… will let you guys know if i have any problems.

  75. 75 badmanhop

    hi Horto (admin)

    i have updated to 1.06 with no problems and i sent you a message about the update of transmission, did you read it and what did you think, any good ? im having no problems at all.
    thanks badmanhop.

  76. 76 admin

    badmanhop, nope, didn’t see any msgs re: updating transmission. care to post it here in the comments for anyone who’s interested?

  77. 77 Adam

    Can anyone help me please and give me some step by step help to getting the latest version of transmission 1.42 with the web interface installed on the dns 323. The latest version seems to work a bit differently and I am not sure if the steps in this great guide on www.horto.ca will work. I am new but I am somewhat familiar with linux.

  78. 78 badmanhop

    Hi Adam i have just posted a tutorial on here on how i did mine and i think Horto will be checking it over first but it will be up soon my friend please wait for admin to check it.

  79. 79 Consumed Consumer

    Awesome guide! Can’t wait to try it!

  80. 80 admin

    posted badmanhop’s upgrade steps here. thanks!

  81. 81 Knightlite

    Thank you for your webpage. I have been reading and editing for days and I still have not licked the problem. To date I have bought the thing >> Skip steps like HDD’s, Firmware to 1.06, Funplug and scripts install, editcron running, Backup working >> I am here.
    I put this in my crontab and it shows up and it gets added after reboot, but it doesn’t work.
    */5 * * * * /ffp/var/scripts/rbackup.sh >> /mnt/HD_a2/logs/rbackup.log 2>&1
    I put this in as a replacement and it does work, backups happen, the angels sing, 2 long days of reading Wiki’s bears some fruit…
    */5 * * * * /ffp/var/scripts/rbackup.sh
    Now the part I am stuck on is how do I get the log working?
    I know the backups are excessive, I will bump it to every 6 hours after the testing is done.

  82. 82 Steve

    Is it possible to set “read only” attributes on individual files with the DNS-323?

  83. 83 bluecifer

    ok, I’m still a bit of a n00b - what does one have to do to create the ‘replicated’ folder between the two drives? This is an amazing post btw - just got my 323 yesterday and found this right off - best page thus far.

  84. 84 admin

    @Steve, yes, if you are comfortable in the commandline (via ssh). Just chmod 400 (or maybe 444) the files or directories you want. Google “chmod” for more information.

    @bluecifer, sure, see my article on it.

  85. 85 Mathachew

    I have another question about the drive configuration. What if I go through the setup with only one drive at the moment, and add a second in a few months? I want to get two drives, and the cost of space is really cheap, but at this time I’m not comfortable forking out $X for two drives, but I’m interested in going with one for now, get a second another time. So my question is, can it work normally without reconfiguring anything? Also, what about if one of the drives fails and it is then replaced? I’d assume the procedure would be the same, but exactly what would that procedure be? Thanks again!

  86. 86 bluecifer

    ok - so most of this I am good with now - thanks. Still having trouble with the USB section though - it seems I am missing some steps there. I have the usb-storage.ko in the .bootstrap folder but then you lose me at the user-storage.ko/lib line.

    I don’t know if I will ever get used to command line - i used DOS so little back in the day - I’m kicking myself for it now. :)

  87. 87 Mike

    I have to first start by saying I am very new to “hacking” into anything, using any kind of code, or doing any of the stuff required to do this. But I have to start somewhere and I think this is a good start. Having said that I am stuck. the only thing I was able to get started was I copied the files onto the root of voulume 1 and rebooted I see the ffp folder, txt file and fun_plug and that is as far as I can get. I however was not able to even set the ipadress on the dns to static. I have a belkin N router. Can you guys please help me. What do I do next? I am using a PC with windows XP pro. Sorry about te simpleness of my questions, but I dont know what o do.

  88. 88 Scott

    Hi,
    This blog is great. I just got my 323 setup yesterday and it’s working fine between 3 laptops and my HTPC. Win XP home, XP Pro and Vista Home Ultimate all going good despite my unfamiliarity with networking.

    My worry is firewall. I have a Sympatico Speedstream 6300 modem/router which Bell disabled the hardwall firewall on so users would purchase their on-line security suite. I have never liked that idea and always used software firewalls on my PC’s.

    How do keep the DNS 323 secure? I just installed an Asus WL-520 GU as a WAP in the house to enhance the wireless signal. So its DHCP is dis-abled. Should I connect the DNS 323 to the Asus router instead of the Speedstream and enable the firewall?

  89. 89 batman

    For those who are interested, I’m reading on my P3 Kill-A-Watt meter:
    22 Watts used when running after a cold boot
    23 Watts during extended transfer (SMB/CIFS write to over 100Mbps)

    Now Mike, if only OpenSSO was this easy.

  90. 90 batman

    Oh and for those Mac heads out there, make the fun_plug script executable, remove the .sh to make this work. And make sure the tarball ends in .tgz.
    chmod 777 fun_plug.sh
    mv fun_plug.sh fun_plug
    then copy it over to Volume_1 and reboot a few minutes, nmap and bingo
    PORT STATE SERVICE
    23/tcp open telnet
    80/tcp open http
    139/tcp open netbios-ssn
    443/tcp open https
    445/tcp open microsoft-ds
    515/tcp open printer
    3689/tcp open rendezvous

    Does this mean any executable in the root is run after a reboot? That’s scary. I don’t under this exploit.

  91. 91 frank

    Hi!

    Problem with ssh. Login under telnet and I am able to run the funpkg and mount usb. Login under telnet with root account with same results. Login in ssh with root account and password and funpkg not able to run nor able to mount usb.

    Seems to be some priveledge problem with ssh. Please help sine I am a Linux virgin

    Thanks

  92. 92 admin

    @Scott - security, good question! most SOHO routers have built-in firewalls, meaning that most inbound ports are blocked. this is probably sufficient for you and the security of the 323. just don’t place it in the DMZ, otherwise the firewall will be bypassed. There is a security issue in the administrative web interface (or was, in 1.05), that allowed you to read any file on the box without requiring a password, so I certainly would recommend you place yours behind your Asus router or anything that has a hardware firewall. Maybe even consider picking up a linksys wrt54g or wrt54gl. Great little routers.

    @batman - not any executable, just any executable named “funplug” in the root dir of /mnt/HD_a2. “Function plugs” are often used by developers when designing these things, guess they forgot to take it out in this case.

    @frank - that is really strange. what is are the permissions on sshd? see below — make sure its owned by root.

    root@blinky# ls -lF /mnt/HD_a2/ffp/sbin/sshd
    -rwxr-xr-x 1 root root 305808 Sep 30 00:39 /mnt/HD_a2/ffp/sbin/sshd*

  93. 93 Frank

    Hi,

    Ran ls -lF /mnt/HD_a2/ffp/sbin/sshd and obtained the following
    -rwxr-xr-x 1 root root 305808 Sep 30 00:39 /mnt/HD_a2/ffp/sbin/sshd*
    no problems there.

    Please see the following when login under root in ssh:

    /mnt/HD_a2/packages # funpkg
    -sh: funpkg: not found

    /mnt/HD_a2/ffp/start # sh start-usbdisk.sh
    sh: Can’t open start-usbdisk.sh
    /mnt/HD_a2/ffp/start # start-usbdisk.sh
    -sh: start-usbdisk.sh: not found

    but in telnet login both files are functional. Can mount USB under telnet login.

    Help

  94. 94 admin

    Frank, sounds like it could be a path problem. Try this and compare the results when logged in via telnet or SSH. If all else fails I might suggest you download fun_plug and fun_plug.tgz and try again.

    Anyway, echo $PATH in both telnet and SSH. Results of mine:
    root@blinky:~# echo $PATH
    /ffp/sbin:/usr/sbin:/sbin:/ffp/bin:/usr/bin:/bin

  95. 95 Frank

    Thanks for the help. Ultimately had to remove ffp and reload. It worked now.

    BTW great site!

  96. 96 Scott

    Ok thanks for the advice. 323 has been plugged into the Asus router since the day after I posted here. Everything’s peachy and hopefully safe and secure.

    “”@Scott - security, good question! most SOHO routers have built-in firewalls, meaning that most inbound ports are blocked. this is probably sufficient for you and the security of the 323. just don’t place it in the DMZ, otherwise the firewall will be bypassed. There is a security issue in the administrative web interface (or was, in 1.05), that allowed you to read any file on the box without requiring a password, so I certainly would recommend you place yours behind your Asus router or anything that has a hardware firewall. Maybe even consider picking up a linksys wrt54g or wrt54gl. Great little routers.”"

  97. 97 Mathachew

    Looking for some feedback about streaming to an XBox 360. I have had very little luck getting my 360 to read the contents on my DNS-321. I had issues having hacking it, I reset it, reloaded the 1.01 firmware, went to having a RAID 1 configuration, but still, I am unable to access everything properly. Music won’t list, neither will my videos. When I was able to finally access the data on the NAS, I had to use firmware 1.00, and the behavior was odd. I could see about 60 different music albums, even though I have closer to 1000, and about 50 artists, when I have over 200. For the videos, half the time I get no results, the other half, under All_Videos, I get three, which aren’t even videos, they’re mp4 podcasts. The one time I was finally able to view my other videos, the subfolders were a bit wacked.

    Let’s say I have two seasons of a TV show on the drive, and under that are the sub folders Season 4 and Season 5. When I browse Season 4, it lists folders 4 and 5. Under folder 4 would be another 4 and 5. Under both of those would be no videos. Go back to Season 4/4 and then go to 5, where it would also list 4 and 5 with no videos. Another TV show I have has five seasons and I was able to browse those without a problem. So, I have success using firmware 1.00, but not 1.01, on a RAID 1 config, with no hacks. What. the. heck.

    To be honest, I’m regretting getting this device, it’s been nothing but a pain.

  98. 98 MarcZ

    A note on RAID1.

    I configured RAID1 using two 1TB drives and copied some files to the array and then installed the Ext2 IFS For Windows driver (including r/w) from http://www.fs-driver.org/index.html

    I shut everything down and pulled a drive from the DNS-323, and added it to one of my machine’s SATA interfaces. Reboot and voila!

    Activating the drive through the IFS Drive Control panel lets me mount the ext2 drive to any available letter. I can read the data and create files on the drive. Windows sees it as a normal drive, so I’m sure there would not be a problem mounting under Linux.

    So there you have it. A successful physical test of RAID1! Now to see what happens when I return the drive to the array (I did after all make some changes…)

    Cheers,

  99. 99 badmanhop

    Hi Horto,

    Just been doing my checks on my dns323 and found a small fault and was wondering what i have to change to get the torrentwatchdog.sh to allow me to seed more than (100%) as this is causing me some trouble and i must upload to more than 1.1 as the current setting stops the torrent when it reaches 100% download.

    also been doing tests with transmission 1.42 after i updated from 1.34 and have found it cuts me off after a few hours then i have to reboot the dns323, this may be my system needing work rather that transmission software but just thought i would let ya know my findings.
    also found that you can add a block lists to transmission, i think people should know about this to help protect them from the www.
    thanks Badmanhop.

  100. 100 NateDogg___

    Hi Guys,

    Amazingly Useful Stuff here. Just wondered if anyone would be able to let me know if the USER LIMIT of 64 (and 10 groups) on the DNS-323 firmware 1.06 can be hacked to exceed this. Basically I own the NAS drive in question but was looking at getting another one purely as an FTP server but I would need significanly more (ideally unlimited users) to make this NAS box suitable. I am familiar with the device so wanted to simply get another one of these rather than another brand / type but the user limit is the only limiting factor (so to speak)! And also if there is no need for a limit why add one in the first place? surely it can cope with loads of simply usernames & passwords! - All I want is to be able to add a unique user that points to a folder of the same name (effectively a private dropbox) for a growing number of users and I don;t want the solution to fall on its arse as soon as it reaches 64 people and I can’t delete old accounts either. Any advise would be VERY much apprecaited. TIA ;))

  101. 101 admin

    @badman, not a fault per se, but functioning as designed - it will stop when it reaches 100%. To update, you need to look at the string that is captured when tranmission-remote -l is called, grepping for “Done”. You’ll need to test it out and grep for something like 100%. (or 1.1, or whatever the appropriate output of transmission-remote -l is).

    Also, as for block lists in transmission 1.42 , see http://trac.transmissionbt.com/wiki/Scripts/BlockListUpdater — very handy! (maybe I should actually get around to upgrading transmission myself :) )

  102. 102 remy_lebeau

    Ok so i am the one idiot that didnt read this post and never thought of hacking my 323 until i came across this site while looking to see if i can find a better ftp server for mhy 323… unfortunately i have my box running as a raid 1. with two 1tb maxtor drives,, i already have over 400gigs filled up,,,, my question is can i undo the raid1 at this poi nt or am i pretty much screwed. like perhaps take one drive out, format the other one, stick the one with all the info back in… will i have 2 tb at that point? sorry i did mention i was an idiot.

  103. 103 admin

    @remy_lebau: nothing wrong with raid 1 dude! depends what you want, the redundancy or the storage space. with 400gb, you still have a hefty 600gb left, and the benefits of disk redundancy.

    However, if you want more space, you could break up your raid array using ‘mdadm’ on the linux command line, but it’s quite risky and i wouldn’t recommend it unless you are an advanced user. i would for sure you recommend you back up all 400gb of your data to an external disk before you try it. at that point it might even be easier to break up the array using the 323 admin interface if you want to switch to two volumes. mdadm can be daunting.

    but why? if it ain’t broke don’t fix it :) you can still use ffp to hack it if you like.

  104. 104 remy_lebeau

    thanks for the info my next question if i may, its really all the reason i got the box,,, ftp. unfortunately i dont like the ftp that comes with the 321…. can i install one like bulletproof or cute ftp. i would like to see more than anything whos logged in and would like the ability to boot someone off. it would also be nice to use permission features of those programs. im looking into the fun plugins but just want to get a heads up of anyspecific plugin for ftp… it would be awesome if i could install bftp(bullet proof ftp) erver on my box. possible?

    Thanks in advance

  105. 105 NateDogg___

    @remy_lebau: hey dude thats kinda what made me find this site. looking to improve the FTP functions of the 323. my main limitation is the 64 user limit (not online at the same time) just 64 user accounts limit!! sucks. if you find any info out about adding Cute or Bulletproof etc or solving this limit please let me know too! never got a reply here but i think that cos its not really the right place for my question - just couldn’t find anything more comprehensive about the 323 anywhere else. ;)

  106. 106 admin

    @badmanhop:

    here’s some more info for your customizations …

    transmission-remote -l lists running torrents:

    /mnt/HD_a2/torrents # transmission-remote -l
    ID Done ETA Up Down Ratio Status Name
    3 0% Unknown 0.0 0.0 0.0 Downloading ubuntu-8.04.1-desktop-i386.iso

    What you want to do is modify my script to identify the ID of torrents that are a) finished AND b) seeded 1:1. Then remove that torrent.

    Piping into awk will give you the 3 fields you need to check:

    # transmission-remote -l | awk ‘{print $1, $2, $6}’
    ID Done Ratio
    3 11% 0.0

    The logic is roughly:

    Obtain output of transmission-remote -l.
    For each line of that does not contain the literal string “ID”,
    If $DONE> = 100%
    if $RATIO >= 1
    transmission-remote -r -t $ID
    endif
    endif
    end for loop

    this logic should replace the following section of my torrentwatchdog.sh script:
    # stop completed downloads
    for i in `/ffp/bin/transmission-remote -l | grep Done | grep -v Ratio | awk ‘{print $1}’”`; do
    […]

    sorry wordpress munged my beautiful line indentations making the above hard to read

  107. 107 admin

    @remy & @nate:

    guys, i’m pretty sure that your hacked 323 is running pureftpd, a common UNIX ftp daemon (server). Maybe you just need to find a pureftpd management client, such as this one: http://jeanmatthieu.free.fr/pureftpd/

    I’m sure there are several available for windows as well.

    Note - I just verified the 323 is running pureftpd, by starting the FTP service and telnetting to the box on port 21:
    220———- Welcome to Pure-FTPd [TLS] ———-
    220-You are user number 1 of 10 allowed.
    220-Local time is now 09:37. Server port: 21.
    220 You will be disconnected after 2 minutes of inactivity.

  108. 108 YTM

    Hello.

    Thanks a bunch for all the how-to’s !
    I have installed FFP & Clutch-transmission, but i have a small problem.
    I have a 30/30 fiber conenction, but transmission will only give me bout 10/10…
    Sometimes the transm. can jump up to 15/15, but only for a short while (1-2 minutes)…

    Is this a known bug ?
    I understand most people don’t have my connection speed, but what can be wrong?
    Is there a hidden setting under transmission that i can modify?

    I have no problems when i transfer local during ordinary copy’ing.

    In advance - thanks
    YTM

  109. 109 YTM

    Hello again.
    I suspected my router (dir-615) may have been the problem, so i’m testing with another router as we speak (dir-655) with gigabit ethernet.

    Same result, so I’ts obviously a software error.

    What do u suggest I do?

  110. 110 admin

    @YTM: Maybe your ISP is throttling bittorrent connections.

  111. 111 YTM

    No, I’m sure they’r not…
    I have no speed problems when I’m using my regular computer/utorrent.
    I’m get 3.5 Mb/s stable both uploading and downloading.
    Going to upgrade to transmission 1.42 now, to see if it helps.
    Will report back :-)

  112. 112 YTM

    Just finnishing installing clutch/transmission 1.50 all over again.
    This actually solved all my earlier speed problems, so I’m pretty satisfied now :D
    Also i found a GREAT remote gui for transmission 1.40->

    http://code.google.com/p/transmisson-remote-gui/

    This really makes the world a better place to live! ;)

  113. 113 badmanhop

    Big thanks Horto,
    i will try what you have said and see how i get on, just updated to 1.50 its a much better build than 1.42

    so people. its easy to do

    # funpkg -r Transmission-1.42-ffp0.5.tgz
    # wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
    # funpkg -i curl-7.18.1.tgz
    # wget http://kylek.is-a-geek.org:31337/files/Transmission-1.50.tgz
    # funpkg -i Transmission-1.50.tgz
    # wget http://www.inreto.de/dns323/fun-plug/0.5/packages/uclibc-0.9.29-7.tgz
    # funpkg -i uclibc-0.9.29-7.tgz

    # /ffp/start/transmission.sh start
    thats it all done.
    ps you will have found that some of the update you have installed dont worry.
    again its not my own work but work of the clever people like Horto and KyleK.
    Big thanks.

  114. 114 badmanhop

    Hi Horto,
    getting this fault with the change in the script you game me, i removed what you said and added what you wroteis this correct?
    #!/bin/sh
    ###########################################################################
    # script to monitor a specific directory for new .torrent files.
    # if found, queue them up in transmission
    # and when done downloading, pause the torrent
    # w 10/20/08 horto
    # u 10/29/08 horto - implmented “make transmission stop after seeding 1:1″
    ###########################################################################
    TORRENTDIR=/mnt/HD_a2/torrents
    WDLOG=$TORRENTDIR/.torrentwd.log
    TRANSMISSION_REMOTE=/ffp/bin/transmission-remote

    # check incoming TORRENTDIR
    for FILE in $TORRENTDIR/*.torrent; do
    if [ “$FILE” != “$TORRENTDIR/*.torrent” ]; then
    echo [`date`] “$FILE” added to queue. >> $WDLOG
    $TRANSMISSION_REMOTE -a “$FILE”
    rm “$FILE”
    echo [`date`] “$FILE” deleted from directory. >> $WDLOG
    sleep 1
    fi
    done

    # stop completed downloads
    Obtain output of transmission-remote -l.
    For each line of that does not contain the literal string “ID”,
    If $DONE> = 100%
    if $RATIO >= 1
    transmission-remote -r -t $ID
    endif
    endif
    end for loop
    echo [`date`] stopping torrent id $i >> $WDLOG
    $TRANSMISSION_REMOTE -t $i -S
    done

    exit 0

    and i get this following error in my log file.

    /ffp/var/scripts/torrentwatchdog.sh: 35: Syntax error: “done” unexpected (expecting “then”)
    thanks badmanhop.

  115. 115 admin

    @badmanhop: yes I was writing pseudo code; what I provided was the *logic* behind it, not the actual code. you need to translate that logic into actual shell script language/commands! :)

  116. 116 badmanhop

    Hi Horto,

    dam now you got me, im only a fool that messes around, never learnt how to program, lol
    i better go and learn how to program, lets see what mess i can do, im sure i will be back with just a large head ache.
    thanks.

  117. 117 Trako

    Great article! This works fine on a DNS-321 (smaller, sleeker version with no USB) and firmware rev 1.01.

    The only issue, albeit minor, is that Telnet can still be used even after I committed the changes as described. Perhaps I need to go through the steps again to be sure.

    I did have a question regarding the included FTP server. Does it support softlinks or aliases in the FTP folders to access other areas of the device? I’d like to share some files generally with other trusted friends but I’d rather not have to copy the same files in every directory.

    If softlinking/aliasing is supported, I did find some web-based configuration and management tools. However I am not sure what the exact capabilities of the NAS environment are, so any advice with setting these tools up on the NAS would be appreciated.

  118. 118 admin

    @Trako, see above comments. After funplugging, your 321/323 is running PureFTPd. This is a common linux FTP server, so the limitations imposed by FTP are not of the NAS environment, but of the FTP daemon running (PureFTPd).

    As for the telnet issue — make sure that /ffp/start/telnetd.sh is not executable (by running the command: chmod -x /ffp/start/telnetd.sh), and don’t forget to restart the box.

    be cool, stay secure and have fun! :P

  119. 119 Cirip

    Hi Admin!

    Please if it is possible pu in the web the editcron.sh and watchdog.sh scripts.
    Because When I copy and paste it it change some caracters for example: ” will be . and so on.
    So I give a lot of error messages.
    If it possibles please help me!

    Best regards!

    Cirip

  120. 120 admin
  121. 121 Cirip

    Thanks Admin!

    is it possible to use only the cyclice check of the torrents directory? So I dont want to stop the seeeding in 100%.
    How could I modify the script?

  122. 122 Andrew

    OMG Horto,

    Not only was there the irony of me buying the same NAS as someone I know IRL, and finding that you had already done all this when I googled for help setting up the DNS-323 hacks, then the irony of the fact that I also have the same wireless router… NOW from the pictures, I notice you have the same Logitec speakers and LACIE external HD Enclosure. Dood!! What is that?!!?

  123. 123 Matthew

    For some reason I have to access my DNS-323 via the internal IP (e.g. 192.168.x.xxx) instead of the hostname (e.g. XXX). Anyone know why? It has a static IP on the network. I am using Mac OS X 10.5.7. Thanks!

  124. 124 Nigel

    Thank you _so much_ for documenting your progress and for posting this guide. Some of your choices i.e. dual-volume drive with sync folder were just brilliant.

  125. 125 chris

    Great writeup, Horto

    But did I read correctly? If I move a drive from my DNS-323 (running RAID1) to an external enclosure connected through USB, say, the PC (Jaunty) won’t see the files?

  126. 126 Cash

    Hi there, Great Guide especially the Auto-Download Torrent part. Unfortunately, I am unable to get the auto-download to work. Checking the .torrentwd.log

    Do you know what I’ve done wrong by this?

    log:
    transmission-remote: Unable to parse response “401: UnauthorizedUnauthorized User”
    awk: No such file or directory

  127. 127 bern

    Hey,

    I’ve got transmission up and running and it’s downloading torrents. But now my windows box can’t access any of the drives (volume 1 or 2)

    any idea why?

  128. 128 Mike H

    Hi, nice guide for setting up the DNS-323
    I just wanted to leave a comment about how I manage my crontabs at boot.
    I have a entry in my /ffp/etc/fun_plug.local startup file

    ( crontab -l ; cat /ffp/etc/crontab.local ) | crontab -

    then I put any crontab entries I want into /ffp/etc/crontab.local
    Now you don’t have to edit a shell script and worry about properly escaping any ” within your echo’s or other annoying things like that. Just edit your crontab.local.

    Cheers. :)

  129. 129 Ervin

    Hey, this was a great guide. Tnx!

    Is your blog hosted on your DNS-323 machine? I suppose it isn’t recommended to install Wordpress on the NAS(DNS323). Server response is really slow. I have PHP and MySQL running fine with lighttpd (ffp 0.5).
    Is there anything I can try to speed things up? I am pretty sure i followed a guide that had me copy the my-small.cnf file somewhere.

    Oh, and can you recommend a good way to stream music and video files from the DNS over the internet?

    Tnx.

  130. 130 imclumzy

    Hi Horto, thank you for the great article.

    With respect to installing Transmission I’m getting the following errors when issuing the wget commands. Do we know if kylek.is-a-geek.org is still around?

    root@dlink-nas:/ffp/bin# wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
    Connecting to kylek.is-a-geek.org:31337 (91.14.141.112:31337)
    wget: cannot connect to remote host (91.14.141.112): No route to host
    root@dlink-nas:/ffp/bin# wget http://kylek.is-a-geek.org:31337/files/Transmission-1.34-ffp0.5.tgz
    Connecting to kylek.is-a-geek.org:31337 (91.14.141.112:31337)
    wget: cannot connect to remote host (91.14.141.112): No route to host

    Thanks!

  131. 131 Rumba

    Ok, pretty new at linux and brand new at trying to configure my DNS-323. I followed the steps line by line for setting up everything up to and including Transmission, and then stopped there before the auto-loading torrents.
    I load a torrent into Transmission and get “Destination folder does not exist”. I read through all the comments and saw the one on making the folders recursive. Did that, and still, “Destination folder does not exist”. Any ideas on what I’m missing?
    Thanks

  132. 132 badmanhop

    Hi, long time sins i was here but i still pop in now and again to see if any updates are on, well here is one i found that might be of some use to you all.
    After i update the dns 323 for several months now with no problems and all horto’s work has been working fine till now.
    I have upgraded to firmware 1.08, i found that the torrent watch script to have stopped working. when i checked the crontab it did not list the torrentwatchdog.sh so i came back here and read the tutorial again and re did the crontab work around.
    I will report back if it worked.
    thanks badmanhop.

  133. 133 badmanhop

    ok i found that this fix only works bfor a short time or till the dns 323 reboots, so what i need is to know how to fix this for good any one know how?
    thanks badmanhop.

  134. 134 DNS-Newbbie

    Hello i first want to say that this is amazing thing that you are doing. and i and trying to duplicate part of it on a dns 321. however i have run in to a slight problem.. on the auto-torrent-downloading i can not seem to get the script to work or something. i have created the files the log is still in the file torrent. however i can not seem to get the log to turn in to a exacutable. and ideas as to what i am doing wrong?

    Rob

  135. 135 rob b

    Thank you for the info on the dns-323.. the problem I’m having is the dns doesn’t show up under the share section on my mac. I’m running 10.6.2. So I’m unable to even given the hack a run. Or did I miss something on how to have this device show up under Share?

    Any help would do… Yes I’m running firmware 1.08… I just got the device yesterday. I did a restore from the web interface and a restart already

    thank u

    rob b

  136. 136 ..::!NF3RNO>>

    @ rob b
    I am also running 10.6.2 (or whatever the latest is) and with FW 1.08 and I’m having no problem finding/sharing my dns on my lan, which include a few PC and Mac machines. It really should be just plug and play, it will show up under your network places with in a finder window.

    ==== My Problem ====
    I am on the other hand just like badmanhop having a similar issue, with no luck getting the watchdog script or crontab to work with FW 1.08. I get them saved and do the crontab test and even see the watchdog script, but no log file is generated. On reboot crontab disappears.

    ==== Transmission - 1.92 ====
    The links that are posted for tranmission implementation with in this entry are no longer hosted, so is vi library link.

    One plus is that I didn’t have any trouble getting Transmission to run thanks to this shadowandy post (which is kind of burried in another post from this site).
    “Updated guide to install transmission 1.92″ http://www.shadowandy.net/2009/01/transmission-142-for-dns-323.htm

    Thanks horto for all your fantastic work as well as putting together such a great little communty.

  137. 137 badmanhop

    DNS-Newbbie
    if you have made the scripts in windows with note pad,word or most text reader/creators then the scrips wont work as when they convert over in the dns some of the lettering goes out of sink and is replaced with incorrect icons etc best to down load the ones already on here and drag and drop into place, hope this gives you some help in the right direction as this page is almost dead now but the creator was great and helpfull.

    Rob b
    have you read horto’s link on mac time machine is there not something in his tutorial that can help, sorry i dont have a mac but do like the look of em, sleek and sexy comes to mind.
    hope you get sorted with your problem.

    Horto
    if you ever pop back in and read this im still having problems with my auto script comand been wiped every time i reboot, as i said before i have found a long winded way past it but dame im sick of re typing it in, so HELP if any one knows how to stop the dns 323 from re writing the root crontab then please do tell.
    thanks to all.
    badmanhop.

  138. 138 webchick

    I haven’t had a chance to read through this all yet, but just wanted to say THANK YOU so much for writing all this up. I’m trying to solve exactly the same problems you were struggling with and was hedging between a D-Link DNS-323 and a Drobo. Thanks for making the choice an easy one, and for the thoroughness and helpfulness of this post!

  139. 139 MikeJack

    Is there a way to have a HTTPS server running on that box??? Much appreciated.

  1. 1 dns-323 login status info script at horto.ca
  2. 2 hacking the DNS-323 into a poor man’s apple time capsule at horto.ca
  3. 3 updated dns-323 bt download management scripts at horto.ca
  4. 4 Nightly volume backup script for dns-323 soho NAS (rsync+cron) at horto.ca
  5. 5 Upgrading your hacked DNS-323 NAS to use Transmission 1.42 at horto.ca
  6. 6 Trying to fix a corrupted Time Machine backup - epic fail at horto.ca
  7. 7 mod your home router « mobo
  8. 8 Hofsvang.no » Hacke D-Link DNS-323 NAS


Leave a Reply