FreeNAS itx setup

As a result of a complete NAS breakdown one of my customers decided to get a new server that had a bit more power than the old one.

I saw this as quite an interesting challenge and got started.

Due to the fact that the rack cabinet that was put up was only ~68cm deep, I had to find a rack chassis that ware to fit these constraints.
It turns out that Travla has some very nice chassis’ with 8 front access hot-swap drive bays for the raid.


At first, I tried the Jetway NC9C-550-LF mainboard with the 4xSATA daughterboard. But unfortunately, the latter was unsupported, which took the whole idea out of using this board (8xSATA in all). Also the LAN interface was not supported out-of-the-box.

The installation went smooth, and a SoftRAID5 was created using the five disks. The creation was a real pain and took forever.
Initial benchmarks went well, but at deployment a significant slowdown was detected. ~250Mbit LAN usage when transferring large files, and as low as 50Mbit when transferring small files. This was very unacceptable on a Gigabit LAN.

After a switch switch and a NIC switch I turned as a last resort, to what could not possibly be the bottleneck – the server itself!

nas:~# dd if=/dev/zero of=/mnt/storage/zerofile.000 bs=1m count=10000
10000+0 records in
10000+0 records out
10485760000 bytes transferred in 271.362496 secs (38641154 bytes/sec)
nas:~# dd of=/dev/zero if=/mnt/storage/zerofile.000 bs=1m 
10000+0 records in
10000+0 records out
10485760000 bytes transferred in 96.963503 secs (108141308 bytes/sec)

40/100 Mb/s is not very impressive for sequential r/w – especially not on a RAID5!
Guess the bottleneck was the server itself.

After a bit of reading and research, I came across a story quite similar to mine – using the exact same disks on a softRaid5. The problem was misalignment of partitions due to a change of standard disk blocksize since – well I don’t know when, I usually don’t follow hardware evolution that closely.

Next thing, I persuaded the customer to backup the data, so that I could re-create the RAID – only this time as a RAID-Z.

dd if=/dev/zero of=/storage/zerofile.000 bs=1m count=10000 && dd of=/dev/null if=/storage/zerofile.000 bs=1m && rm /storage/zerofile.000 
10000+0 records in
10000+0 records out
10485760000 bytes transferred in 98.727775 secs (106208815 bytes/sec)
10000+0 records in
10000+0 records out
10485760000 bytes transferred in 46.398998 secs (225991087 bytes/sec)

This is a nice improvement! The customer is also satisfied with the speed increase, but then again – who wouldn’t be?

Finally, a photo of the setup.


This is a sight that I just had to document. It is a collection of external disks, and the document on top is the index. This index is created by mounting each disk and take a screenshot of the Finder window. A very nice ad-hoc solution if you ask me.


EXIF Manipulation on the Linux commandline

I use jhead for manipulating EXIF data, renaming files and mogrify for
compressing the JPEG’s

the following command will rename all .jpg files in the current folder
to their corresponding “date taken” stamp in the format YYYYMMDD-HHMMSS

jhead -n%Y%m%d-%H%M%S *.jpg

Sometimes you have multiple cameras at a happy occasion, and wish to
collect all the images. But alas, one or more of the cameras have
their clock set to UTC, daylight savings time (winter when it is summer)
or similar. This will create annoyance as the images will not appear
fortunately you kan find the “sinner” and adjust the time with jhead
in a this way:

jhead *.jpg | grep "IXUS 700" -b4 | \
grep "File name" | sed "s/.*: //" | xargs jhead -ta+1

WARNING: This step is optional, just because I cannot tell the difference
between compressed and uncompressed images, maybe you can. A backup is
therefore recommended

The compression on digital cameras are not very efficient, and this
leads to large JPEG image files on your harddisk.
Fortunately you can use “mogrify” to cut JPEG’s down in size with

jhead -cmd "mogrify -quality 80 &i" *.jpg

How to install LabVIEW on a Debian Machine

Labview ships prepackaged to install on rpm based Linux machines (Redhat, Mandrake and so on). But it is quite simple to convert and install it on a Debian machine instead.

The machine I will be using is a Thinkpad T40 with Debian Lenny installed, it should be the same for the current stable (Etch) but this is yet to be confirmed.

First we need to install alien

# aptitude install alien

The conversion process is quite simple, all you have to is to type

# alien -d *.rpm

And after some time (about 15 minutes or so on my laptop) you should be left with a bunch of .deb files.

You might have guessed it.. to install:

# dpkg -i *.deb

Now for the hacking part, when you try to run Labview all you get is this error:

/usr/local/natinst/LabVIEW-8.2/labview: symbol lookup error: /usr/local/natinst/LabVIEW-8.2/linux/ undefined symbol: _glapi_add_entrypoint

To work around this you need to install libosmesa (of current writing libosmesa6)

# aptitude install libosmesa6

and relink

# (cd /usr/local/natinst/LabVIEW-8.2/linux; rm; ln -s /usr/lib/

And it works! If you feel like it, you can also put a little icon on your desktop or in your Applications menu (this part is for gnome), this is the contents of the labview.desktop file with my corrections. It originates from /usr/local/natinst/LabVIEW-8.2/linux/gnome/gnome/apps/Applications/labview82.desktop and there is a similar file for KDE in the /usr/local/natinst/LabVIEW-8.2/linux/kde folder for those who want to make a KDE shortcut.
Contents of labview82.desktop

[Desktop Entry]
Name=LabVIEW 8.2
Comment=LabVIEW Graphical Dataflow Programming Environment

This file can be placed either in ~/.local/share/applications/ or in /usr/share/applications

Lirc og NQ6400

Aldi solgte på et tidspunkt et tunerkort fra northQ. Det er et low profile pci kort og kan desuden tænde og slukke computeren ved hælp at fjernbetjeningen.

Jeg har genereret en lirc konfigurationsfil til brug af denne fjernbetjening til fri afbenyttelse, den kan hentes her:

NorthQ6400Remote.conf (30K)

Hvis du er tvivl om hvad det er for en fjernbetjening er der et billede her:

NQ6400.png (617K)

Fjern Thumbs.db filer fra dit system

Windows genererer som standard en thumbnail database i en mappe med billeder, disse bliver så distribueret med når mapperne efterfølgende bliver brændt ned på skiver, komprimeret eller bare distribueret via nettet.

Der findes en kur

$ find ~ -name 'Thumbs.db' -print0 | xargs -0 rm -v >> rm.log

Find terminierer hver linie med en null karakter, og xargs bygger en argumentliste sepereret ved null karakteren, og sender listen til rm. -v argumentet beder rm om output som vi så skriver til rm.log