0

Trying to install the latest method for installing ZFS on ubuntu and failing miserably.

ion@Hades:~$ sudo apt-get install zfsutils-linux

After running to install zfs I get problems during the install and not sure how to proceed.

First Installation: checking all kernels...
Building only for 4.2.0-22-generic
Building initial module for 4.2.0-22-generic
configure: error: in `/var/lib/dkms/spl/0.6.4.2/build':
configure: error: C compiler cannot create executables
See `config.log' for more details
Error! Bad return status for module build on kernel: 4.2.0-22-generic (x86_64)
Consult /var/lib/dkms/spl/0.6.4.2/build/make.log for more information.
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Selecting previously unselected package zfs-dkms.
(Reading database ... 60099 files and directories currently installed.)

Then later in the install I receive this --

First Installation: checking all kernels...
Building only for 4.2.0-22-generic
Building initial module for 4.2.0-22-generic
configure: error: 
*** Please make sure the kmod spl devel <kernel> package for your
*** distribution is installed then try again.  If that fails you
*** can specify the location of the spl objects with the
*** '--with-spl-obj=PATH' option.
Error! Bad return status for module build on kernel: 4.2.0-22-generic (x86_64)
Consult /var/lib/dkms/zfs/0.6.4.2/build/make.log for more information.
Setting up libfakeroot:amd64 (1.20.2-1ubuntu1) ...
Setting up fakeroot (1.20.2-1ubuntu1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up libc-dev-bin (2.21-0ubuntu4) ...
Setting up linux-libc-dev:amd64 (4.2.0-22.27) ...
Setting up libc6-dev:amd64 (2.21-0ubuntu4) ...
Setting up manpages-dev (3.74-1ubuntu1) ...
Setting up libuutil1linux (0.6.4.2-0ubuntu1.2) ...
Setting up libnvpair1linux (0.6.4.2-0ubuntu1.2) ...
Setting up libzpool2linux (0.6.4.2-0ubuntu1.2) ...
Setting up libzfs2linux (0.6.4.2-0ubuntu1.2) ...
Setting up spl (0.6.4.2-0ubuntu1) ...
Setting up zfsutils-linux (0.6.4.2-0ubuntu1.2) ...
zfs-import-cache.service is a disabled or a static unit, not starting it.
zfs-mount.service is a disabled or a static unit, not starting it.
A dependency job for zfs.target failed. See 'journalctl -xe' for details.
zfs.target couldn't start.
zfs-import-scan.service is a disabled or a static unit, not starting it.
Processing triggers for libc-bin (2.21-0ubuntu4) ...
Processing triggers for initramfs-tools (0.120ubuntu6) ...
update-initramfs: Generating /boot/initrd.img-4.2.0-22-generic
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (225-1ubuntu9) ...

So when i go to import the pool I receive this, if anyone has an idea whats going wrong please tell me.

ion@Hades:~$ sudo zpool import storage
Failed to load ZFS module stack.
Load the module manually by running 'insmod <location>/zfs.ko' as root.

Not sure what the problem is related to but here is the journalctl -xe info also

Jan 04 10:05:13 Hades systemd[1]: Dependency failed for ZFS startup     target.
-- Subject: Unit zfs.target has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit zfs.target has failed.
-- 
-- The result is dependency.
Jan 04 10:05:13 Hades systemd[1]: zfs.target: Job zfs.target/start   failed with result 'dependency'.
Jan 04 10:05:13 Hades systemd[1]: Dependency failed for ZFS file system shares.
-- Subject: Unit zfs-share.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit zfs-share.service has failed.
-- 
-- The result is dependency.
Jan 04 10:05:13 Hades systemd[1]: zfs-share.service: Job zfs-   share.service/start failed with result 'dependency'.
Jan 04 10:05:13 Hades systemd[1]: zfs-mount.service: Unit entered failed state.
Jan 04 10:05:13 Hades systemd[1]: zfs-mount.service: Failed with result 'exit-code'.
Jan 04 10:05:13 Hades sudo[18945]: pam_unix(sudo:session): session closed for user root

If someone can point me on how to solve this that would be great as pretty much at a loss is this related to a systemd problem or ? This is a fresh install of ubuntu 15.10.

  • The contents of /var/lib/dkms/zfs/0.6.4.2/build/make.log would be useful to be able to debug this issue further as the DKMS build failed for some reason, so seeing the log is the way forward. – Colin Ian King Jan 4 '16 at 12:33
1

Found the only way to repair this was to install it manually via DKMS. Kept failing if I kept trying to rebuild it.

Get the version number of the registered modules:

 dkms status

To build the modules manually:

 dkms remove -m zfs -v version --all
 dkms remove -m spl -v version --all
 dkms add -m spl -v version
 dkms add -m zfs -v version
 dkms install -m spl -v version
 dkms install -m zfs -v version

Once i had done this it worked every time (tested this multiple times).

1

I've debugged this issue and it is related to bug 1491729, where spl (the Solaris Porting Layer) needs to be built by DKMS before the zfs module. The first step of the fix to this was to add forced module building order in DKMS, however, the flag in zfsutils-linux that sets this ordering for spl and zfs does not seem to be working. I'll try and get that fixed ASAP.

So a quick workaround is:

sudo apt-get install libc-dev && sudo apt-get install zfsutils-linux

UPDATE:

I've figured out the root issue: spl-dkms needs to depend on libc-dev for the configure script to work before SPL is built using DKMS. I've now got a working fix. I'm working on the bug right now and hopefully we can get a fix rolled out on a stable release update in the near future.

0

Just solved this exact same problem on a fresh 15.10 install by following the instructions from here:

Error when installing ubuntu-zfs

Which are to run the following:

apt-get install linux-headers-generic build-essential -y

I did use "apt-get purge" and "apt-get autoremove" remove all the zfs packages that got installed by the failed command and then reinstalled them back.

My pool got mounted automatically once the install completed.

  • there seems to be an issue with dkms and the building of the ZFS kernel modules. The easiest work around at the moment is to install using apt-get install dkms ; apt-get install zfsutils-linux – Colin Ian King Jan 18 '16 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.