debian 9stretchにzfsをインストールする

debian 9stretchにzfsをインストールする

Debian 9.1 に zfs をインストールしようとすると、いくつかのエラーが発生します。

最初のインストールはzfs-dkmsでしたが、オンラインでzfs-dkmsを実行するにはspl-dkmsも必要であることを読んでいました。


私のステップは私の変更のためのものですソース、リスト次へ追加無料寄付次のように:

/etc/apt/sources.list

deb http://ftp.nl.debian.org/debian/ stretch main contrib non-free
deb-src http://ftp.nl.debian.org/debian/ stretch main contrib non-free

deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free

# stretch-updates, previously known as 'volatile'
deb http://ftp.nl.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://ftp.nl.debian.org/debian/ stretch-updates main contrib non-free

クラシックapt-getアップデートを完了したら、次のようにzfsをインストールしてみてください。

apt-get install spl-dkms

そしてその後

apt-get install zfs-dkms

その結果、次のエラーが発生しました。

root@debian:/etc/apt# apt-get install zfs-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libnvpair1linux libuutil1linux libzfs2linux libzpool2linux zfs-zed zfsutils-linux

...

DKMS: install completed.
Setting up libzpool2linux (0.6.5.9-5) ...
Setting up libzfs2linux (0.6.5.9-5) ...
Setting up zfsutils-linux (0.6.5.9-5) ...
Created symlink /etc/systemd/system/zfs-mount.service.wants/zfs-import-cache.service â /lib/systemd/system/zfs-import-cac
Created symlink /etc/systemd/system/zfs.target.wants/zfs-import-cache.service â /lib/systemd/system/zfs-import-cache.serv
Created symlink /etc/systemd/system/zfs-share.service.wants/zfs-mount.service â /lib/systemd/system/zfs-mount.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-mount.service â /lib/systemd/system/zfs-mount.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-share.service â /lib/systemd/system/zfs-share.service.
Created symlink /etc/systemd/system/multi-user.target.wants/zfs.target â /lib/systemd/system/zfs.target.
zfs-import-scan.service is a disabled or a static unit, not starting it.
Job for zfs-mount.service failed because the control process exited with error code.
See "systemctl status zfs-mount.service" and "journalctl -xe" for details.
zfs-mount.service couldn't start.
Job for zfs-share.service failed because the control process exited with error code.
See "systemctl status zfs-share.service" and "journalctl -xe" for details.
zfs-share.service couldn't start.
Setting up zfs-zed (0.6.5.9-5) ...
Created symlink /etc/systemd/system/zed.service â /lib/systemd/system/zfs-zed.service.
Created symlink /etc/systemd/system/zfs.target.wants/zfs-zed.service â /lib/systemd/system/zfs-zed.service.
Processing triggers for libc-bin (2.24-11+deb9u1) ...

読むログ制御-xe提案したとおり、次のようになります。

root@debian:/etc/apt# journalctl -xe
Aug 02 23:13:13 debian systemd[1]: zfs-share.service: Main process exited, code=exited, status=1/FAILURE
Aug 02 23:13:13 debian systemd[1]: Failed to start ZFS file system shares.
-- Subject: Unit zfs-share.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit zfs-share.service has failed.
--
-- The result is failed.
Aug 02 23:13:13 debian systemd[1]: zfs-share.service: Unit entered failed state.
Aug 02 23:13:13 debian systemd[1]: zfs-share.service: Failed with result 'exit-code'.
Aug 02 23:13:13 debian systemd[1]: Starting Mount ZFS filesystems...
-- Subject: Unit zfs-mount.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit zfs-mount.service has begun starting up.
Aug 02 23:13:13 debian zfs[81481]: The ZFS modules are not loaded.
Aug 02 23:13:13 debian zfs[81481]: Try running '/sbin/modprobe zfs' as root to load them.
Aug 02 23:13:13 debian systemd[1]: zfs-mount.service: Main process exited, code=exited, status=1/FAILURE
Aug 02 23:13:13 debian systemd[1]: Failed to start Mount ZFS filesystems.
-- Subject: Unit zfs-mount.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit zfs-mount.service has failed.
--
-- The result is failed.
Aug 02 23:13:13 debian systemd[1]: zfs-mount.service: Unit entered failed state.
Aug 02 23:13:13 debian systemd[1]: zfs-mount.service: Failed with result 'exit-code'.
Aug 02 23:13:13 debian systemd[1]: Starting ZFS file system shares...
-- Subject: Unit zfs-share.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit zfs-share.service has begun starting up.
Aug 02 23:13:13 debian systemd[81483]: zfs-share.service: Failed at step EXEC spawning /usr/bin/rm: No such file or direc
-- Subject: Process /usr/bin/rm could not be executed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The process /usr/bin/rm could not be executed and failed.
--
-- The error number returned by this process is 2.

どうなりますか?私がまた逃したことがありますか?どうですか?zfs - Linuxzfsのインストールに関連するパッケージ?

Debian 9にzfsをインストールする正しい方法は何ですか?

ベストアンサー1

@casの実際の答えは良いですが、いくつかの修正が必要です。

それでは、Debian 9を新しくインストールしてみましょう。無料寄付リポジトリもアクティブではありません。


ステップ00 - Contrib有料ストレージを有効にする

sed私はその言葉を見つけて変えた。基本~へ/etc/apt/sources.list

sed -i 's/main/main contrib non-free/g' /etc/apt/sources.list

apt-get update

ステップ1 - ZFSのインストール

最後の修正はspl-dkms正しくzfs-dkms依存関係と見なされ、自動的に呼び出されるため、以前に手動でインストールする必要はありませんzfs-dkmsrm正しい場所でバイナリを見つけられないDebianのzfsディストリビューション内のバグのため、シンボリックリンクが必要です。

apt -y install linux-headers-$(uname -r)

ln -s /bin/rm /usr/bin/rm

apt-get -y install zfs-dkms

ステップ2 - ZFSの再起動

この時点でzfs-dkmsがインストールされましたが、エラーが発生しますjournalctl -xe。 zfs を正しく開始するには、次のようにします。

/sbin/modprobe zfs

systemctl restart zfs-import-cache
systemctl restart zfs-import-scan
systemctl restart zfs-mount
systemctl restart zfs-share

ステップ3 - 1つ以上のZPOOLを作成する必要があります。

この時点で見つかった再起動する前にzpoolを作成する必要があります。そうしないと、zpoolがないとzfsは正しいモジュールをロードできません。これはリソース節約メカニズムです(ただし、この場合でも内部的にエラーが発生しますjournalctl -xe)。

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864348

「ZFSモジュールがカーネルを汚染し、zpoolが利用できない場合はロードしないでください。これは行われません。」

この部分を逃した場合は、次から始める必要があります。ステップ2

たとえば、このファイルに基づいてzpoolを作成したり、@casが提供する例を使用してディスクベースのzpoolを直接作成したりできます。

truncate -s 100M /root/z1
truncate -s 100M /root/z2
zpool create tank /root/z1 /root/z2
zpool scrub tank
zpool status

これによりreboot、すべてがエラーなしでうまく機能します。journalctl -xe

おすすめ記事