Wednesday, April 28, 2010

FreeNAS Review

I promised in my last tech post that this entry would continue, and hopefully conclude, my journey towards the perfect Network Attached Storage (NAS) system.  The primary reason I want to use one is to stream TV Shows and Movies to my Samsung 40” LCD TV in my Living Room by means of my AppleTV.  It also serves as a backup location for my important files, and is now capable of performing server related tasks that were previously handled by the AppleTV.  This is my 4th attempt at a NAS solution for the Spitfire Network, the most expensive, the most capable, and finally…the most likely to survive.  For a quick NAS summary:

NAS Solution
Judgment
Cost
Eclipse (Gaming PC)Too loud, power intensive, resource hog
no redundancy
Apple Extreme Wireless Station + USB HDDRan drive continuously leading to failure
no redundancy
Linksys NAS 200Ridiculously Poor Performance, Noisy
Atom / FreeNASBest of all worlds but expensive, large footprint


I tried all the cheap alternatives to buckling down and forking over the cash for a decent NAS / Server but in the end the only lesson is one we should all be familiar with already - You get what you pay for.  In trying to be cheap, all I got in return was lost data (Apple Base Station) and unusable performance (Linksys + hosting files on my gaming pc).  Not that a FreeNAS solution has to be expensive however.  These days many people have a spare PC in their garage or something.  All it needs to be given new life as a FreeNAS server is:

x86 Processor
128 MB ram
32 MB disk space
Network card

The catch is that your hardware has to be supported by FreeBSD, but I’d be willing to bet that if it’s anything similar to a commercial computer, you are all set.  I looked into the option of buying a cheap, used PC for under $100 on craigslist but in the end I decided to build a new PC specifically for a few reasons:

1. I knew exactly what hardware it would have, with warranties.
2. By using an Atom chipset it has power consumption comparable to a netbook, which is preferable to a power hungry P4
3. The Atom D510MO chipset is fanless, making the entire computer almost silent
4. Gigabit Ethernet (up from 10/100 on the linksys nas)

I bought a nice looking glossy black case from Newegg, which was running a pretty nice deal on it as long as I signed up for spam, and sold the Linksys NAS for $5 profit.  I had the disk drives already from the linksys raid setup, so in the end I just had to buy the case, atom board/cpu combo, and 1 GB of RAM for it.  Not too much cost to expand its use greatly, but if you were starting from scratch it might be a big investment.  So give it a try with your old garage PC first.  I paired the computer with a 23” Samsung 2333HD Display, which is kind of a misnomer.  The actual NAS is capable of displaying a typical Unix/bsd console, but it’s really meant to run in a corner or a closet without a keyboard or monitor hooked up.  In fact, there is no GUI display included.  The monitor is really displaying video from my macbook pro, which makes the computer give the appearance of a hackintosh.  It’s also a nice 1080p HDTV.  The actual Atom computer runs without being plugged into the monitor, unless I’m debugging something.

So I spent all this money getting decent hardware, at least the software was free!  You’ll need to decide between a “full install” or “embedded” install.  The full install is like a typical OS installed onto your disk.  The embedded install is copied to a USB Flash Drive which is then booted off of, and it runs FreeNAS in a virtual disk created out of RAM.  The full install is easier to customize, but the embedded install is blistering fast and allows your hard drives to spin down when idle.  I went with the embedded because it’s very important to me for the idle disks to spin down.  This saves wear and tear, heat (remember it’s fanless), and power ($).  You can’t repartition the boot drive, so I had to add another flash drive to run my custom server apps like rssdler and python.  Running these apps off the main data HDDs would prevent them from spinning down (they’d never be idle).  Flash drives are cheap SSDs and it works great for NAS purposes.

After the initial console setup, you can unplug the monitor and control the system via a web interface on any other computer on the network.  This makes it very easy to choose services, set them up, add disks and shares… You really don’t have to be a pro to get it to work reliable and consistently.  I followed a tutorial, added my two hard drives as a redundant software RAID 1 array, and added windows and apple file sharing in less than 20 minutes.  Performance was a ten-fold increase over my Linksys NAS, averaging about 40MB/s transfers which I’m guessing is limited by the software RAID 1.  But don’t take my word for it, here’s some fancy looking pictures:

Linksys                        vs.                          FreeNAS

My Atom server blows away any of my previous NAS attempts, and I’m finally happy and able to not worry anymore about my hard disks crashing and taking all my stuff with them like the great hard drive crashes of 2003.  It’s far quieter and faster than the Linksys NAS, and I can run apps like rssdler off the server alone.  This means the AppleTV, which is already slow, doesn’t have to use its few resources on downloading for me anymore.  It uses waay less power than my gaming pc did when it stayed on to serve files, and adds the redundancy of two drives, protecting against hardware failure.  The loss of one hard drive wouldn’t make me lose any data.  The web interface is easy to use, and since it’s a mini-atx form factor, it’s got plenty of room for additional hard drive space so I can expand it over time.  The Linksys and many other NAS devices only support a maximum of two disks.  And did I mention how quiet it is?

The only disadvantages I could think of was the additional cost for having an additional computer.  If you have an old PC and could throw it in the closet or something, this disadvantage may not mean much for you.  Also, the mini-atx form factor eats up some desk space for me, but I want to keep it close to my other computers.  Again if you threw it in a closet you might not care.  I’m decent enough with Linux/Unix/bsd commands that I didn’t have any trouble setting it up, but if you’re a windows lover then buying a commercial NAS might be up your alley. 

So in summary, I am totally blown away by FreeNAS and all it’s capable of.  I tried everything else, but sometimes when you need the job done right you just have to do it yourself.  My next tech post will probably be about AT&T U-Verse, how it’s integrated into my new house, changed my network, and reacted to my experiments.

 

Check out the free software at: http://freenas.org/freenas

Posted by eclipse on 04/28/2010 at 11:04 PM
TechPC • (2) CommentsLink to this entry
Possibly Related Posts:

Monday, October 26, 2009

Installing rutorrent on your AppleTV

My AppleTV experience started in June ‘09 with a 40gb version I bought used from craigslist.  I’ve made many hacks on it already, like installing XBMC and Boxee. I’ve set up samba filesharing service, installed rtorrent, fought a lot with python and rssdler, created special cron jobs, and expanded its capacity to 1.5TB via network streaming.  Rssdler allows it to watch RSS feeds and download torrents automatically via rtorrent.  I like rtorrent because it is very stable and utilizes little system resources.  With only 1.0Ghz and 256mb of ram, resources are always a concern.  So when I started to look for an easier way to control rtorrent, a small footprint was a factor.

My original plan was to install wtorrent, a web based client that allows you to view rtorrent’s information and control it in your web browser.  This requires a web server like apache or lighttpd running on the AppleTV, and uses memory.  wtorrent’s system requirements were pretty high actually, needing not only httpd, but also php, scgi, ajax, etc…  I looked for alternative web clients and came across rutorrent.

rutorrent has many good features, the best of which are a light footprint, easy install, and nice interface.  I want it to be easy to use so Alison can benefit from it.  It doesn’t have multi-user support or password protection, but my AppleTV isn’t accessible from the outside world so I don’t have much use for that.  You can set up passwords with .htaccess if you need it though.  I spent many hours trying several different combinations of web servers and rtorrent frontends, finding information spread widely around the internet.  I ended up using the following configuration which is working out quite nicely.  I’ll detail it here in hopes that someone else who is interested can save some time and effort as well.

In this tutorial, I assume that you’ve hacked your AppleTV with the patchstick already, and you’re familiar with ssh, nano, unix filesystems, apache httpd, and copying files to your AppleTV.  I’ll still try to make it easy to follow for those of you who just type what you are told.  Items in bold should be typed into the console.

  1. Install rtorrent.
    • This has been documented pretty well already by a few different sites.  Try
      http://dyve.posterous.com/a-proper-rtorrent-install-for-apple-tv and come back when you’re done.
    • Enable scgi in your rtorrent configuration file
      nano ~/.rtorrent.rc
      type scgi_port = 127.0.0.1:5000 in the global section (just make it the first line if you’re unsure)
    •  
  2. Install XAMPP 0.7.4.
    XAMPP is an all-in-one apache http/php/perl/mysql solution for linux and mac os x.

    • Goto http://sourceforge.net/projects/xampp/files/ and download xampp-macosx-0.7.4.tar.gz.
      I used the newest version that was available as a tar file because you’ll need to extract it with the -p option to preserve file permissions.  If someone verifies that the files from the .dmg files work, I will make an update.
    • Copy the tar file over to the AppleTV via scp or samba.  I copied it to /Users/frontrow/xampp-macosx-0.7.4.tar.gz
    • Login to the AppleTV with SSH and navigate to the folder you uploaded it to and type:
      sudo tar xfvpz xampp-macosx-0.7.4.tar.gz -C /Users/frontrow/
      • This will install the app to /Users/frontrow/Applications/xampp.  Other sites will tell you to extract it to / so it installs in /Applications/xampp, but the 40gb AppleTV will give you an error saying “Cannot write: No space left on device.”  This is because /Applications is in a separate partition on the hard drive.
    • Creating a symbolic link in /Applications will give you the same functionality as if it was installed in /Applications.  Type
      sudo ln -s /Users/frontrow/Applications/xampp /Applications/xampp

    • Set up your httpd.conf
      sudo nano /Applications/xampp/etc/httpd.conf

      • Set up the httpd.conf however you like.  Other sites like this can explain it better than I can. You can also skip this and come back at the end.
    • Start the xampp services
      sudo /Applications/xampp/xamppfiles/mampp start

      • If you get php errors, it’s because you didn’t use the -p flag when extracting the tar file contents.  If/When this completes successfully, you should be able to type http://the-ip-address-of-your-AppleTV in your web browser and get a page.
    • Setup XAMPP security
      sudo /Applications/xampp/xamppfiles/mampp security

      • Creating a password for mysql will cause the demo html page to not work.  Not that that is a big deal, you’ll be replacing it with rutorrent later
    • Create a LaunchAgent to start the program automatically on boot.  You can download my launchagent here.  Copy it over to the AppleTV and then copy it to /Library/LaunchAgents/ by typing
      mv org.awkwardtv.httpd.plist /Library/LaunchAgents/

      • Congratulations, at this point your web server is installed and will start automatically with the AppleTV.  Now it’s time to install the http frontend for rtorrent.
  3. Installing rutorrent.
    • Download the latest version from the homepage: http://code.google.com/p/rutorrent/ and extract the files to the directory your xampp httpd.conf file uses as default for web pages.  If you didn’t change it, this folder will be /Applications/xampp/htdocs/
      • I found it easiest to extract the files on a desktop computer, and then move them over to the AppleTV via samba.
        Alternatively:
        • Copy the tar.gz file via scp
        • Navigate to the folder in SSH
        • gunzip rtorrent-2.7.tar.gz
        • tar -xf rtorrent-2.7
        • cd rtorrent
        • mv * /Applications/xampp/htdocs/
    • Download the RPC plugin (rpc-1.0.tar.gz) from http://code.google.com/p/rutorrent/downloads/list.  Copy it over to the AppleTV.
      • gunzip rpc-1.0.tar.gz
      • tar -xf rpc-1.0.tar -C /Applications/xampp/htdocs/plugins/
    • Make sure it works by going to http://the-ip-address-of-your-AppleTV

Posted by eclipse on 10/26 at 11:52 PM
In FeaturedTechApple • (1) CommentsPermalink
Possibly Related Posts:

 

Nothing to see here

Recent Projects include:

Stay tuned for more, Thanks for visiting.

Back to home.