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

Increase disk detection timeout at boot with Linux/Systemd

· 52CE 我爱测

I have a machine with a lot of disks, and an extra SAS controller in HBA mode. This seems to cause Linux to think for at least 8-10 seconds once in initramfs before the disks actually appear. The timeout for disk detection is 10 …

问题原文

原帖链接 · Alex · CC BY-SA 4.0

I have a machine with a lot of disks, and an extra SAS controller in HBA mode. This seems to cause Linux to think for at least 8-10 seconds once in initramfs before the disks actually appear. The timeout for disk detection is 10 seconds. This causes BTRFS/MDADM/etc fail to mount a RAID1 that I have in my system, dropping me to an emergency shell from where I can actually mount the disks and continue just fine.

My question is, how do I increase this timeout at boot from 10 seconds? Is it in systemd? is it in udev? somewhere else? I'm not sure where to start looking, and googling about this problem mostly seems to yield people looking to raise the I/O timeout or some other (scsi/lun/etc) timeouts, but I'm not looking for that.

已采纳解答

原帖链接 · Alex · CC BY-SA 4.0

I've finally found it! It's of course but a simple kernel parameter, found here https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html

The parameter I was specifically looking for is rootdelay, I had already tried rootwait but apparently that wasn't enough, as it still aborted the wait after 10 seconds. Now it actually does not wait the full 30 seconds specified, but only about 10-15 seconds depending on how long it takes for my disks to show up, so setting a really high value doesn't seem to hurt, although I've only set 30 for my use case, which so far seems to have completely resolved the issue!

You can add it to your kernel boot parameters in Grub or systemd-boot.

Grub: /etc/defaults/grub -> GRUB_CMDLINE_LINUX_DEFAULT="rootdelay=30 quiet"

systemd-boot: /boot/loader/entries/yourentry.cfg -> options rootdelay=30 [other options]

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

资料来源与适用范围

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

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

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