Wednesday Feb 03, 2010

Compiling libupnp on Solaris

libupnp 1.6.6 is a little tricky to compile on Solaris. After downloading the source from Source Forge, you will want to extract the bzip2 and cd to the libupnp-1.6.6 directory, then do the following.
vi upnp/src/api/upnpapi.c
On line 59, there is a bug. Change
#if defined(_sun)
to
#if defined(__sun)
The change is adding an extra underscore. Otherwise sockio.h will not be recognized properly and you will get some missing networking variables when you try to build. After that is taken care of...
$ ./configure CFLAGS="-DSPARC_SOLARIS" --disable-samples
$ gmake
# gmake install

Friday Jul 25, 2008

ZFS NAS with the Intel Atom

I've been looking to build a network attached storage (NAS) device for some time to store all my music, photos, films, etc. in one global location. I had a few specific requirements that were as follows:

  • Supports two disks (2TB RAID mirroring preferable)
  • Supports UPnP server (media sharing)
  • Low power (always on)
  • Bonus points: ZFS, SSH, Samba, etc.

    There are a few ready-to-go NAS solutions available on the market that are compatible with my demands. The Linksys NAS200, at $130, supports two disks with Twonky Media server for UPnP and is low power. The downside is that reviews indicate it being very slow and it comes with no gigabit ethernet. On the high-end side, however, the QNAP TS-209 Pro also comes with the two disk slots, UPnP support, is fast, along with a bunch of extra goodies like samba and an Itunes server. The price tag at $400 makes it a bit too much for a diskless system, so I decided on a different solution... why not build it myself?

    I had a Thermaltake LANBOX Lite Mini-ITX/ATX case lying around along with a 200W power supply, so all I needed to do was find some cheap, low power hardware to support it. Intel recently released a new type of processor called the Atom, which is aimed at bringing x86 into the embedded market. I'm not so sure how successful they will be at this venture, but it fits my needs perfectly. According to their specs, it draws 2W TDP for the 1.6ghz version which is pretty amazing. The power output turns out to be a bit of marketing hype, but considering it is now being used in the ASUS Eee desktop and laptops, it should prove to be a viable candidate. To encourage the hobbyist market, Intel created a combo of motherboard + Atom (BOXD945GCLF) that is available on Newegg for $75. After getting it along with a pair of 1TB drives at $170, I had a workable system shipped to me for under $500.

    My first reaction when I got all the parts is that the Intel board is TINY. I can fit my hand around entire thing. Even in the media center case that I use, it has quite a bit of extra room.

    The LANBOX Lite is fully modular which makes installation much easier. If you have ever built a computer from scratch, then you probably understand how tedious it can be to screw in motherboards, install drives, etc. This case allows you to pull every section out to make installation a breeze. It also comes with a nice silo to install both the terabyte drives.

    The next step is to turn this into a fully functional NAS. After installing FreeBSD 7.0, I wanted to setup both my disks to mirror. Since the BSD family has such a friendly license, ZFS is included in the distribution. And ZFS mirroring makes things incredibly simple to setup.
    [root@bojangles ~]# zpool attach tank ad4s1d ad6s1d
    
    And that's it! Now to ensure that things went as expected.
    [root@bojangles ~]# zpool list
    NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
    tank                    928G   72.9G    855G     7%  ONLINE     -
    [root@bojangles ~]# zpool status
      pool: tank
     state: ONLINE
     scrub: none requested
    config:
    
    	NAME        STATE     READ WRITE CKSUM
    	tank        ONLINE       0     0     0
    	  mirror    ONLINE       0     0     0
    	    ad4s1d  ONLINE       0     0     0
    	    ad6s1d  ONLINE       0     0     0
    
    errors: No known data errors
    
    Now with ports, I can get Samba and Ushare up and running in no time.
    [root@bojangles ~]# cd /usr/ports/net/samba3 && make install clean
    [root@bojangles ~]# cd /usr/ports/net/ushare && make install clean
    
    The final product in my closet in a makeshift cabinet.

  • About

    Hiya, my name is Paul Johnson and I'm a software engineer working on the ZFS storage appliance .

    Search

    Categories
    Archives
    « April 2014
    SunMonTueWedThuFriSat
      
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
       
           
    Today