2011年9月10日土曜日

Fedora 16 Alpha で GRUB2 をパーティションにインストール

Fedora 16 Alpha を試そうと、マルチブート環境 (マシンは ThinkPad X301) のパーティションの1つにインストールしましたが、インストールの終盤で bootloader のインストールに失敗したというエラーが出て、起動できず、いきなりハマってしまいました。
バグ情報を見たら、bootloader をパーティションにインストールできないよ とありました。

http://fedoraproject.org/wiki/Common_F16_bugs
Installation issues

Installer cannot install bootloader to a system partition (but will try and fail)
link to this item - Bugzilla: #730915

Fedora 16 uses the GRUB 2 bootloader for new installations. GRUB 2 does not currently support installation to a partition (rather than the MBR), but the Fedora 16 Alpha installer will still allow you to try and install the bootloader to a partition. This will fail, and so if you attempt this, the Fedora 16 Alpha installer will not install a bootloader at all. The installed system will be functional.

To work around this issue, you can adjust your bootloader configuration from another installed operating system. You can force installation of GRUB 2 to the Fedora partition by booting the Fedora 16 Alpha installation disc in rescue mode, using chroot to access the installed system, and running grub2-install --force '(hd0,5)' (where hd0,5 is the appropriate designation for the target partition, with GRUB 2 partition numbering starting at 1 as opposed to 0 with old GRUB). Alternatively, specify an ordinary partition device name such as /dev/sda5. Note that with --force the warnings are still printed.

This issue will be resolved in Fedora 16 Beta: the installer will use the --force parameter when trying to install the bootloader to a partition.
わたしのマルチブート環境では、MBR には MBM を入れてあり、Fedora や CentOS のインストール時には、各パーティションの PBR に GRUB を入れるという構成にしています。GRUB2 の場合、PBR へのインストール時には --force オプションを指定する必要があるようですが、F16 Alpha のインストーラーが --force をつけていないために、失敗してしまうようです。

仕方が無いので、レスキューモードでなんとかなるだろうと、ほぼ初体験の GRUB2 で悪戦苦闘。GRUB1 とほぼ同じだろうと、grub2-install をかけるも NG。--force をつけても NG。その後、grub2-各種 の --help を見ながら格闘しましたが、レスキューモードではうまく行きませんでした。
そんじゃあ別のパーティションに入っている Fedora 15 に GRUB2 を入れてなんとかできないかと、さらに格闘すること1時間ぐらい、やっと成功しました。
Fedora 15 で使ったコマンドは、次のような感じです。今回、/dev/sda8 に Fedora 16 を入れています。
# mkdir /mnt_sda8
# mount /dev/sda8 /mnt_sda8
# grub2-install --force --root-directory=/mnt_sda8 /dev/sda8
# chroot /mnt_sda8
# grub2-mkconfig > /boot/grub2/grub.cfg
GRUB2 の設定ファイル grub.cfg は手書きではないようで、上記のように grub2-mkconfig で生成するという方式になっているようです。

最後にスクリーンショットでもと思ったのですが、PNG ファイルをセーブするときにクラッシュしてしまうようなので、ここまでです。なお、現在の Fedora (というか GNOME?) だと、PrtSc キー押下でスクリーンショットのキャプチャーが出来ます。つまり、Windows と同じ操作方法ということ。

2011-10-01追記
アップデートしたら、スクリーンショットが落ちなくなったので、いくつかアップします。



0 件のコメント:

コメントを投稿

人気ブログランキングへ にほんブログ村 IT技術ブログへ