RedHat和CentOS 5系统的版本不支持神龙VM环境,建议升级到5.11版本,本文主要介绍RedHat和CentOS 5系统版本升级到5.11版本的方法。
升级不同内核及系统组件版本后,可能会对原有业务程序运行有影响,请做好评估及测试。
cat /etc/redhat-release
uname -r
wget http://vault.centos.org/5.11/os/x86_64/CentOS/kernel-2.6.18-398.el5.x86_64.rpm
wget https://vault.centos.org/5.11/os/i386/CentOS/kernel-2.6.18-398.el5.i686.rpm
rpm -ivh --force ./kernel-2.6.18-398.e15.[$System_Version].rpm
说明 :[$System_Version]为系统版本,如果是64为系统则为x86_64,是32位系统则为i686。
/boot/grub/grub.conf
文件,将新安装的内核配置menuentry放在配置文件最上方,设置为优先启动。
/etc/fstab
文件,将磁盘分区挂载配置
/dev/sdxx
相关的设备名配置改成
UUID=[$UUID]
的形式。
说明
:[$UUID]为对应根分区UUID,通过执行
blkid
命令查看云盘UUID。
/boot/grub/grub.conf
文件,将
root=/dev/sdxx
相关的设备名配置改成
root=UUID=[$UUID]
的形式。
mkinitrd -f --allow-missing \
--with=xen-vbd --preload=xen-vbd \
--with=xen-platform-pci --preload=xen-platform-pci \
--with=virtio_blk --preload=virtio_blk \
--with=virtio_pci --preload=virtio_pci \
--with=virtio_console --preload=virtio_console \
--with=hvc_console --preload=hvc_console \
--with=ahci --preload=ahci \
/boot/initrd-2.6.18-398.el5.x86_64.img $(uname -r)
yum update -y5.11的YUM源 信息如下。
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://vault.centos.org/5.11/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
baseurl=http://vault.centos.org/5.11/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://vault.centos.org/5.11/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://vault.centos.org/5.11/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
baseurl=http://vault.centos.org/5.11/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
如果是线下服务器,系统需要迁移到阿里云:
rpm -qa | grep kernel
yum remove kernel-2.6.18-xxx.el5
/boot/grub/grub.conf
文件,移除旧内核配置。
文档内容是否对您有帮助?