はじめに
2014/11/14 FreeBSD 10-RELEASEが公開されました。
さくらのVPSで使っているFreeBSD 10.0-RELEASEを10.1-RELEASEへアップグレードしてみましたので、その際に実施した手順を記載します。
FreeBSD 10.0-RELEASEを10.1-RELEASEへアップグレード
公式マニュアルの手順を元に、アップデートを実施します。
実行環境
実行環境は以下となります。
プラットフォーム | さくらのVPS 512 |
OS | FreeBSD 10.0-RELEASE-p0 (amd64) |
FreeBSDのアップグレード
アップグレードを実施します。まず、rootにスイッチします。
> su -
アップグレード
freebsd-update
コマンドを使ってFreeBSD10.0-RELEASEをFreeBSD 10.1-RELEASEへアップグレードします。
# freebsd-update -r 10.1-RELEASE upgrade
更新対象となるファイルに対して、Does this look reasonable (y/n)?
(変更に問題ないか?)といったことを何度か聞かれるので、一応確認して問題なければy
(yes)と入力します。
Looking up update.FreeBSD.org mirrors... none found.
Fetching metadata signature for 10.0-RELEASE from update.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Inspecting system... done.
The following components of FreeBSD seem to be installed:
kernel/generic src/src world/base
The following components of FreeBSD do not seem to be installed:
world/doc world/games world/lib32
Does this look reasonable (y/n)? y
Fetching metadata signature for 10.1-RELEASE from update.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
・・・
・・・
・・・
/usr/src/usr.sbin/zzz/Makefile
/usr/src/usr.sbin/zzz/zzz.8
/usr/src/usr.sbin/zzz/zzz.sh
/var/db/mergemaster.mtree
/var/yp/Makefile.dist
To install the downloaded upgrades, run "/usr/sbin/freebsd-update install".
カーネル/カーネルモジュール更新
更新ファイルはまだ反映されていないので、上記freebsd-update
コマンド実行後の最後のメッセージにある通りに、freebsd-update install
コマンドを実行します。
# freebsd-update install
更新が反映(ディスクへ書き込み)されます。
Installing updates...
Kernel updates have been installed. Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
上記メッセージに表示されているとおり、OS再起動を実施し、新しいカーネル(10.1-RELEASE)で起動させます。
# shutdown -r now
起動後、OSバージョンが10.1-RELEASEとなっていることを確認します。
> uname -r
10.1-RELEASE
古いライブラリ/ファイル類の削除
rootへスイッチします。
> su -
再びfreebsd-updateコマンドを実行します。
# /usr/sbin/freebsd-update install
古い共有ライブラリとオブジェクトファイルを削除されます。
Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates
ZFSファイルシステムとストレージプールの更新
ファイルシステムにZFSを使用している場合、現在動作しているZFSファイルシステムとストレージプールに対して以下のコマンドを実行してアップグレードを実行します。
# zpool upgrade -a
This system supports ZFS pool feature flags.
Enabled the following features on 'rpool':
spacemap_histogram
enabled_txg
hole_birth
extensible_dataset
embedded_data
bookmarks
filesystem_limits
If you boot from pool 'rpool', don't forget to update boot code.
Assuming you use GPT partitioning and da0 is your boot disk
the following command will do it:
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
メッセージの最後に表示されている通り、ディスクにbootコードを書き見ます。
# gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
bootcode written to ada0
パッケージのアップデート
最新のバイナリパッケージへアップデートします。
# pkg upgrade -f
おわりに
以上で、FreeBSD 10.0-RELEASEから10.1-RELEASEへの更新が完了しました。