我刚刚将 Ubuntu 从 14.04 升级到 16.04,这似乎破坏了 ZFS。我按照说明这里并清除了所有旧的 ZFS 软件包。然后我从默认的 16.04 PPA 安装了 zfsutils-linux,但每当我运行任何 ZFS 命令时,我都会收到以下错误:
:~$ sudo zfs get all
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.
我尝试使用 modprobe 按照错误消息的建议:
:~$ sudo /sbin/modprobe zfs
modprobe: ERROR: could not insert 'zfs': Invalid argument
看起来好像没有安装 ZFS,但是 apt-get 显示已经安装:
:~$ sudo apt-get install zfsutils-linux
Reading package lists... Done
Building dependency tree
Reading state information... Done
zfsutils-linux is already the newest version (0.6.5.6-0ubuntu16).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-dist' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
我还亲自来到我的机器上,而不是使用 SSH 来观察启动过程,并看到许多 ZFS 项目在启动时失败,其中一个我认为是关于依赖关系的,但它过去得太快了,我没法全部读完。我试图通过查看启动日志来查看它们说了什么,但我找不到与启动期间显示的输出相匹配的启动日志文件。我可以在哪里查看启动时实际失败的原因?
进一步有趣的发现是,如果我只使用 zfs 命令,我会得到“缺少命令”输出,但是当添加任何命令时,我都会收到上述相同的错误消息。
:~$ zfs
missing command
usage: zfs command args ...
where 'command' is one of the following:
create [-p] [-o property=value] ... <filesystem>
create [-ps] [-b blocksize] [-o property=value] ... -V <size> <volume>
destroy [-fnpRrv] <filesystem|volume>
destroy [-dnpRrv] <filesystem|volume>@<snap>[%<snap>][,...]
destroy <filesystem|volume>#<bookmark>
snapshot|snap [-r] [-o property=value] ... <filesystem|volume>@<snap> .. .
rollback [-rRf] <snapshot>
clone [-p] [-o property=value] ... <snapshot> <filesystem|volume>
promote <clone-filesystem>
rename [-f] <filesystem|volume|snapshot> <filesystem|volume|snapshot>
rename [-f] -p <filesystem|volume> <filesystem|volume>
rename -r <snapshot> <snapshot>
bookmark <snapshot> <bookmark>
list [-Hp] [-r|-d max] [-o property[,...]] [-s property]...
[-S property]... [-t type[,...]] [filesystem|volume|snapshot] ...
set <property=value> <filesystem|volume|snapshot> ...
get [-rHp] [-d max] [-o "all" | field[,...]]
[-t type[,...]] [-s source[,...]]
<"all" | property[,...]> [filesystem|volume|snapshot] ...
inherit [-rS] <property> <filesystem|volume|snapshot> ...
upgrade [-v]
upgrade [-r] [-V version] <-a | filesystem ...>
userspace [-Hinp] [-o field[,...]] [-s field] ...
[-S field] ... [-t type[,...]] <filesystem|snapshot>
groupspace [-Hinp] [-o field[,...]] [-s field] ...
[-S field] ... [-t type[,...]] <filesystem|snapshot>
mount
mount [-vO] [-o opts] <-a | filesystem>
unmount [-f] <-a | filesystem|mountpoint>
share <-a | filesystem>
unshare <-a | filesystem|mountpoint>
send [-DnPpRvLe] [-[iI] snapshot] <snapshot>
send [-Le] [-i snapshot|bookmark] <filesystem|volume|snapshot>
receive [-vnFu] <filesystem|volume|snapshot>
receive [-vnFu] [-d | -e] <filesystem>
allow <filesystem|volume>
allow [-ldug] <"everyone"|user|group>[,...] <perm|@setname>[,...]
<filesystem|volume>
allow [-ld] -e <perm|@setname>[,...] <filesystem|volume>
allow -c <perm|@setname>[,...] <filesystem|volume>
allow -s @setname <perm|@setname>[,...] <filesystem|volume>
unallow [-rldug] <"everyone"|user|group>[,...]
[<perm|@setname>[,...]] <filesystem|volume>
unallow [-rld] -e [<perm|@setname>[,...]] <filesystem|volume>
unallow [-r] -c [<perm|@setname>[,...]] <filesystem|volume>
unallow [-r] -s @setname [<perm|@setname>[,...]] <filesystem|volume>
hold [-r] <tag> <snapshot> ...
holds [-r] <snapshot> ...
release [-r] <tag> <snapshot> ...
diff [-FHt] <snapshot> [snapshot|filesystem]
Each dataset is of the form: pool/[dataset/]*dataset[@name]
For the property list, run: zfs set|get
For the delegated permission list, run: zfs allow|unallow
我还能做什么来解决此 ZFS 安装问题?
答案1
从 12.04 升级到 16.04 时也遇到了类似的问题。最后终于可以正常工作了,但我记不清具体做了什么(第 2 步不太明显)。
zfs
删除包括 PPA 在内的旧软件包,请参阅使用 ubuntu-zfs 从 ubuntu server 14.04 LTS 升级到 16.04 LTS- 删除:
spl-dkms
和(我认为)spl
- 重新安装
zfs
答案2
以下一系列root
命令为我解决了这个问题。
apt clean
apt update
apt purge zfs*
apt remove spl dkms spl-dkms
apt autoremove
add-apt-repository --remove ppa:zfs-native/stable
apt install zfsutils-linux
apt install spl-dkms
reboot -n