无法从 Ubuntu Lunar 的源代码编译 ZFS

无法从 Ubuntu Lunar 的源代码编译 ZFS

我尝试从 Ubuntu Lunar 的源代码编译 ZFS,但失败了。这是我遵循的教程:

https://uptrace.dev/blog/ubuntu-install-zfs.html

这是完整日志:

sudo apt install build-essential autoconf automake libtool
gawk alien fakeroot dkms libblkid-dev uuid-dev libudev-dev
libssl-dev zlib1g-dev libaio-dev libattr1-dev libelf-dev
linux-headers-$(uname -r) python3 python3-dev python3-
setuptools python3-cffi libffi-dev python3-packaging git

编译ZFS:

git clone https://github.com/openzfs/zfs
cd ./zfs
git checkout master

已在 'master' 上。您的分支已与 'origin/master' 同步更新。

sh autogen.sh

https://pastebin.ubuntu.com/p/bpcqTg3FRV/

# sudo ./configure

https://pastebin.ubuntu.com/p/r5RtFvqxvN/

# sudo make -s -j$(nproc)

https://pastebin.ubuntu.com/p/crZyh4xcZW/

卸载现有的 ZFS 数据集和导出池:

sudo zfs unmount -a


The ZFS modules cannot be auto-loaded.

Try running 'modprobe zfs' as root to manually load them

modprobe: FATAL: Module zfs not found in directory /lib/modules/6.2.0-23-generic


sudo zpool export -a


The ZFS modules cannot be auto-loaded.

Try running 'modprobe zfs' as root to manually load them.


sudo systemctl stop zfs-send


Failed to stop zfs-send.service: Unit zfs-send.service not loaded.

Unload existing ZFS modules:


sudo ./scripts/zfs.sh -u = OK


Install newly compiled ZFS:


sudo make install

https://pastebin.ubuntu.com/p/ztYb89g8KQ/

sudo ldconfig = OK
sudo depmod


depmod: ERROR: could not open directory /lib/modules/6.2.0-23-generic: No such file or directory

Load freshly built Linux modules:


sudo ./scripts/zfs.sh = OK


Failed to load /home/ziomario/Scaricati/zfs/module/zfs.ko

And make sure that ZFS services are enabled:


sudo systemctl enable zfs.target zfs-import.target zfs-mount.service zfs-import-cache.service zfs-import-scan.service


Synchronizing state of zfs-mount.service with SysV service script with /lib/systemd/systemd-sysv-install.

Executing: /lib/systemd/systemd-sysv-install enable zfs-mount


zpool import -f -R /mnt/zroot2 zroot2


The ZFS modules cannot be auto-loaded.

Try running 'modprobe zfs' as root to manually load them.


# sudo modprobe zfs


modprobe: FATAL: Module zfs not found in directory /lib/modules/6.2.0-23-generic

如何修复?非常感谢。

相关内容