fredag 21 oktober 2011

ZFS mirroring with Samsung F4 4k disks.

After building my NAS a few month ago, I had this feeling that I was missing something.

ZFS!
If I have a NAS then it should use ZFS or RAID.

So I bought two Samsung F4 2TB disks (4k sectors but reporting themself as 512-byte sectors to the OS) and mounted them in the case.

To get nice speeds using ZFS and 4k sector disks one must align the disks.
This can be done in many ways. I used gnop to make a "dummy" disknode for ZFS.
But first I labeled my new disks with glabel.

glabel label disk1 /dev/ada2
glabel label disk2 /dev/ada3


that means that we can use /dev/label/disk1 as reference to the disk instead of remembering what adXX the disk is reported as.

use camcontrol devlist and glabel status to figure out the names when doing the labeling.

To create a mirror ZFS using gnop.
gnop -S 4096 /dev/label/disk1
gnop -S 4096 /dev/label/disk2

zpool create tank mirror /dev/label/disk1.nop /dev/label/disk2.nop
zpool export tank
gnop destroy /dev/label/disk1.gnop
gnop destroy /dev/label/disk2.gnop
zpool import tank


Good reference:
http://ivoras.net/blog/tree/2011-01-01.freebsd-on-4k-sector-drives.html

söndag 3 april 2011

DLNA server on FreeBSD 8.2 Using serviio

With a network ready TV(Samsung LE-B655) and a NAS based on FreeBSD 8.2 I really needed to get DLNA working.

After searching the "net" for DLNA servers I ended up with going to /usr/ports/net/serviio and made an "make install clean".

After alot of dependencies was installed I finally added the magic words to rc.conf:
serviio_enable="YES"
serviio_args="-Dserviio.remoteHost=yo.ur.local.ip" #change to your IP

and fired serviio up.

OK. It started?! Now what? Well, this is the ceavat of serviio. You need a GUI. So download Serviio from http://www.serviio.org/download and install it on a client (I choosed Ubuntu 10.10) and start serviio-console.sh.

That did not work for me. I needed to add this line
-Dserviio.remoteHost=your.ser.ver.IP"

at the end of the "JAVA_OPTS" line in the serviio-console.sh.
Then the console started and found my serviio server. From the console it is straight forward to add paths for your media.

I tested it with XBMC in ubuntu 10.10 and it worked great. I can browse the content served by the Serviio server. Going to test it tomorrow on the TV.

Happy surfing!

fredag 18 mars 2011

Upgrading from FreeBSD 8.1 to FreeBSD 8.2

Took the giant leap from 8.1 to 8.2 this evening.

Simple as 1,2,3,4.

# freebsd-update upgrade -r 8.2-RELEASE
During this process, FreeBSD Update may ask the user to help by merging some configuration files or by confirming that the automatically performed merging was done correctly.

# freebsd-update install
The system must be rebooted with the newly installed kernel before continuing.

# shutdown -r now
After rebooting, freebsd-update needs to be run again to install the new userland components:

# freebsd-update install
At this point, users of systems being upgraded from FreeBSD 7.4-RELEASE or earlier will be prompted by freebsd-update to rebuild all third-party applications (e.g., ports installed from the ports tree) due to updates in system libraries.

After updating installed third-party applications (and again, only if freebsd-update printed a message indicating that this was necessary), run freebsd-update again so that it can delete the old (no longer used) system libraries:

# freebsd-update install
Finally, reboot into 8.2-RELEASE:

# shutdown -r now

Info taken directly from http://www.freebsd.org/releases/8.2R/announce.html

söndag 9 januari 2011

FreeBSD 8.X as wireless accesspoint with H55ITX-C-E

Got my Zotac H55ITX-C-E working as an AP using FreeBSD 8.

Follow http://www.freebsd.org/doc/handbook/network-wireless.html#NETWORK-WIRELESS-AP and you are done.

Only problem isthat the hostapd must encounter a false password if using WPA2 first and then a good password before it will work. So something is wrong in my config. But hey, it works.