昨日CentOS 7が公開されましたが、CentOS6.5から7へのアップグレードパスは無いか調べてみると、リリースノートのIntroductionの中に気になる一文が。
Manuals/ReleaseNotes/CentOS7 – CentOS Wiki /
http://wiki.centos.org/Manuals/ReleaseNotes/CentOS7#head-fff8f6a835097f88dd3c7b1fea51ac75669c68d3
For the first time, there is a supported upgrade path from CentOS-6 to CentOS-7. This path is only supported from the latest version of CentOS-6 (being 6.5 at the time of writing) to the latest version of CentOS-7. For more information on the upgrade procedure please take a look at this page. The tools needed for this functionality are still being tested and will be released at a later time. If you can help with the testing, please see this CentOS-Devel mailing list thread.
テストリリースというか開発版のような位置づけで、アップグレード用のパッケージが用意されていました。
ということで早速試してみました。
Index of /centos/6/upg/x86_64/Packages /
http://dev.centos.org/centos/6/upg/x86_64/Packages/
検証環境:
- CentOS 6.5 x64
手順
- なお、事前に
CentOS-7.0-1406-x86_64-DVD.iso
をアップグレードしたいサーバ内に置いておく。 - 今回の手順が正しいものなのか責任は取れませんので、実施する際は必ずデータのバックアップを取るようにしてください。
1. 関連パッケージを先にインストールする。
yum install libexslt openscap m2crypto python-simplejson libxslt-devel.x86_64
2. 上記Webサイトからパッケージをダウンロードする。
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-1.0.2-33.el6.x86_64.rpm
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-contents-0.5.13-1.el6.noarch.rpm
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/python-rhsm-1.9.7-1.el6.x86_64.rpm
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/redhat-upgrade-tool-0.7.22-1.el6.noarch.rpm
3. ダウンロードしたパッケージをインストールする。
[root@test TMP]# rpm -Uvh ./*
Preparing... ########################################### [100%]
1:preupgrade-assistant ########################################### [ 25%]
2:python-rhsm ########################################### [ 50%]
3:redhat-upgrade-tool ########################################### [ 75%]
4:preupgrade-assistant-co########################################### [100%]
4. preupgコマンドを実行し、アップグレードに問題がないか確認する。
[root@test TMP]# preupg
Preupg tool doesn't do the actual upgrade.
Please ensure you have backed up your system and/or data in the event of a failed upgrade
that would require a full re-install of the system from installation media.
Do you want to continue? y/n
y
Gathering logs used by preupgrade assistant:
All installed packages : 01/10 ...finished (time 00:00s)
All changed files : 02/10 ...finished (time 15:04s)
Changed config files : 03/10 ...finished (time 00:00s)
All users : 04/10 ...finished (time 00:00s)
|NIS server maps check |notapplicable |
|NIS server MAXUID and MAXGID limits check |notapplicable |
|NIS server config file back-up |notapplicable |
------------------------------------------------------------------------------------------------------------------------------
Tarball with results is stored here /root/preupgrade-results/preupg_results-140708143957.tar.gz .
The latest assessment is stored in directory /root/preupgrade .
Upload results to UI by command:
e.g. preupg -u http://127.0.0.1:8099/submit/ -r /root/preupgrade-results/preupg_results-*.tar.gz .
5. problemなどが表示されていなければ、redhat-upgrade-tool
を実行し、アップグレードを行う。(今回はISOイメージを使用)--iso
でISOイメージを指定できます。他にもネットワークなどでも指定できるようです。
[root@test TMP]# redhat-upgrade-tool-cli --iso ../CentOS-7.0-1406-x86_64-DVD.iso
setting up repos...
upgradeiso | 3.6 kB 00:00 ...
upgradeiso/primary_db | 2.7 MB 00:00 ...
preupgrade-assistant has not been run.
To perform this upgrade, either run preupg or run redhat-upgrade-tool --force
preupgrade-assistant
は前述のとおり実行しているのですが、何故か実行していないことになっています。が特に問題は出ていなかったので再度実行してみます。
[root@test TMP]# redhat-upgrade-tool --force --iso=/root/CentOS-7.0-1406-x86_64-DVD.iso
setting up repos...
getting boot images...
vmlinuz-redhat- upgrade-tool | 4.7 MB 00:00 ...
initramfs-redhat-upgrade-tool.img | 32 MB 00:00 ...
setting up update...
finding updates 100% [=======================================================]
redhat_upgrade_tool.yum WARNING: Error loading productid metadata for upgradeiso.
testing upgrade transaction
rpm transaction 100% [=======================================================]
rpm install 100% [===========================================================]
setting up system for upgrade
Finished. Reboot to start upgrade.
6. 再起動が促されるので再起動を実施する。
7. 再起動を実施するとOS起動時にOSのアップグレードが始まるので終わるまで待つ。
※VMなどの場合はVirt-Manager
でコンソール画面を見ていてもいいと思います。
8. アップグレードが終わると「CentOS Linux 7 (Core)
」と表示されていると思います。
これでアップグレードは終了です。
念のため、この後すぐにyum update
を実行したほうが良いと思います。
cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)
またinit周りがsystemdなどになっているので、動作に問題がないかどうかの確認も行ったほうが良いと思います。
参考:
- http://wiki.centos.org/Manuals/ReleaseNotes/CentOS7
- http://lists.centos.org/pipermail/centos-devel/2014-July/011277.html
- http://rhsummit.files.wordpress.com/2014/04/cantrell_w_1650_migrating_and_upgrading_rhel.pdf
- https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Migration_Planning_Guide/chap-Red_Hat_Enterprise_Linux-Migration_Planning_Guide-Upgrade_Tools.html
- http://blog.yuryu.jp/2014/07/centos-7.html
Packt Publishing
インプレスジャパン
売り上げランキング: 20104