升级到 16.04 后如何使 ZFS 正常工作?

升级到 16.04 后如何使 ZFS 正常工作?

我最近刚刚从 14.04 升级到 16.04,在此过程中我的 ZFS 停止工作。我之前使用的是来自 PPA 的 ZFS 软件包,但我已按照此处的说明删除/清除它们:在 Ubuntu 16.04LTS 上安装 ZFS

安装后,运行 ZFS 命令时出现错误:

:~$ sudo zfs get all
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.

如果我尝试按照说明进行操作,则会收到以下错误:

:~$ sudo /sbin/modprobe zfs
modprobe: ERROR: could not insert 'zfs': Invalid argument

当我重新安装 ZFS 时,我收到一些错误,但我不确定这些错误是否与我的问题有关?

:~$ sudo apt-get install zfsutils-linux
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libnvpair1linux libuutil1linux libzfs2linux libzpool2linux zfs-doc zfs-zed
Suggested packages:
  zfs-initramfs
The following NEW packages will be installed:
  libnvpair1linux libuutil1linux libzfs2linux libzpool2linux zfs-doc zfs-zed zfsutils-linux
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 897 kB of archives.
After this operation, 2,902 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 zfs-doc all 0.6.5.6-0ubuntu16 [50.1 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libuutil1linux amd64 0.6.5.6-0ubuntu16 [27.5 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libnvpair1linux amd64 0.6.5.6-0ubuntu16 [23.4 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libzpool2linux amd64 0.6.5.6-0ubuntu16 [384 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libzfs2linux amd64 0.6.5.6-0ubuntu16 [106 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 zfsutils-linux amd64 0.6.5.6-0ubuntu16 [276 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 zfs-zed amd64 0.6.5.6-0ubuntu16 [29.8 kB]
Fetched 897 kB in 0s (2,402 kB/s)
Selecting previously unselected package zfs-doc.
(Reading database ... 172013 files and directories currently installed.)
Preparing to unpack .../zfs-doc_0.6.5.6-0ubuntu16_all.deb ...
Unpacking zfs-doc (0.6.5.6-0ubuntu16) ...
Selecting previously unselected package libuutil1linux.
Preparing to unpack .../libuutil1linux_0.6.5.6-0ubuntu16_amd64.deb ...
Unpacking libuutil1linux (0.6.5.6-0ubuntu16) ...
Selecting previously unselected package libnvpair1linux.
Preparing to unpack .../libnvpair1linux_0.6.5.6-0ubuntu16_amd64.deb ...
Unpacking libnvpair1linux (0.6.5.6-0ubuntu16) ...
Selecting previously unselected package libzpool2linux.
Preparing to unpack .../libzpool2linux_0.6.5.6-0ubuntu16_amd64.deb ...
Unpacking libzpool2linux (0.6.5.6-0ubuntu16) ...
Selecting previously unselected package libzfs2linux.
Preparing to unpack .../libzfs2linux_0.6.5.6-0ubuntu16_amd64.deb ...
Unpacking libzfs2linux (0.6.5.6-0ubuntu16) ...
Selecting previously unselected package zfsutils-linux.
Preparing to unpack .../zfsutils-linux_0.6.5.6-0ubuntu16_amd64.deb ...
Unpacking zfsutils-linux (0.6.5.6-0ubuntu16) ...
Selecting previously unselected package zfs-zed.
Preparing to unpack .../zfs-zed_0.6.5.6-0ubuntu16_amd64.deb ...
Unpacking zfs-zed (0.6.5.6-0ubuntu16) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for initramfs-tools (0.122ubuntu8.8) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-77-generic
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up zfs-doc (0.6.5.6-0ubuntu16) ...
Setting up libuutil1linux (0.6.5.6-0ubuntu16) ...
Setting up libnvpair1linux (0.6.5.6-0ubuntu16) ...
Setting up libzpool2linux (0.6.5.6-0ubuntu16) ...
Setting up libzfs2linux (0.6.5.6-0ubuntu16) ...
Setting up zfsutils-linux (0.6.5.6-0ubuntu16) ...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
insserv: warning: script 'plexmediaserver' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `plexmediaserver'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `plexmediaserver'
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
insserv: warning: script 'screen-cleanup' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `screen-cleanup'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `screen-cleanup'
zfs-import-cache.service is a disabled or a static unit, not starting it.
zfs-import-scan.service is a disabled or a static unit, not starting it.
zfs-mount.service is a disabled or a static unit, not starting it.
Processing triggers for initramfs-tools (0.122ubuntu8.8) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-77-generic
Setting up zfs-zed (0.6.5.6-0ubuntu16) ...
zed.service is a disabled or a static unit, not starting it.
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...

答案1

这篇文章的帮助解决了我的问题:Ubuntu 14.04 升级到 16.04 破坏了我的 ZFS

我不确定这次到底是什么修复了这个问题,但下面列出了我在它开始起作用之前尝试过的方法。我的池甚至没有重新启动就被挂载了!

apt clean
apt update
apt purge zfs*
apt-get remove spl dkms spl-dkms
apt-get autoremove
add-apt-repository --remove ppa:zfs-native/stable

apt-get install zfsutils-linux
apt-get install spl-dkms

相关内容