Tuesday, May 5, 2009

Freebsd 7.1 and Zfs for my NAS

Well, I finally updated my nas to 1tb this weekend. ZFS thus far has turned out to be very cool and easy.

1. No waiting 10,000 years for filesystems to format, zfs is instantaneously ready
2. ZFS automatically takes care of mirroring, even correcting 'bad' blocks on EITHER primary or 'mirror' e.g. if bad on primary, will look to 'mirror' for correct blocks. It can then correct the primary.
3. ZFS is still 'experimantal' and requires at least 1gb of memory to work. Here are the tweaks to add to the kernel:

vmem.kmem_size="512M"
vmem.kmem_size_max="512M"
zfs_load="YES"
vfs.zfs.arc.max="100M"
vfs.zfs.vdev.cache.size="10M"
vfs.zfs.prefetch_disable="1"
vfs.zfs.zil_disable="1"

Those entries go into the loader.conf in your /boot directory.

ZFS also uses TONS of processor. When I was sending 190gb of files processor was at 80-100%. So a multi core is necessary if you want to use on your 'main' machine....

I also threw in some apple customizations:

first, the MDNSresponder.conf file

# sample mDNSResponder conf file
#
# name type domain port text record
# ---- ---- ------ ---- -----------
Marilyn _afpovertcp._tcp local. 548
Marilyn _ssh._tcp local. 22

this lives in the /usr/local/etc mDNSResponder.conf file.

You also need to install the netatalk and the Mdnsersponder, and "HOWL" to get apple working. YOu also need the following in your /usr/local/etc/AppleVolumes.default

Just put your shares at the end e.g. /export.

The system went from 20mbps on a 1gbps network to 36mbps with appletalk. Also nice is the fact that I can 'browse' to the share.

The freebsd has seemed very stable, with the appropriate modifications. ZFS does use TONS of memory, however (200mb) on my setup....

Also cool is the ability to 'send' backups to any other nas on the network via a single command, and well as adding to the pool w/o having to do considerable resizing.

I haven't finished my 'time machine' project on it yet, but zfs quotas will ensure that they won't eat up the entire 1tb of disk.

No comments: