hostingnuggets
Posts: 34
Joined: Fri Dec 28, 2012 5:52 pm

ZFS package on Raspbian

Wed Nov 09, 2016 5:57 pm

Hello,

I would love to try out ZFS on Rasbian but noticed that there are no packages yet. Is anyone willing to create one?

I would be happy to help but I am no programmer and have little experience with compiling source code.

Best regards,
John

epoch1970
Posts: 4201
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: ZFS package on Raspbian

Wed Nov 09, 2016 6:28 pm

Pi is not exactly a target for ZFS; It's short on memory and I/Os and at least for the zfsonlinux implementation from LLNL, you need a 64-bit OS.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

hostingnuggets
Posts: 34
Joined: Fri Dec 28, 2012 5:52 pm

Re: ZFS package on Raspbian

Wed Nov 09, 2016 7:30 pm

epoch1970 wrote:Pi is not exactly a target for ZFS; It's short on memory and I/Os and at least for the zfsonlinux implementation from LLNL, you need a 64-bit OS.
I am totally aware about that, it's just to build up a proof of concept for testing, not for production usage.

Right now I am building SPL by having run "configure" and "make pkg-utils pkg-kmod", it build the RPM package files but unfortunately does not build the .deb files... Here relevant make output:

Code: Select all

Executing(--clean): /bin/sh -e /tmp/spl-build-pi-DB0ByBSl/TMP/rpm-tmp.99bx4Q
+ umask 022
+ cd /tmp/spl-build-pi-DB0ByBSl/BUILD
+ rm -rf spl-kmod-0.7.0
+ exit 0
make[1]: Leaving directory '/home/pi/git/spl'
name=spl; \
version=0.7.0-rc2_2_gcbba714; \
arch=`rpm -qp ${name}-kmod-${version}.src.rpm --qf %{arch} | tail -1`; \
pkg1=kmod-${name}*${version}.${arch}.rpm; \
fakeroot alien --bump=0 --scripts --to-deb $pkg1; \
rm -f $pkg1
kmod-spl-4.4.26-v7+-0.7.0-rc2_2_gcbba714.armv7l.rpm is for architecture armel ; the package cannot be built on this system
Any idea why alien does not want to convert the .rpm to a .deb although it is an arm arch... ?

User avatar
rpdom
Posts: 16054
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: ZFS package on Raspbian

Wed Nov 09, 2016 8:22 pm

hostingnuggets wrote:

Code: Select all

kmod-spl-4.4.26-v7+-0.7.0-rc2_2_gcbba714.armv7l.rpm is for architecture armel ; the package cannot be built on this system
Any idea why alien does not want to convert the .rpm to a .deb although it is an arm arch... ?
Because Raspbian is armhf, not armel. Wrong arm arch.

hostingnuggets
Posts: 34
Joined: Fri Dec 28, 2012 5:52 pm

Re: ZFS package on Raspbian

Wed Nov 09, 2016 9:26 pm

Because Raspbian is armhf, not armel. Wrong arm arch.
Good point! As you can now notice, I am pretty new to the whole Raspberry Pi thingy ;-)

So thanks to your hint I adapted the Makefile of SPL to force the architecture by adding the "--target armhf" to the rpmbuild commands. I now have SPL compiled and 4 .deb packages ready to install, which I am going to try right now.

I am one step closer to get ZFS running on RasPi!

tpylkko
Posts: 384
Joined: Tue Oct 14, 2014 5:21 pm

Re: ZFS package on Raspbian

Wed Nov 09, 2016 9:34 pm

Due to the licensing issues ZFS was added to Debian only recently and they only added the source to the DKMS module to contrib section.

https://bits.debian.org/2016/05/what-do ... ebian.html

But btrfs is available straight OOTB on Raspbian and has all the same properties (almost at least).

hostingnuggets
Posts: 34
Joined: Fri Dec 28, 2012 5:52 pm

Re: ZFS package on Raspbian

Wed Nov 09, 2016 10:40 pm

Fantastic, I got ZFS 0.7.0 running on Raspbian 8-)

ejolson
Posts: 4231
Joined: Tue Mar 18, 2014 11:47 am

Re: ZFS package on Raspbian

Thu Nov 10, 2016 2:30 am

hostingnuggets wrote:Fantastic, I got ZFS 0.7.0 running on Raspbian 8-)
How many drives are in the storage pool and what sizes? How well does it work?

hostingnuggets
Posts: 34
Joined: Fri Dec 28, 2012 5:52 pm

Re: ZFS package on Raspbian

Thu Nov 10, 2016 8:00 pm

ejolson wrote:
hostingnuggets wrote:Fantastic, I got ZFS 0.7.0 running on Raspbian 8-)
How many drives are in the storage pool and what sizes? How well does it work?
For now I just tested with two "virtual drives" of 1 GB each created by using "dd if=/dev/zero of=/vdrive1 ..." and then created a zfs mirror out of them.

My plan is to attach two SSD USB drives of 500 GB each and create a zpool with one mirror out of them. I should have time next week to do that and will post my results here as soon as I tried that out.

serged
Posts: 2
Joined: Sat Dec 17, 2016 11:06 pm

Re: ZFS package on Raspbian

Sat Dec 17, 2016 11:11 pm

What options did you use to compile ZFS successfully?
I did try couple of things already but I always hit the same error using 4.4.34 on a raspberry 3.

configure: error: in `/tmp/spl-build-pi-d0NVWUrR/BUILD/spl-0.7.0':
configure: error: C compiler cannot create executables

serged
Posts: 2
Joined: Sat Dec 17, 2016 11:06 pm

Re: ZFS package on Raspbian

Sun Dec 18, 2016 9:08 pm

ok, I finally succeed ... here are the steps I used if someone is interested

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential autoconf libtool
sudo apt-get install gawk alien fakeroot gdebi
sudo apt-get install zlib1g-dev uuid-dev libattr1-dev libblkid-dev
sudo apt-get install libselinux-dev libudev-dev parted lsscsi wget ksh
sudo apt-get install raspberrypi-kernel-headers
sudo apt-get install libdevmapper*

download the latest openZFS (0.7.0) for github

spl-0.7.0-rc2.tar.gz
zfs-0.7.0-rc2.tar.gz

mkdir zfs

move the 2 files under zfs directory

cd zfs
tar xzf s*0
tar xzf z*0
cd s*0
./autogen.sh
cd ../z*0
./autogen.sh
cd ../s*0
./configure
make
sudo make install
cd ../z*0
./configure
make
sudo make install

sudo vi /etc/ld.so.conf
and add the following line at the end of the file
/usr/local/zfs/lib
then save and exit.

sudo depmod -a
sudo modprobe zfs

.. et voila

Then I just did create a flat file to use as vdev for quick testing

[email protected]:~# zpool create p1 /tests/f1
[email protected]:~# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
p1 192M 100K 192M - 1% 0% 1.00x ONLINE -
[email protected]:~# uname -a
Linux rasp01 4.4.34-v7+ #930 SMP Wed Nov 23 15:20:41 GMT 2016 armv7l GNU/Linux

glumpf
Posts: 2
Joined: Sun Feb 12, 2017 9:50 pm

Re: ZFS package on Raspbian

Sun Mar 12, 2017 7:24 pm

Hi serged,
i followed your steps, it works fine, till i reboot. I created pools, but after reboot

Code: Select all

zpool list
shows that no pools are available. What should i do? Thanks

qippur
Posts: 1
Joined: Tue Apr 04, 2017 5:55 pm

Re: ZFS package on Raspbian

Tue Apr 04, 2017 5:58 pm

Bookmarked. It worked like a charm. Thank you!

Anyone has any suggestion to have zfs as root filesystem for the raspberry? That would be great.

Regards

qippur

--

Return to “Raspbian”