Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1668826
  • 博文数量: 636
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 3950
  • 用 户 组: 普通用户
  • 注册时间: 2014-08-06 21:58
个人简介

博客是我工作的好帮手,遇到困难就来博客找资料

文章分类

全部博文(636)

文章存档

2024年(5)

2022年(2)

2021年(4)

2020年(40)

2019年(4)

2018年(78)

2017年(213)

2016年(41)

2015年(183)

2014年(66)

我的朋友

分类: 系统运维

2016-05-11 12:12:54

第一步:
echo "S0:12345:respawn:/sbin/agetty/ ttyS0 115200" >> /etc/inittab


第二步:
echo "ttyS0" >> /etc/securetty


第三步:
在/etc/grub.conf文件中为内核添加参数:
console=ttyS0


cat  /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg_ameim7-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/vda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-358.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=/dev/mapper/vg_ameim7-lv_root rd_NO_LUKS rd_LVM_LV=vg_ameim7/lv_swap rd_NO_MD rd_LVM_LV=vg_ameim7/lv_root crashkernel=128M LANG=zh_CN.UTF-8  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet console=ttyS0
        initrd /initramfs-2.6.32-358.el6.x86_64.img


如果是grub2系统,请修改

vim /etc/default/grub文件,

GRUB_CMDLINE_LINUX=" console=tty0 console=ttyS0",

然后update-grub 

即执行如下命令,然后重启机器
grub2-mkconfig -o /boot/grub2/grub.cfg 

阅读(1316) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~