HOME

マルチブートに関する TIPs

/boot ディレクトリー以下にある menu.lst (Red Hat の場合 grub.config に読替え) の設定例。いずれの例も、bootloader は MBR の先頭にインストールします。(その他の OS は、それぞれのパーティションの /boot にインストール。)

  • マルチブー トに関する TIPs
    • [Windows Vista] パーティションの作成・削除方法
    • [Windows Vista] パーティションの圧縮(縮小)
    • ブート・マ ネージャとは何ですか。
    • Windows PC に Linux を追加したい。
    • マルチブー ト設定の実際について
      • Chainloader の利用によるマルチブートの例 (Debian 3.1 -Sarge)
      • インストー ラーの自動設定によるマルチブート (Debian 4.0 + Debian 5.0)
      • インストー ラーの自動設定によるマルチブートの例 (Debian 3.1 -Sarge + CentOS 4.1, etc.)
      • Windows と Linux のデュアルブートの例 (w/CentOS 4.1)
      • Windows と Linux のデュアルブートの例 - その2
      • Windows Vista と Linux のデュアルブートの例 - その3
      • Windows と Linux のマルチブートの例
      • 起動時の OS 選択画面(表示例)
      • GRUB を誤ってインストールしたとき
↑

[Windows Vista] パーティションの作成・削除方法

Windows に Linux 用の空き領域を作成したいとき、以下の方法を採れば簡単に作業できます。

  • Windows Vista パーティションの削除方法
    なお、一度作成したパーティションは、Windows 側から後で削除することも可能です。

    (参照先)ソニー製品情報 > VAIO > サポート ページより。Windows Vista パーティションの作成方法は、Windows 環境に復元したいとき参考にしてください。

  • Windows XP の場合にも、「マイコンピューター」のメニューに「コンピューターの管理」という項目があります。上記手順を参考にしてください。
↑

[Windows Vista] パーティションの圧縮(縮小)

「コンピュータ」を右クリックして[コンピュータの管理] > [記憶域] > [ディスクの管理] > [パーティションの圧縮] より、選択しているパーティションのサイズを小さくできます。圧縮することによって、未割り当ての領域を作成し、その領域から新しいパーティションを作成 します。

  • [Windows Vista] ドライブの圧縮方法 (ソニー製品情報 VAIOサポート)
  • Vista ならPartitionMagicはもういらない?!
  • ハー ド ディスクを再パーティションできますか? (Microsoft.com > Windows Vista Help)
↑

ブート・マネージャとは何ですか。

次のウェブサイトでその仕組みについて解説があります。

  • ブー ト・マネージャ とは : ITpro
↑

Windows PC に Linux を追加したい。

上記項目で説明している方法を実行すれば、パーティション設定に関する専門的な知識が無くても、比較的容易に Windows の空き領域に Linux をインストールすることが可能です。その際注意すべきことは、後から Linux をインストールするとき、ブートローダは必ず MBR にインストールすることです。これで、ブートローダが NTLoader (bootmgr) から GRub あるいは LiLo? に入れ替わりますが、起動時にブートローダのメニューで OS を選択できるようになるので不都合は生じません。

なお、Windows Vista を新規インストールしてデュアルブートを構成するときは、次を参考にしてください。

  • Windows Vista + Fedora Core 6 (Linux) デュアルブート設定方法 (LinuxMania)
↑

マルチブート設定の実際について

↑

Chainloader の利用によるマルチブートの例 (Debian 3.1 -Sarge)

 # menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## ## End Default Options ##

title Debian GNU/Linux, kernel 2.6.8-2-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot

title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

title Mandriva Limited Edition 2005
rootnoverify (hd0,2)
chainloader +1

title Scientific Linux 4.1
rootnoverify (hd0,3)
chainloader +1
↑

インストーラーの自動設定によるマルチブート (Debian 4.0 + Debian 5.0)

Debian GNU/Linux の安定版と旧安定版を組み合わせた、デュアルブートを構成することは、インストーラーの自動設定で容易に行えます。あるいは、これに習って、安定版とテス ト版を組み合わせることも可能です。

最初にパーティションの設定を手動で行い、空き領域を残しておくようにします。2つ目は、その空き領域を指定してインストールします。

この方法では、一方のディストリビューションでパッケージのバージョンが古くて困るときでも、あえて安定版と旧安定版、あるいはテスト版との間で パッケージを借用する必要がなくなります。HDDの容量が膨大なっている現在、かえってこれを有効に活用できます。menu.lst の例を 参照してください。

↑

インストーラーの自動設定によるマルチブートの例 (Debian 3.1 -Sarge + CentOS 4.1, etc.)

 # menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specifiv kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
# kopt=root=/dev/hda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## ## End Default Options ##

title Debian GNU/Linux, kernel 2.6.8-2-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda1 ro
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot

title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.8-2-386
savedefault
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hda3.
title CentOS release 4.1 (Final) (on /dev/hda3)
root (hd0,2)
kernel /boot/vmlinuz-2.6.9-11.106.unsupported root=/dev/hda3
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hda3.
title CentOS release 4.1 (Final) (on /dev/hda3)
root (hd0,2)
kernel /boot/vmlinuz-2.6.9-11.EL root=/dev/hda3
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hda4.
title linux (on /dev/hda4)
root (hd0,3)
kernel /boot/vmlinuz root=/dev/hda4 resume=/dev/hda5
initrd /boot/initrd.img
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hda4.
title failsafe (on /dev/hda4)
root (hd0,3)
kernel /boot/vmlinuz root=/dev/hda4 failsafe resume=/dev/hda5
initrd /boot/initrd.img
savedefault
boot
↑

Windows と Linux のデュアルブートの例 (w/CentOS 4.1)

 # 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/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-11.EL)
root (hd0,1)
kernel /vmlinuz-2.6.9-11.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.9-11.EL.img
title CentOS (2.6.9-5.0.5.EL)
root (hd0,1)
kernel /vmlinuz-2.6.9-5.0.5.EL ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.9-5.0.5.EL.img
title Windows
rootnoverify (hd0,0)
chainloader +1
↑

Windows と Linux のデュアルブートの例 - その2

 # 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/hda3
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,1)/grub/splash.xpm.gz
title CentOS-3 (2.4.21-27.0.1.EL)
root (hd0,1)
kernel /vmlinuz-2.4.21-27.0.1.EL ro root=LABEL=/
initrd /initrd-2.4.21-27.0.1.EL.img
title Windows
rootnoverify (hd0,0)
chainloader +1
↑

Windows Vista と Linux のデュアルブートの例 - その3

以下の /boot/grub/menu.lst は Windows Vista / Mandriva Linux 2008 とのデュアルブートを構成した際、自動生成されたテキストファイルです。

timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,2)/boot/gfxmenu
default 0

title linux
kernel (hd0,2)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/sda3 resume=/dev/sda5 splash=silent vga=788
initrd (hd0,2)/boot/initrd.img

title linux-nonfb
kernel (hd0,2)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=/dev/sda3 resume=/dev/sda5
initrd (hd0,2)/boot/initrd.img

title failsafe
kernel (hd0,2)/boot/vmlinuz BOOT_IMAGE=failsafe root=/dev/sda3 failsafe
initrd (hd0,2)/boot/initrd.img

title windows
root (hd0,0)
makeactive
chainloader +1

title windows1
root (hd0,1)
makeactive
chainloader +1

↑

Windows と Linux のマルチブートの例

 # grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,4)
# kernel /boot/vmlinuz-version ro root=/dev/hda5
# initrd /boot/initrd-version.img
#boot=/dev/hda
default=0
timeout=10
splashimage=(hd0,4)/boot/grub/splash.xpm.gz
title CentOS-3 (2.4.21-27.0.1.EL)
root (hd0,1)
kernel /boot/vmlinuz-2.4.21-27.0.1.EL ro root=LABEL=/1
initrd /boot/initrd-2.4.21-27.0.1.EL.img
title Windows
rootnoverify (hd0,0)
chainloader +1
title Debian3.1 (2.4.x)
rootnoverify (hd0,2)
chainloader +1
↑

起動時の OS 選択画面(表示例)

  • Windows Vista + Debian/GNU Linux 4.0
    GNU GRUB version 0.97
    Debian GNU/Linux, kernel 2.6.18-6-686
    Debian GNU/Linux, kernel 2.6.18-6-686 (single-user mode)
    Other operating systems:
    Windows Vista/Longhorn (loader)
    Windows Vista/Longhorn (loader)
  • Windows Vista + Mandriva Linux 2008.0
    Mandriva Linux 2008 を起動
    Mandriva Linux 2008 を起動(セーフモード)
    Microsoft Windows を起動
    Windows1

注意:Windows の項目が2つ表示されますが、一方は「レスキュー・セーフ・モード」で、他方は「通常モード」です。このメニューは、/boot/grub /menu.lst を参照しています。

↑

GRUB を誤ってインストールしたとき

GRUB の再インストールを行ってシステムの修復を図ります。詳しくは、GRUB を再インストールするには(@IT)という記事を参照してください。例えば、次のようなコマンドを実行します。

 # grub-install /dev/sda

grub-install コマンドに関するオプションは、次のコマンドで知ることができます。

 $ man grub-install

HOME