解决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

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

 

你可能感兴趣的:(工作,centos,Module,服务器,xen)