Tuesday, August 3, 2010

apt-get install zfsutils

Two weeks ago I wrote about how I manage to install ZFS utilities on my Debian GNU/kFreeBSD system. It was a very ugly hack, but things have evolved very positively:

  • The kernel panic problem with ZFS is now fixed
  • I helped porting the ZFS utilities from FreeBSD, and the Debian GNU/kFreeBSD developers were very interested in it, and validated my work. There is now a zfsutils package.

So if you want ZFS support in your Debian GNU/kFreeBSD, now you just need:

apt-get install zfsutils

Enjoy :-)

Wednesday, July 14, 2010

How to enable ZFS on Debian GNU/kFreeBSD

IMPORTANT: things are much simpler now, see my newer post about ZFS

I've been recently playing a bit with this system that is currently in development (Debian GNU/kFreeBSD). My main interest in it is ZFS support, but by default it turns out ZFS isn't supported at all :-(

ZFS has two parts, a kernel module and two utilities (zpool and zfs). It seems Debian GNU/kFreeBSD has kernel support, so I tried to make it work by copying the missing utilities over from FreeBSD. The utilities have a lot of library dependencies, so I copied those too. Then I would have a working zpool, but unexpectedly the kernel panics when using it:

$ zpool create mypool da1
panic: stack overflow detected; backtrace may be corrupted
cpuid = 0
Uptime: 1m10s
Cannot dump. Device not defined or unavailable.
Automatic reboot in 15 seconds - press a key on the console to abort

Very disappointing!

I'm no kernel developer and have no idea how to fix this, but I don't give up. I figured that since ZFS works on FreeBSD, it may be a problem with the kernel in Debian. So I copied the ZFS module (zfs.ko) from FreeBSD and tried again. This time it works! I used Debian GNU/kFreeBSD to create a pool, filled it up with files, adjusted settings, etc.

I'm looking forward to using ZFS as a replacement for RAID in webhosting environment. My next goal is to put the root filesystem in ZFS so that the system can boot from it (separate partition is too much maintenance).

Finally, I wrote a small script to make these steps reproducible. You can use it if you want to setup ZFS on Debian GNU/kFreeBSD yourself.