Initial impressions of FreeNAS 8.2.0-BETA3

Our recently installed FreeNAS on an HP ProLiant MicroServer N40L is currently being used for backing up VMs (CentOS 6.0 KVM).

The web-based GUI is quite easy to work with, and the filesystem (ZFS) is quite resilient as we found out after a couple of power failures caused by accidentally tripping our ground protection fault / RCD switch…

Still, I’ve ran into some issues that will hopefully be resolved in the next Beta-release:

  • Remote syslog does not work due to an error in the startup script (Ticket #1433)
  • Transmission PBI configuration does not work, always reset to defaults (Ticket #1477Ticket #1512)

The syslog configuration can be fixed manually in /etc/rc.conf. The Transmission PBI needs more fixing before it can becomes useful; at the moment it insists on saving downloads into the jail’s root directory, which has limited quota.

Overall verdict so far: FreeNAS is a great piece of software, ZFS snapshots are awesome, still a couple of rough edges but hey, it’s a BETA ;-)

Happy Birthday, Koetje ;-)

Vandaag viert Koetje alweer haar tweede verjaardag – de tijd vliegt.

Ze hangt wel eens in de gordijnen, soms probeert ze Bommel te vangen maar eigenlijk is ze heel lief. Blacky en Koetje kunnen het heel erg goed vinden, dus het is een gezellige beestenboel met onze 3 katten…

Hier is ze in de weer met een duivenveer die ze in de tuin gevonden heeft – blijkbaar héél interessant!

♫ Happy Birthday to Koe,
Happy Birthday to Koe… ♫

FreeNAS on HP ProLiant MicroServer N40L

After the NLUUG presentation on FreeNAS, I bit the bullet and bought the HP MicroServer N40L for experimentation. A small and quiet server, with 4 HDD slots that make for a nice NAS setup. Of course, the system has limited CPU power but it should be enough for basic file serving.

Hardware

I decided to install a low-profile Intel NIC and upgrade the RAM memory to run ZFS comfortably.

HP have published some videos on (dis-)assembling the server, making the job a lot easier. There was only one issue: the mini-SAS connector is a pain to remove. Some Googling later, I found this post:

    To unplug a Mini-SAS x4 cable, squeeze the clip on the plug, then push the plug in before pulling it out. (Source: Oracle)

ZFS is very RAM-hungry, so I installed 2x 4GB Unregistered ECC DIMMs, giving me the maximum supported 8GB configuration:

    Crucial 4GB 240-pin DIMM 512Mx72 DDR3 PC3-10600 ECC (CT51272BA1339)

The Crucial DIMMs were detected without problems. It is possible to use standard non-ECC memory, but I wanted the extra reliability offered by having RAM with Error Correction.

Software

There are two ways to run FreeNAS: bare metal, or in a virtual machine. If you want to go the virtual route, HP has made a customized version of VMware ESXi 5 available for ProLiant servers. To minimize complexity, I run FreeNAS on bare metal. This avoids having to deal with raw device passthrough in VMware and ensures maximum performance.

FreeNAS installation

Installation was a breeze. I created a bootable USB stick (4GB, but 2GB should be fine) using VMware Fusion on my Mac; create a new VMware guest (FreeBSD 8, 64-bit) and set it to boot from the ISO image. Connect the USB stick to the VM; the FreeNAS installer will detect it and ask if you want to install to the USB drive. After installation, shut down the VM and plug the USB stick into the internal USB-port in the MicroServer. Done.

Next, you’ll want to add your harddisks and create a ZFS Volume. I enabled the “4k sectors” option for my 2TB Western Digital drives.

You can simply share this entire volume, or create ZFS Datasets within the ZFS Volume. This gives you more fine-grained control over permissions and sharing.

I mainly use NFS and SMB (CIFS) shares at the moment. They can be used from Mac OSX without problems. Having a central LDAP directory (or perhaps even NIS) helps when setting the correct ownership and permission.

Practical experience

So far, I’m quite happy with FreeNAS performance and ease of use.

FreeNAS 8.2.0-BETA3 appears quite stable; I haven’t found any major bugs yet.

Links

 

Controlling the Foscam FI8919W IP Camera

Foscam FI8918W IP Camera, whiteThe Foscam FI8919W Pan-Tilt camera supports a number of preset locations, or Presets.

The onboard web interface does not seem to offer a way to configure these presets – but there is another way!

I have written a couple of small shell scripts (for Linux or Mac OS X) that allow you to set a preset, move to a preset and even take a snapshot right from the command line.

The first script stores the current camera position into the specified preset.

You need to open a web browser or camera app (my favorite: Live Cams Pro on iPad/iPhone) and set the camera position.

Then, run this script, specifying the preset number (for example, “foscam_set 0” to set the first preset):

#!/bin/bash
# Store current camera position in specified preset (0..16)

# Commandline handling
#
preset=$1
if [ -z $preset ];
then
    echo "Syntax: $0 <preset>, where preset is a number (0..16)"
    exit 1
fi

# Address (or address:port number) where to reach the camera
# Username / password to access camera functions
#
CAMERA=192.168.1.2
USERNAME=theUsername
PASSWORD=thePassword

# Presets are set using URL with command (30 + preset*2), and recalled using URL with command (31 + preset*2)
#
command=$((30 + 2*$preset))
echo "Storing current camera position in preset ${preset} (command = ${command})"
wget -O - http://${CAMERA}/decoder_control.cgi?command=${command}\&user=${USERNAME}\&pwd=${PASSWORD}

Next, a script to move the camera to a specified preset (for example, “foscam_go 3“:

#!/bin/bash
# Move camera to specified preset (0..16)

# Commandline handling
#
preset=$1
if [ -z $preset ];
then
    echo "Syntax: $0 <preset>, where preset is a number (0..16)"
    exit 1
fi

# Address (or address:port number) where to reach the camera
# Username / password to access camera functions
#
CAMERA=192.168.1.2
USERNAME=theUsername
PASSWORD=thePassword

# Presets are set using URL with command (30 + preset*2), and recalled using URL with command (31 + preset*2)
#
command=$((31 + 2*$preset))
echo "Moving camera to preset ${preset} (command = ${command})"
wget -O - http://${CAMERA}/decoder_control.cgi?command=${command}\&user=${USERNAME}\&pwd=${PASSWORD}

Finally, a demo script that moves the camera to a preset, takes a snapshot and stores it locally (based on a post by 1994MGoBlue):

#!/bin/bash
# Take snapshots of certain preset camera locations

# Address (or address:port number) where to reach the camera
# Username / password to access camera functions
#
CAMERA=192.168.1.2
USERNAME=theUsername
PASSWORD=thePassword

# The camera should normally be in this position
DEFAULT_PRESET=3

# Seconds to sleep after issuing a camera move command, allow it to reach new position.
# You may have to change this value to your needs
DELAY=10

# Presets are set using URL with command (30 + preset*2), and recalled using URL with command (31 + preset*2)
#
for preset in 0 1 2 3 4;
do
    command=$((31 + 2*$preset))
    echo "Taking snapshot in preset ${preset} (command = ${command})"

    # Move camera, delay, take snapshot (stored in /tmp/)
    wget -O - http://${CAMERA}/decoder_control.cgi?command=${command}\&user=${USERNAME}\&pwd=${PASSWORD}
    sleep ${DELAY}
    wget -O /tmp/preset-${preset}.jpg http://${CAMERA}/snapshot.cgi?user=${USERNAME}\&pwd=${PASSWORD}
done

# Done, send camera back to default position
command=$((31 + 2*$DEFAULT_PRESET))
wget -O - http://${CAMERA}/decoder_control.cgi?command=${command}\&user=${USERNAME}\&pwd=${PASSWORD}

Enjoy!