解决centOS5中xen内核占用串口的问题

         很久以前的事了,无意中又再次看到,记录下来分享一下。

         背景:给客户开发系统中有短信功能,使用的设备是金笛串口短信猫。系统开发完毕给客户上线后,却发现短信发不出去。

         原因:在开发时使用的系统是centOS4,而给客户安装的系统是centOS5,centOS5的默认安装是带Xen内核的,Xen内核回占用串口1,从而导致连接到串口1上的其他设备无法正常工作。

        解决方法:

        1.在安装centOS时,选择不安装Xen内核。

        2.假如已经安装了Xen内核,打开/boot/grup/路径下的grup.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/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.el5xen)
 root (hd0,0)
 kernel /xen.gz-2.6.18-128.el5
 module /vmlinuz-2.6.18-128.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet xencons=tty
 module /initrd-2.6.18-128.el5xen.img
title CentOS-base (2.6.18-128.el5)
 root (hd0,0)
 kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
 initrd /initrd-2.6.18-128.el5.img

修改之后的为(红色字体部分为增加部分)。

# 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/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.el5xen)
 root (hd0,0)
 kernel /xen.gz-2.6.18-128.el5
console=vga xencons=ttyS16 console=ttyS16
 module /vmlinuz-2.6.18-128.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet xencons=tty
 module /initrd-2.6.18-128.el5xen.img
title CentOS-base (2.6.18-128.el5)
 root (hd0,0)
 kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
 initrd /initrd-2.6.18-128.el5.img

修改完毕之后,重新启动服务器,即可解除对串口的占用。

 

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值