grub: how to create multiple-boot an environment of WinXP , CentOS 5.3 n' Fedora 11
/dev/sda というディスクがあり、このディスクに winxp , centos , fedora のマルチブート環境を作る場合のOSのインストールの順番、grub の設定について。
[インストールの順番]
1. winxp
2, centOS 5.3
3, fedora 11
fedora の grub から、winxp , centOS , fefora を起動することになる。
winxp を最初にインストールするのは、winxp インストール時に /dev/sda にブートローダを
インストールし、grub が上書きされてしまうため。
centOS を Fedora より最初にインストールするのは、centOS の grub が Fedora を起動できないみたい。どうも、grub のバージョンが古いからみたい。
fedora -> centOS という順番でインストールし、centOS の grub で fedora を起動しようとすると、下記のエラーが出た。
Error 2: Bad file or directory type
ext3 で、特に bad file or directory type でもないんだけど、こんなエラーになる。
[ grub のバージョン ]
- centOS の grub
[root@arizona ~]# cat /etc/redhat-release
CentOS release 5.3 (Final)
[root@arizona ~]# grub --version
grub (GNU GRUB 0.97)
[root@arizona ~]# rpm -qa | grep grub
grub-0.97-13.2
- fedora の grub
[root@arizona ~]# cat /etc/redhat-release
Fedora release 11 (Leonidas)
[root@arizona ~]# grub --version
grub (GNU GRUB 0.97)
[root@arizona ~]# rpm -qa | grep grub
grubby-6.0.87-4.fc11.x86_64
grub-0.97-51.fc11.x86_64
[ centOS , fedora インストール時の grub のインストール先について ]
centOS , fedora インストール時に /dev/sda を選択する。
centOS をインストールした後は、centOS の grub になり、
fedora をインストールした後は、centOS の grub が上書きされ、fedora の grub となる。
[ 例 ]
/dev/sda1 に winxp
/dev/sda3 に fedora
/dev/sda4 に centOS
をインストールした例
winxp -> centOS -> fedora という順番でインストールする。
[root@arizona ~]# fdisk /dev/sda -l
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = シリンダ数 of 16065 * 512 = 8225280 bytes
デバイス Boot      Start         End      Blocks   Id  System
/dev/sda1               1       10199    81920128+   7  HPFS/NTFS <- winxp
Partition 1 does not end on cylinder boundary.
/dev/sda2           10199       10263      512000   83  Linux
/dev/sda3   *       10263       35759   204800000   83  Linux <- fedora
/dev/sda4           35760       38913    25334505    5  拡張領域
/dev/sda5           35760       35886     1020096   83  Linux <- centOS
centOS インストール後の centOS の grub.conf
[root@arizona ~]# cat /etc/grub.conf ( CentOS )
default=2
timeout=5
splashimage=(hd0,4)/grub/splash.xpm.gz  <- hd0,4 = /dev/sda4 = centOS の grub.conf
hiddenmenu
title CentOS (2.6.18-164.el5xen)
        root (hd0,4)
        kernel /xen.gz-2.6.18-164.el5
        module /vmlinuz-2.6.18-164.el5xen ro root=LABEL=/ rhgb quiet
        module /initrd-2.6.18-164.el5xen.img
title CentOS (2.6.18-164.el5)
        root (hd0,4)
        kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.18-164.el5.img
title WinXP
        rootnoverify (hd0,0)
        chainloader +1
Fefora 11 インストール後、CentOS が起動できるように、fedoraの grub.conf に centOS を追加する。
centOS の grub.conf の内容を fedora の grub.conf にそのままコピペすればOK!
fedora の grub.conf
[root@arizona ~]# cat /etc/grub.conf ( Fedora )
default=1
timeout=5
splashimage=(hd0,2)/boot/grub/splash.xpm.gz <- hd0,2 = /dev/sda3 = fedora の grub.conf
hiddenmenu
title Fedora (2.6.30.8-64.fc11.x86_64)
        root (hd0,2) <- /dev/sda3
        kernel /boot/vmlinuz-2.6.30.8-64.fc11.x86_64 ro root=UUID=5064c72a-c4f4-4396-acd4-d43c29d67368 rhgb quiet
        initrd /boot/initrd-2.6.30.8-64.fc11.x86_64.img
title WinXP
        rootnoverify (hd0,0) <- /dev/sda1
        chainloader +1
title CentOS (2.6.18-164.el5xen) <- 追加
        root (hd0,4) <- /dev/sda5
        kernel /xen.gz-2.6.18-164.el5
        module /vmlinuz-2.6.18-164.el5xen ro root=LABEL=/ rhgb quiet
        module /initrd-2.6.18-164.el5xen.img
title CentOS (2.6.18-164.el5) <- 追加
        root (hd0,4) <- /dev/sda5
        kernel /vmlinuz-2.6.18-164.el5 ro root=LABEL=/ rhgb quiet
        initrd /initrd-2.6.18-164.el5.img
これで、すべてのOS を起動できるようになる。
centOSのカーネルをアップグレードした場合は、fedora の grub.conf に追加する必要がある。
hope this helps :D
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.