在 Ubuntu 引导上的 zpool 导入之前等待

Mos*_*atz 6 ubuntu zfs boot zfsonlinux ubuntu-18.04

我已经使用 ZFS 在 Dell PowerEdge R720xd 上安装了 Ubuntu 18.04。ZFSmirror配置中有两个 1TB 引导驱动器。我按照Linux Wiki 上ZFS 中的说明进行操作。

(注意:我的系统使用的是 LSI LSI00244 (9201-16i) 主机总线适配器 (HBA) 而不是板载 RAID 卡,因为 ZFS 和这个 RAID 卡不兼容。)

启动 Ubuntu 时,系统枚举驱动器大约需要 10 秒钟(有 14 个驱动器 - 两个用于操作系统,12 个用于稍后将在其他 zpool 中设置的数据存储)。但是,引导过程会在枚举驱动器之前尝试导入引导池。

BusyBox 错误消息在屏幕上闪过,它基本上说:

池导入失败。

在此 BusyBox shell 中手动导入池,然后键入exit以继续引导过程。

如果我在该消息后等待几秒钟,我会看到列出了 14 个驱动器。

zpool import rpool在 BusyBox 提示符下输入,它可以工作(用 确认zpool list),然后exit继续启动过程。(这会导致我的下一个问题,内核崩溃,但这是一个单独的问题。)

我尝试添加rootdelay=15启动选项,但这似乎不起作用,因为它似乎想在 ZFS 池导入运行该延迟。

在尝试导入池之前,如何让引导过程等待设备出现?

Mos*_*atz 9

我终于在/etc/default/zfs

# Wait for this many seconds in the initrd mountroot?
# This delays startup and should be '0' on most systems. This might help on
# systems which have their ZFS root on a USB disk that takes just a little
# longer to be available
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_INITRD_POST_MODPROBE_SLEEP='0'
Run Code Online (Sandbox Code Playgroud)

这是设置方法。

  1. 从 Ubuntu Live CD(或任何其他恢复媒体)启动
  2. 导入池/mnt使用zpool import rpool -R /mnt
  3. 绑定必要的文件系统 mount --rbind /dev /mnt/dev; mount --rbind /proc /mnt/proc; mount --rbind /sys /mnt/sys
  4. chroot 到/mntchroot /mnt /bin/bash --login
  5. 编辑/etc/default/zfs以将上面的值从 更改015
  6. 运行update-initramfsupdate-grub
  7. 退出 Chroot 环境并重启

  • @ewwhite 为什么?我与几位 Ubuntu 开发人员交谈过,他们现在正在推荐它。(有些人说“要么 ZFS 或 BTRFS”,但所有人都说“如果你的选择是 `mdadm` 或 ZFS,绝对选择 ZFS”)。 (2认同)