OS 内核 Grub参数设置

临时修改

临时修改可以方便地测试和验证内核参数是否有效地解决问题,而这只需要在系统启动时,选中条目,e 键即可进入编辑模式,将参数追加到 linux 所在行。

永久修改

经过临时修改验证后,是时候将其修改永久保存,将内核参数追加到 /etc/default/grub 文件中的 GRUB_CMDLINE_LINUX_DEFAULT,每个参数以空格隔开。比如开启OS串口重定向

console=        [KNL] Output console device and options.

tty<n>        Use the virtual console device <n>.

ttyS<n>[,options]

ttyUSB0[,options]

Use the specified serial port.  The options are of

the form "bbbbpnf", where "bbbb" is the baud rate,

"p" is parity ("n", "o", or "e"), "n" is number of

bits, and "f" is flow control ("r" for RTS or

omit it).  Default is "9600n8".

See Documentation/serial-console.txt for more

information.  See

Documentation/networking/netconsole.txt for an

alternative.

uart[8250],io,<addr>[,options]

uart[8250],mmio,<addr>[,options]

Start an early, polled-mode console on the 8250/16550

UART at the specified I/O port or MMIO address,

switching to the matching ttyS device later.  The

options are the same as for ttyS, above.

hvc<n>        Use the hypervisor console device <n>. This is for

both Xen and PowerPC hypervisors.

                If the device connected to the port is not a TTY but a braille

                device, prepend "brl," before the device type, for instance

console=brl,ttyS0

For now, only VisioBraille is supported.

找到 GRUB_CMDLINE_LINUX 修改为

GRUB_CMDLINE_LINUX="console=ttyS0,115200n8"

 

例如IOMMU 功能开关

amd_iommu=        [HW,X86-64]

Pass parameters to the AMD IOMMU driver in the system.

Possible values are:

fullflush - enable flushing of IO/TLB entries when

    they are unmapped. Otherwise they are

    flushed before they will be reused, which

    is a lot of faster

off          - do not initialize any AMD IOMMU found in

    the system

force_isolation - Force device isolation for all

  devices. The IOMMU driver is not

  allowed anymore to lift isolation

  requirements as needed. This option

  does not override iommu=pt

amd_iommu_dump=        [HW,X86-64]

Enable AMD IOMMU driver option to dump the ACPI table

for AMD IOMMU. With this option enabled, AMD IOMMU

driver will print ACPI tables for AMD IOMMU during

IOMMU initialization.

amd_iommu_intr=        [HW,X86-64]

Specifies one of the following AMD IOMMU interrupt

remapping modes:

legacy     - Use legacy interrupt remapping mode.

vapic      - Use virtual APIC mode, which allows IOMMU

             to inject interrupts directly into guest.

             This mode requires kvm-amd.avic=1.

             (Default when IOMMU HW support is present.)

找到 GRUB_CMDLINE_LINUX 修改为

GRUB_CMDLINE_LINUX="amd_iommu=on iommu=pt” 

然后执行

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

详细的OS kernel grub参数设置入附件  Kernel Parameters

  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值