Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py-libzfs with Ubuntu 18.04 #90

Closed
reefland opened this issue Feb 26, 2020 · 3 comments
Closed

py-libzfs with Ubuntu 18.04 #90

reefland opened this issue Feb 26, 2020 · 3 comments

Comments

@reefland
Copy link

I'm using FreeNAS 11.3's new replication sub-system, I'm interested in using it's NETCAT feature to a remote Ubuntu Server with ZFS (SSH based replication to Ubuntu works fine). To use NETCAT, Freenas has this message about requiring "py-libzfs":

SSH+NETCAT uses SSH to establish a connection to the destination system, then uses py-libzfs to send an unencrypted data stream for higher transfer speeds. This only works when replicating to a FreeNAS, TrueNAS, or other system with py-libzfs installed.

That's not a lot to go on, and I was unable to find any additional documentation about this.

What I tried:

sudo apt install --yes --no-install-recommends gcc gcc-multilib libzfslinux-dev 

cd ~
git clone https://github.com/freenas/py-libzfs
cd ~/py-libzfs

./configure && make install

It gets this far:

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed

-----------------------------------
   RUNNING TESTS ON zfs.h HEADER
-----------------------------------
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for sys/types.h... (cached) yes
checking for sys/fs/zfs.h... no
configure: error: A working zfs header is required

apt-file search sys/fs/zfs.h shows that the zfs.h file is in the libzfslinux-dev and zfs-dkms packages.

I though package "libzfslinux-dev" provided the needed working header? I don't want try / switch to zfs-dkms just to build py-libzfs.

Suggestions?

@sonicaj
Copy link
Member

sonicaj commented Feb 26, 2020

Hi @reefland, you should be able to make it work with executing ./configure --prefix=/usr first. We need to specify the prefix for linux as it assumes default of freebsd currently.
However debian packages are generated on each update of master - the last ones can be retrieved with https://github.com/freenas/py-libzfs/actions/runs/42358213, that should work just fine as well.

Please let me know if this doesn't work. Thank you

@reefland
Copy link
Author

@sonicaj - thank you for the prompt response. Using ./configure --prefix=/usr did work as you suggested. I'll look into using the DEB package instead. Appreciate the link. Closed issue.

@Hi-Angel
Copy link

Hi-Angel commented Jul 7, 2020

We need to specify the prefix for linux as it assumes default of freebsd currently

Prefix should only be used to point out the installation directory. It's a pure luck that once you pointed out a prefix, paths to include directories get magically matched. I don't think for example this gonna work on NixOS.

The solution is to run pkg-config --cflags --libs libzfs in configure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants