HOME

マルチブートに関する Tips

Windows PC にLinux を追加したり複数の OS で運用したいときのヒント集です。-- Last updated: Nov.14, 2021 08:43 JST

Windows でパーティションを増やすには?

まず始めに、マイクロソフト社のサポートページ「ディスクの管理のヘルプ」をご覧になることをおすすめします。そのページの中に 「ベーシック ボリュームを圧縮する (Shrink a basic volume)」という項目が存在します(ただし現時点で日本語ページが存在しません)。 これは英語ページなので、以下の SONY Vaio サポートの日本語ページ解説を読めばこと足ります。

「ハード ディスク パーティションを作成してフォーマットする」 - Windows ヘルプ
https://support.microsoft.com/ja-jp/help/17418/windows-7-create-format-hard-disk-partition にも関連記事があります。

[Windows 10] パーティションを作成/削除する方法

具体的な作業手順は、Vaio サポート FAQ -  https://solutions.vaio.com/2122 に掲載されています。

[Windows 8] パーティションを作成/削除する方法

具体的な作業手順については、http://qa.support.sony.jp/solution/S1206280039400/を参照してください。ハードディスク(HDD)に空き領域を用意すれば、Linux をお使いのシステムに追加し、デュアルブートにすることが可能です。

[Windows 7] パーティションを作成/削除する方法等

具体的な作業手順については、以下のリンク先を参照してください。
http://qa.support.sony.jp/solution/S0907091064543/
http://faq.askpc.panasonic.co.jp/faq/docs/002563

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

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

なお、一度作成したパーティションは、Windows 側から後で削除することも可能です。
(参照先)ソニー製品情報 > VAIO > サポート ページより。
Windows Vista パーティションの作成方法は、Windows 環境に復元したいとき参考にしてください。

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

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

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

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

Windows PC に Linux を追加したい。

汎用的な方法でインストール

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

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

Win32-Loader を使う方法

これは、Debian Linux のインストールのみで使える専用のツールです。Win32-Loader はWindows 環境で、Debian-Installer を自動的に取得します。

In case you would like to install Debian on a system running Microsoft Windows, you could use win32-loader (aka "Debian-Installer Loader") from the Debian mirrors (win32-loader.exe). BUT a number of virus scanners falsely claim it may contain a virus, see /SuspectedVirus.

Advantages:
""No installation CD is required to be obtained, burned/mastered and then booted.
Your existing Windows system can be preserved.""
出典: https://wiki.debian.org/DebianInstaller/Loader

Win32-Loader は、次の外部リンクのダウンロード先より、またはDebian 公式ミラーサイトの /debian/tools/win32-loader ディレクトリより入手可能です。
外部リンク:
公式サイト - https://packages.debian.org/stable/win32-loader
ネットワーク版 - https://packages.debian.org/stable/win32-loader
解説記事 - https://en.wikipedia.org/wiki/Win32-loader

グラフィカルな Linux 用の設定ツールはありますか?

はい。GParted というパーティション設定ツールが存在します。Linux 環境で利用することが可能です。 グラフィカルな画面を見て対話的に設定を変更できるので便利です。多くのディストリビューションで配布されています。 gparted というパッケージ名で検索しインストールしてください。

OS(ディストリビューション)を削除するには?

追加したディストリビューションあるいは Windows を削除する方法を紹介します。 OSを入れ替える場合は上書きインストールされて自動的に削除されますが、参考になると思います。 下記のマニュアルは実際の詳しい手順を分かりやすく解説しています。

Red Hat Enterprise Linux のアンインストール(日本語)
https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/installation_guide/chap-uninstall-rhel

Uninstalling CentOS (in English)
https://docs.centos.org/en-US/centos/install-guide/uninstall/

マルチブート設定の実際について(注意:この項目は非現行です)

以下の内容は非現行なので注意してください。一世代以上前のパソコンを活用する場合には参考になると思います。

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

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

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

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

 # grub-install /dev/sda

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

 $ man grub-install

HOME