美文网首页
CentOS7 Console 配置

CentOS7 Console 配置

作者: 捞小虾 | 来源:发表于2019-02-28 10:57 被阅读0次

    Author: Xu FC

    Console配置


    • 查看是否支持串口,出现以上console enabled表示支持
     -bash-4.2# dmesg | grep tty
     [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-3.10.0-862.11.6.el7.x86_64 root=/dev/mapper/centos-root ro [rd.lvm.lv](http://rd.lvm.lv/)=centos/swap vconsole.font=latarcyrheb-sun16 [rd.lvm.lv](http://rd.lvm.lv/)=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet console=tty0 console=ttyS0, 9600 LANG=en_US.UTF-8
     [ 0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.10.0-862.11.6.el7.x86_64 root=/dev/mapper/centos-root ro [rd.lvm.lv](http://rd.lvm.lv/)=centos/swap vconsole.font=latarcyrheb-sun16 [rd.lvm.lv](http://rd.lvm.lv/)=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet console=tty0 console=ttyS0, 9600 LANG=en_US.UTF-8
     [ 0.000000] console [tty0] enabled
     [ 0.000000] console [ttyS0] enabled
     [ 0.961352] 00:03: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
     [ 0.981919] 00:04: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
    
    • 修改配置文件/etc/default/grub, 设置波特率9600,tty0/ttyS0根据第一步命令查出
     -bash-4.2# vi /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="[rd.lvm.lv](http://rd.lvm.lv/)=centos/swap vconsole.font=latarcyrheb-sun16 [rd.lvm.lv](http://rd.lvm.lv/)=centos/root crashkernel=auto vconsole.keymap=us rhgb quiet"
     GRUB_DISABLE_RECOVERY="true"
     GRUB_CMDLINE_LINUX_DEFAULT="console=tty0 console=ttyS0, 9600"
    
    • 更新grub2配置文件
     -bash-4.2# grub2-mkconfig -o /boot/grub2/grub.cfg
     Generating grub configuration file ...
     Found linux image: /boot/vmlinuz-4.18.8-1.el7.elrepo.x86_64
     Found initrd image: /boot/initramfs-4.18.8-1.el7.elrepo.x86_64.img
     Found linux image: /boot/vmlinuz-3.10.0-862.11.6.el7.x86_64
     Found initrd image: /boot/initramfs-3.10.0-862.11.6.el7.x86_64.img
     Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64
     Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img
     Found linux image: /boot/vmlinuz-0-rescue-8448916f01fd410d9ad2ffb2f7c3ddee
     Found initrd image: /boot/initramfs-0-rescue-8448916f01fd410d9ad2ffb2f7c3ddee.img
     done
    
    • 重启

    相关文章

      网友评论

          本文标题:CentOS7 Console 配置

          本文链接:https://www.haomeiwen.com/subject/qkqhuqtx.html