我有 Ubuntu 18.04 Server。我发现 GRUB 的行为很奇怪。
当我取消注释 /etc/default/grub 中的行时:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on"
intel_iommu
没有加载到内核中。
当我取消注释该行时:
GRUB_CMDLINE_LINUX="intel_iommu=on"
intel_iommu
已加载到内核。
我的配置:
GRUB_DEFAULT=0
#GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on"
GRUB_CMDLINE_LINUX=""
#GRUB_CMDLINE_LINUX="intel_iommu=on"
我知道GRUB_CMDLINE_LINUX_DEFAULT
只有在正常模式下才会加载。相反,GRUB_CMDLINE_LINUX
只有在正常模式或恢复模式下才会加载。
我的 ubuntu 是否处于恢复模式?
为何intel_iommu
不加载GRUB_CMDLINE_LINUX_DEFAULT
?
在哪里可以找到 GRUB 加载日志?
编辑:
此后,我就没忘记过sudo update-grub
。
更新:
1. 当:
GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity"
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on"
#GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX="intel_iommu=on"
结果:
# sudo virt-host-validate
...
QEMU: Checking if IOMMU is enabled by kernel : PASS
...
# dmesg | grep -E "IOMMU"
[ 0.000000] DMAR: IOMMU enabled
[ 0.000000] DMAR-IR: IOAPIC id 8 under DRHD base 0xfed91000 IOMMU 1
# cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
2. 当这样的时候:
#GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on"
GRUB_CMDLINE_LINUX=""
#GRUB_CMDLINE_LINUX="intel_iommu=on"
结果:
# sudo virt-host-validate
...
QEMU: Checking if IOMMU is enabled by kernel : WARN (IOMMU appears to be disabled in kernel. Add intel_iommu=on to kernel cmdline arguments)
...
# dmesg | grep -E "IOMMU"
[ 0.000000] DMAR-IR: IOAPIC id 8 under DRHD base 0xfed91000 IOMMU 1
# cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.