大网数据广告活动
服务器运维问答

Wait before zpool import on Ubuntu boot

· 52CE 我爱测

I have installed Ubuntu 18.04 on a Dell PowerEdge R720xd using ZFS. There are two 1TB boot drives in a ZFS mirror configuration. I followed the instructions in the ZFS on Linux Wiki . (Note: My system is using an LSI LSI00244 (92…

问题原文

原帖链接 · Moshe Katz · CC BY-SA 4.0

I have installed Ubuntu 18.04 on a Dell PowerEdge R720xd using ZFS. There are two 1TB boot drives in a ZFS mirror configuration. I followed the instructions in the ZFS on Linux Wiki.

(Note: My system is using an LSI LSI00244 (9201-16i) Host-bus Adapter (HBA) instead of the onboard RAID card, since ZFS and this RAID card don't get along.)

When booting Ubuntu, it takes about ten seconds for the drives to be enumerated by the system (there are 14 drives - two for the OS and 12 for data storage that will be set up in other zpools later). However, the boot process tries to import the boot pool before the drives have been enumerated.

A BusyBox error message flashes past on the screen, and it basically says:

The pool failed to import.

Manually import the pool in this BusyBox shell and then type exit to continue the boot process.

If I wait a few seconds after that message, I see that the 14 drives get listed.

I type zpool import rpool at the BusyBox prompt, which works (confirmed with zpool list) and then exit to continue the boot process. (This then leads to my next problem, a Kernel crash, but that's a separate question.)

I tried adding rootdelay=15 to the boot options, but that doesn't seem to work since it seems to want to run that delay after the ZFS pool import.

How can I get the boot process to wait for the devices to show up before it tries to import the pool?

已采纳解答

原帖链接 · Moshe Katz · CC BY-SA 4.0

I finally found this in /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'

Here's how to set it.

  1. Boot from a Ubuntu Live CD (or any other recovery media)
  2. Import the pool to /mnt using zpool import rpool -R /mnt
  3. Bind the necessary filesyststems mount --rbind /dev /mnt/dev; mount --rbind /proc /mnt/proc; mount --rbind /sys /mnt/sys
  4. Chroot into /mnt: chroot /mnt /bin/bash --login
  5. Edit /etc/default/zfs to change the value above from 0 to 15
  6. Run update-initramfs and update-grub
  7. Exit the Chroot environment and reboot

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-06-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。