在OS启动过程中,有时会遇到系统卡住或机器报告MCE/CATRERR错误,导致系统无法正常启动,但又很难查看执行那个操作时,系统卡住。
这种情况下,我们可以打开系统调试和systemd调试。
以下是打开调试步骤:
在内核启动参数加上以下内容:
rd.debug rdudevdebug systemd.log_level=debug systemd.log_target=console console=ttyS1,115200n8
在CentOS 7中,我们可以将以下内容添加到/etc/default/grub文件中,然后执行grub2-mkconfig -o /boot/grub2/grub.cfg更新GRUB。
GRUB_CMDLINE_LINUX_DEFAULT=” rd.debug rdudevdebug systemd.log_level=debug systemd.log_target=console console=ttyS1,115200n8″
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND=”serial –speed=115200 –unit=0 –word=8 –parity=no –stop=1″
#cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=”$(sed ‘s, release .*$,,g’ /etc/system-release)”
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT=”console”
GRUB_CMDLINE_LINUX=”crashkernel=auto vconsole.font=latarcyrheb-sun16 vconsole.keymap=us biosdevname=0 ipv6.disable=1 console=tty0 console=ttyS1,115200 scsi_mod.scan=sync rd.driver.pre=ahci,mpt2sas,aacraid”
GRUB_DISABLE_RECOVERY=”true”
GRUB_CMDLINE_LINUX_DEFAULT=” rd.debug rdudevdebug systemd.log_level=debug systemd.log_target=console console=ttyS1,115200n8″
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND=”serial –speed=115200 –unit=0 –word=8 –parity=no –stop=1″