-
Hacking the D-Link DNS-321 NAS
Posted on November 26th, 2008 18 commentsFor some reason I derive immense gratification from hacking cheap commodity consumer devices and making them do much more than they were originally designed to. Not that I can’t claim all that much credit (as I generally just apply readily available hacks that others have figured out), but still…
Some of my favorite past hacks include:
- Original Xbox: I haven’t played games on it for years, but with XBMC on it, it remains a formidable media center.
- Buffalo WHR-G54S: Essentially a cheap Linksys router clone, but by replacing the stock firmware it can support features typically present on much more expensive routers (such as sophisticated firewall or QoS functionality). I was running the powerful dd-wrt firmware on it for a while, but later switched to the Tomato firmware (also here), which has most of the same features but is a lot easier to use.
- Tivo: Back when I bought my first 40GB Tivo, I hacked it to add a 120GB drive (for a fraction of the normal cost).
My latest addition is the DNS-321 Network Storage Enclosure:
I was previously using an external USB drive attached to my Airport Extreme router, but decided that I wanted to upgrade to a less flakey and fully redundant (but still affordable) storage system for our home. The DNS-321 (or its older and slightly more featureful cousin, the DNS-323) fits the bill. Out of the box, it makes two SATA drives available over Gigabit ethernet via SMB. It supports both Raid 0 (striping) and Raid 1 (mirroring), but I’m using the latter for redundancy. With two 1TB hard drives, this gives me 1 TB of convenient, redundant, and reasonably fast storage, accessible from any laptop or desktop in our house (and our Xbox running XBMC). For solid performance as well as low power usage and noise, Western Digital Caviar GreenPower 1TB hard drives
are highly recommended (and affordable, at around $110 each).
So all of this is already quite a decent package out of the box, but it can be extended much beyond these capabilities (and very easily, too!) All it takes is installing one of several hacks for the DNS-323 / DNS-321. The device turns out to be a full Linux computer (albeit with a small CPU and little RAM), and all it takes to enable all the Linux goodness is to copy a few files to the drive. It turns out that it looks for an executable file called
fun_plugupon startup and executes this if it exists. Various hacks use this mechanism to deploy all kinds of applications, enable telnet or ssh, and more.The simplest way to get started is to install the fonz fun_plug (also known as ffp). The instructions (or these alternative instructions) are pretty simple and straightforward to follow. After the installation, you are rewarded with telnet access to the device, but you will want to make sure to follow the rest of the instructions and set up a root password. I also recommend disabling telnet and enabling ssh instead. You now have a full Linux box at your disposal.
That’s pretty much where I’m at right now. I’m still trying to decide what to do with the device, but the possibilities are wide open. Many applications are either included with or available for ffp, including media apps like Mediatomb or Musicbrowser, server apps such as MySQL, Lighttpd, and PHP (allowing you to run a full LAMP stack!), P2P / Bittorrent clients like Transmission, rsync (so you can schedule offsite backups), subversion, and many more. Apps can be installed with funpkg, a simple package management tool.
There are also options beyond ffp, such as the apparently more powerful Optware package management system that can be installed on top of it. A huge number of packages are available for Opsware. This even includes Ruby and Git, so I’ll definitely have to play with this when I get a chance.
Not bad for a small $130 device.
16 responses to “Hacking the D-Link DNS-321 NAS”

-
Awesome post man! Lots of helpful tips that I hadn’t seen anywhere else! =)
I would love it if you can do a follow up on what you have been able to do with the drive since you started poking around. I just recently purchased the same DNS-321 with two Seagate 1TB drives.
I am certainly looking to do more with the device as well. Especially if I can get something like an automated Bittorrent queing installed on it.
I am fairly new to this whole 1TB+ deal, and find myself overwhelmed with thoughts of how I can fill up all the space. Currently, I am using it as a TV show database to download and catalog all the TV shows that I miss… But more importantly, I’m using it to manage my 40GB+ itunes database.
-
Thanks a lot for DNS-321 roundup. I also bought that NAS and started to hack it.
-
Tony Kirkham June 8th, 2009 at 13:13
Has anyone found an app that will extend the redundancy by adding automated restore snapshots at say the 6 previous hours and a week or months worth of daily snapshots? The drive and the redundancy have been working great for me, however I just ran into the experience where my wife loaded some pictures and then deleted them instead of moving them to another directory.
If there was something like the snapshots available on a netapp on this box this problem could be recovered from, for a time that is.
Thanks,
-Tony
-
Steven July 10th, 2009 at 16:04
Can anyone tell me if I would be able to host a website from a hacked dns-321?? Please DM me on twitter @ Phelix16. Thanks everyone!!
-
Does anyone know of plug-in that will allow the DNS-321 to support Open LDAP??
-
Thanks for the great instructions. Are you actually using rsync on the DNS-321 now? How do you like the performance?
I am currently using cygwin-rsync to back-up my windows laptop, by mounting the DNS-321 disk. I find the performance to be very poor. Do you know if the performance would be better, if I install rsyncd on the DNS-321 and did an rsync using ssh, instead of mouting it as a networked hard-disk?
Your help would be very much appreciated.
-
BoHunter December 15th, 2009 at 20:17
I have the DNS-321 hooked to a Linksys WRT320N Gigabit router (used the cable that came with the DNS-321 to connect it). I have my PC with a gigabit NIC connected to the router and still only achieve a throughput of @ 100Mb. I have tried a few tweaks, including setting the priority up on the port on my router that connects to the DNS-321. I tried to force Gb connectivity via the DNS-321 setup. I also tried changing the packet size from 1500 to 9000 and several in between. None of this has proven successful. Getting about 10MB/sec throughput on this setup.
Any tips on getting better wired throughput?
Wireless (802.11 G), I’m getting 2.9 – 3.2 MB/sec transfter rates pretty consistently. Seems to be what I would expect.
-
Hey is there a way to set the DNS-321 up to operate just like when you’re on the network? I want to be able to double click a video file and play it without downloading it over the internet when i’m traveling.
-
Thanks for the information. XBMC is the best media player..Ever!
-
Jack Stuard January 30th, 2010 at 12:03
I would like to know more information about developing to DNS 321, like if possible using Java.
My idea: To build a jDownload application, for web. This way rapidshare, megaupload and a lot of others sharing web sites will be able to be downloaded by DNS 321
-
Steve M February 6th, 2010 at 09:57
I have had a DNS 321 for some time now and have had a WD 1TB drive in it working as network storage on ethernet and it has worked very well and reliably. Recently I wanted to double it’s memory and add an additional 1TB Hitachi drive to the second bay, but the device won’t recognize it. It flashes the drive light and spins the drive but will not access or list the drive as present. This drive is almost new and was working fine in one of my Windows XP professional running computers. Can anyone give me some ideas as to how to get the device to recognize and format this drive?
-
Steve M, in doing research on this unit I read that the drive has to be completely fresh in order for the 321 to recognize it. I’m not sure if this is your problem but wanted to mention it. Hopefully you’ve already figured this out though based on the date of your post. I’m guessing a fresh drive would require a low level format only which I don’t even know how to do anymore these days in the windows world.
2 Trackbacks / Pingbacks
-
[...] DigitalHobbit » Blog Archive » Hacking the D-Link DNS-321 NAS [...]
-
[...] or FreeNAS, but because of a number of issues, I gave up on that plan, and realized that the (eminently hackable) DLink DNS-321 was on sale for < $100 after rebate. That’s been loaded with a pair of 2TB [...]
Leave a reply



SneezyPorcupine February 2nd, 2009 at 00:45