デュアルブートの設定(GRUB)

[サーバの実験室 Redhat/Fedora]

作成 : 2002/12/15

"サーバの実験室"の検索


現在のパーティション構成

現在のパーティション構成は、こんな感じ。

+---------------+---------------+---------------+-----------------------+
| hda1(primary) | hda2(primary) | hda3(primary) |     hda4(extended)    |
|               |               |               +----------------+      |
|               |               |               | hda5(logical)  |      |
|               |               |               +----------------+      |
| /boot(redhat) |   /(redhat)   |     swap      |  /(slackware)  |      |
+---------------+---------------+---------------+----------------+------+

Redhat をインストールしたとき、MBR に GRUB をインストールしてある。 Slackware をインストールしたとき、FD に LILO をインストールしてある。

現在の Redhat GRUB の設定(/boot/grub/grub.conf)

GRUB の設定ファイルは、/boot/grub/grub.conf。 /dev/hda1 にある。

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda2
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
        root (hd0,0)
        kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
        initrd /initrd-2.4.18-14.img

現在の Slackware LILO の設定(/etc/lilo.conf)

LILO の設定ファイルは、/etc/lilo.conf。 /dev/hda5 にある。

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/fd0
message = /boot/boot_message.txt
prompt
timeout = 1200
# Override dangerous defaults that rewrite the partition table:
change-rules
  reset
# VESA framebuffer console @ 1024x768x32k
vga = 790
# Normal VGA console
# vga = normal
# VESA framebuffer console @ 1024x768x32k
# vga=790
# End LILO global section
# Linux bootable partition config begins
image = /boot/vmlinuz
  root = /dev/hda5
  label = Linux
  read-only
# Linux bootable partition config ends

デュアルブート GRUB 設定(/boot/grub/grub.conf)

Slackware を起動できるよう、grub.conf に記述を追加する。 root は、ルートパーティションを指定する。 (hd0,4) は、1台目のハードディスクの5個目のパーティションを示す。 (番号は 0 から始まるので注意!) kernel は、カーネルイメージを指定する。

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda2
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Linux (2.4.18-14)
        root (hd0,0)
        kernel /vmlinuz-2.4.18-14 ro root=LABEL=/ hdc=ide-scsi
        initrd /initrd-2.4.18-14.img

title Slackware (2.4.18)
        root (hd0,4)
        kernel /boot/vmlinuz ro root=/dev/hda5

起動の確認

パソコンを再起動する。 Redhat と Slackware のどちらでもブートできることを確認する。


(参考)Windows と Linux のデュアルブート

Windows2000 と Windows XP と Redhat と Slackware を 1 台のハードディスクにインストールしたときの grub.conf。 Windows2000(ふつうにインストール)、WindowsXP(ふつうにインストール)、Redhat(ブートローダに GRUB を選択)、Slackware(ブートローダをインストールせずに、後で grub.conf を編集)の順番にインストールした。

+---------------+---------------+-------------------------------------------------------------------+
| hda1(primary) | hda2(primary) |                         hda3(extended)                            |
|               |               +----------------+ ---------------+----------------+----------------+
|               |               | hda5(logical)  | hda6(logical)  | hda7(logical)  | hda8(logical)  |
|               |               +                |                |                |                |
|  Windows2000  | /boot(redhat) |   WindowsXP    |   Linux Swap   |   / (redhat)   | / (slackware)  |
+---------------+---------------+----------------+----------------+----------------+----------------+
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,1)
#          kernel /vmlinuz-version ro root=/dev/hda7
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title Red Hat Linux (2.4.20-8)
        root (hd0,1)
        kernel /vmlinuz-2.4.20-8 ro root=LABEL=/
        initrd /initrd-2.4.20-8.img
title Slackware (2.4.20)
        root (hd0,7)
        kernel /boot/vmlinuz ro root=/dev/hda8
title DOS
        rootnoverify (hd0,0)
        chainloader +1

[サーバの実験室 Redhat/Fedora]