ZFS Update

June 14th, 2010 | by Sean |

I’ve spent the last few days toying with ZFS on protego (FreeBSD 8); and I must say, I’m very happy! It’s refreshing to have this degree of control over a logical block of storage (2x500GB drives).

I used the ZFS Quick Start Guide to get started. I also cuddled up with “man zpool” and “man zfs” in order to tailor my own solution. In the end, I came up with a relatively simple:

[root@protego]-~# zpool list
NAME   SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
tank   928G   312G   616G    33%  ONLINE  -
[root@protego]-~# zfs list
NAME              USED  AVAIL  REFER  MOUNTPOINT
tank              312G   601G    19K  /tank
tank/fbsd         497M   601G    18K  /tank/fbsd
tank/fbsd/ports   193M   601G   193M  /usr/ports
tank/fbsd/src     304M   601G   304M  /usr/src
tank/media        203G   601G   203G  /data/media
tank/tm           109G   291G   109G  /data/tm
I could delve into nitty gritty, but the interesting points:
  • It’s 928G of storage split into these data sets.
  • There is a 400G reservation and quota for Time Machine; without it, Time Machine would consume up to the maximum 928G (see my earlier post…)
  • I created two data sets for the FreeBSD source tree and the Ports Collection; these are both compressed (lzjb) with nosuid and noatime turned on. They inherit their compression from the parent data set (tank/fbsd) and this arrangement lets me mount each at their respective homes on /usr.
  • The “media” share has noatime and nosuid turned on, and is able to consume whatever’s remaining on storage.

I did notice that FreeBSD’s default configuration caused kernel panics, because the kernel tries to use more physical memory than exist to store ZFS internals (on a machine with 2GB of RAM anyway). Luckily, you can tune these; I added the following to /boot/loader.conf on the advice of the starter guide to alleviate the problem:

vm.kmem_size_max="1024M"
vm.kmem_size="1024M"
vfs.zfs.arc_max="100M"

So far so good. I’m going to let this run for a while and spend time learning about ZFS snapshots and rollbacks. I’m also going to look into ZFS diagnostics and maintenance; I’m a little concerned about copy-on-write and fragmentation (not such a big deal with the largely write-it-and-forget-it data I have on it now, but something to think about if I say, move /home onto ZFS).

You must be logged in to post a comment.