我在我的“主服务器”(Raspberry Pi 4b)上设置了一个ZFS池,它由各种通过USB连接到Pi的HDD和SSD驱动器组成。我注意到,每当重新启动时,zfs-import-cache.service都无法导入ZFS池。
发布于 2023-04-02 12:54:39
此故障是由于ZFS试图导入池时USB驱动器未被完全加载所致。可以通过向[Unit]的zfs-import-cache.service部分添加一些重写条目来解决这一问题:
$ sudo systemctl edit zfs-import-cache.service
### Editing /etc/systemd/system/zfs-import-cache.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file
[Unit]
Requires=dev-disk-by\x2dlabel-<pool_name>.device
After=dev-disk-by\x2dlabel-<pool_name>.device
### Lines below this comment will be discarded此更改将要求ZFS导入服务在尝试导入池之前等待,直到作为池<pool_name>的一部分设置的驱动器正确可用为止。您需要将<pool_name>替换为您所配置的池的名称。
这在我相对简单的设置上起了作用,只是想在这里分享一下,以防其他人遇到这个问题,并且不想求助于等待加载硬盘的蛮力睡眠方法。
https://serverfault.com/questions/1127714
复制相似问题