Solved RPI2 FreeBSD11.1 Can't create ZFS pool (reboots on attempt)

Hi all,

I am using a Raspberry PI 2 with FreeBSD 11.1 on it. There's an external 1TB disk hooked up via USB, on which I am trying to create a ZFS pool. However, every time I try to create a ZFS pool on this disk, it reboots the Pi.

What I have tried:
1) Creating a pool on the disk itself /dev/da0
2) Creating a pool on the first partition of the disk /dev/da0p1
3) Removing all partitions and repeating step 1
4) Adding a freebsd-zfs partition and repeating step 2

The disk isn't corrupted:
Code:
[root@kn0x ~]# gpart show /dev/da0
=>        40  1953525088  da0  GPT  (932G)
          40        2008       - free -  (1.0M)
        2048  1953521664    1  freebsd-zfs  (932G)
  1953523712        1416       - free -  (708K)

There is no known ZFS pool:
Code:
[root@kn0x ~]# zpool status
no pools available

I can't get the disk online:
Code:
[root@kn0x ~]# zpool online tank /dev/da0
cannot open 'tank': no such pool
[root@kn0x ~]# zpool online tank /dev/da0p1
cannot open 'tank': no such pool

But I can't create a new pool unless I use the -f flag:
Code:
[root@kn0x ~]# zpool create tank da0
invalid vdev specification
use '-f' to override the following errors:
/dev/da0 is part of potentially active pool 'tank'

However, whenever I do that, the machine reboots again :)

I think my next attempt at solving this will be to hook the disk on to another machine, and try from there. But I still think this is really odd. Any help is appreciated.
 
You're not telling me that it works within Ubuntu Core (On RPI) but not on FreeBSD, are ya? :p

The RPi 2 Model B has a 32-bit CPU and 1GB of RAM. ARM is also a second-tier platform on FreeBSD. You might be able to get FreeBSD + ZFS to function on an RPi2, but it's not officially supported here and is a terrible idea in any case.
 
The RPi 2 Model B has a 32-bit CPU and 1GB of RAM. ARM is also a second-tier platform on FreeBSD. You might be able to get FreeBSD + ZFS to function on it, but it's not officially supported here and is a terrible idea in any case.
I'd like to learn; why would it be a terrible idea?
 
why would it be a terrible idea?
Not enough resources, although ZFS is able to cope with small amounts of memory it does like memory a lot. The Pi simply doesn't have enough.
 
Many of the features that make ZFS so appealing---its near-limitless storage capacity, dynamic block and fragment sizes, data and metadata checksums, automatic repair---were deliberately designed under the assumption that it would be running on 64-bit or greater CPUs. It was not designed to run on 32-bit machines. Or, to put it another way, when it was designed it was designed for "future hardware."

On top of that, ZFS aggressively caches data and metadata in RAM to perform its operations (such as scrubs), prefetches data from disk, and writes data periodically from RAM to disk in predefined chunks ("transactions"). Generally speaking, you could run a small server dedicated to a single task or with low traffic, or a desktop that's not running all day long, on 4GB of RAM with little trouble. But with only 1GB of RAM, there's a good chance that just the basic operations of ZFS will crash the system. A scrub operation on a 1TB pool would probably take a full day to complete, during which time the system would be unable to do anything else (if it didn't crash the system).

It's possible to create ZFS filesystems on a wide range of platforms and use it just fine, but when all is said and done it was really designed for large, powerful storage servers.
 
Many of the features that make ZFS so appealing---its near-limitless storage capacity, dynamic block and fragment sizes, data and metadata checksums, automatic repair---were deliberately designed under the assumption that it would be running on 64-bit or greater CPUs. It was not designed to run on 32-bit machines. Or, to put it another way, when it was designed it was designed for "future hardware."

On top of that, ZFS aggressively caches data and metadata in RAM to perform its operations (such as scrubs), prefetches data from disk, and writes data periodically from RAM to disk in predefined chunks ("transactions"). Generally speaking, you could run a small server dedicated to a single task or with low traffic, or a desktop that's not running all day long, on 4GB of RAM with little trouble. But with only 1GB of RAM, there's a good chance that just the basic operations of ZFS will crash the system. A scrub operation on a 1TB pool would probably take a full day to complete, during which time the system would be unable to do anything else (if it didn't crash the system).

It's possible to create ZFS filesystems on a wide range of platforms and use it just fine, but when all is said and done it was really designed for large, powerful storage servers.
Thanks Anoknusa. That is a very clear and in-depth explanation. I knew ZFS likes RAM, but not in a way that it would form a 4GB+ requirement on a machine. Makes sense though, especially with the 64 bit processor requirement, that it's not recommended on a pi.
 
You're wrong.
Did something change recently? Because it certainly wasn't supported when I tried it. Granted, this was some time ago, so things may have changed in the mean time.

I might give this another go, not on a Pi though, I'm pretty sure it's not going to have enough resources to pull it off. But I might be inclined to find a nice ARM64 board to use for a file server.
 
Did something change recently? Because it certainly wasn't supported when I tried it. Granted, this was some time ago, so things may have changed in the mean time.

I might give this another go, not on a Pi though, I'm pretty sure it's not going to have enough resources to pull it off. But I might be inclined to find a nice ARM64 board to use for a file server.
https://svnweb.freebsd.org/base?view=revision&revision=297174
 
Back
Top