背景
有些内核不使用grub或者启动使用UEFI等配置后,造成使用经典的/etc/default/grub不生效。有些时候有办法找到真正的/boot目录下的文件,直接修改问题。还有可以使用grubby给Linux系统的启动参数添加参数。比如以iommu等参数为例
grubby用法
比如添加打开iommu以及开启pt和realloc
## 添加
grubby --update-kernel=$(grubby --default-kernel) --args="intel_iommu=on iommu=pt pci=realloc"
## 删除
grubby --update-kernel=$(grubby --default-kernel) --remove-args="intel_iommu=on iommu=pt pci=realloc"
# 查看
grubby --info=ALL |grep iommu
比如添加crashkernel(当前运行的内核添加crashkernel=128M)
sudo grubby --update-kernel="/boot/vmlinuz-$(uname -r)" --args="crashkernel=128M"
#还有一种动态配置方法,有些系统不一定支持
sudo grubby --update-kernel="/boot/vmlinuz-$(uname -r)" --args="crashkernel=0M-2G:0M,2G-8G:192M,8G-128G"
#参数的含义是:
#对于小于2GB内存的系统,不预留内存(0M)。
#对于2GB到8GB内存的系统,预留192MB内存。
#对于8GB到128GB内存的系统,预留256MB内存。
兄弟篇: https://blog.csdn.net/essencelite/article/details/141372047