尝试在 ubuntu 上安装 ZFS 的最新方法,但失败了。
ion@Hades:~$ sudo apt-get install zfsutils-linux
运行安装 zfs 后,我在安装过程中遇到问题,不知道如何继续。
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.)
然后在安装过程中我收到了这个--
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) ...
因此,当我去导入池时,我收到了此信息,如果有人知道出了什么问题,请告诉我。
ion@Hades:~$ sudo zpool import storage
Failed to load ZFS module stack.
Load the module manually by running 'insmod <location>/zfs.ko' as root.
不确定问题与什么有关,但这里还有 journalctl -xe 信息
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
如果有人能告诉我如何解决这个问题,那就太好了,因为我几乎不知道这是否与 systemd 问题有关?这是 ubuntu 15.10 的全新安装。
答案1
发现修复此问题的唯一方法是通过 DKMS 手动安装。如果我继续尝试重建它,就会一直失败。
获取已注册模块的版本号:
dkms status
要手动构建模块:
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
一旦我这样做了,它每次都会有效(多次测试)。
答案2
我已经调试了这个问题,它与 bug 有关1491729其中 spl(Solaris 移植层)需要由知识管理系统在 zfs 模块之前。修复此问题的第一步是在 DKMS 中添加强制模块构建顺序,但是,zfsutils-linux 中为 spl 和 zfs 设置此顺序的标志似乎不起作用。我会尽快修复它。
因此,一个快速的解决方法是:
sudo apt-get install libc-dev && sudo apt-get install zfsutils-linux
更新:
我已经找出了根本问题:在使用 DKMS 构建 SPL 之前,spl-dkms
需要依赖configure 脚本才能运行。我现在找到了一个可行的解决方案。我正在研究libc-dev
漏洞现在,希望我们能在不久的将来在稳定版本更新中推出修复程序。
答案3
按照此处的说明,在全新安装的 15.10 上解决了同样的问题:
要运行下列操作:
apt-get install linux-headers-generic build-essential -y
我确实使用“apt-get purge”和“apt-get autoremove”删除了所有由失败的命令安装的 zfs 包,然后重新安装它们。
安装完成后,我的池就会自动安装。