Contents

When a grub change silently does nothing

Contents

I was setting up PCI passthrough for a KVM guest and the detach failed with:

error: Operation not supported: neither VFIO nor KVM device assignment is currently supported on this system

So I went to check VT-d (already enabled in BIOS) and IOMMU, which needs a grub parameter.

I copied the commands off the internet without thinking, and nothing happened. After a closer look, the problem was that grub’s config had been written to the wrong file: legacy and EFI boots keep their config in different places, so regenerating the wrong one leaves your change unapplied.

legacy:

grub2-mkconfig -o /boot/grub2/grub.cfg

EFI:

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

Telling them apart is easy — run df -h. If /boot/efi is mounted separately, the machine boots via EFI and you need to regenerate the grub.cfg under /boot/efi.