Windows PC にLinux を追加したり複数の OS で運用したいときのヒント集です。-- Last updated: Nov.14, 2021 08:43 JST
まず始めに、マイクロソフト社のサポートページ「ディスクの管理のヘルプ」をご覧になることをおすすめします。そのページの中に 「ベーシック ボリュームを圧縮する (Shrink a basic volume)」という項目が存在します(ただし現時点で日本語ページが存在しません)。 これは英語ページなので、以下の SONY Vaio サポートの日本語ページ解説を読めばこと足ります。
「ハード ディスク パーティションを作成してフォーマットする」 - Windows ヘルプ
なお、一度作成したパーティションは、Windows 側から後で削除することも可能です。
(参照先)ソニー製品情報 > VAIO > サポート ページより。
Windows Vista パーティションの作成方法は、Windows 環境に復元したいとき参考にしてください。
「コンピュータ」を右クリックして[コンピュータの管理] > [記憶域] > [ディスクの管理] > [パーティションの圧縮] より、選択しているパーティションのサイズを小さくできます。圧縮することによって、未割り当ての領域を作成し、その領域から新しいパー ティションを作成 します。
次のウェブサイトでその仕組みについて解説があります。
上記項目で説明している方法を実行すれば、パーティション設定に関する専門的な知識が無くても、比較的容易に Windows の空き領域に Linux をインストールすることが可能です。その際注意すべきことは、後から Linux をインストールするとき、ブートローダは必ず MBR にインストールすることです。これで、ブートローダが NTLoader (bootmgr) から GRub あるいは LiLo に入れ替わりますが、起動時にブートローダのメニューで OS を選択できるようになるので不都合は生じません。
なお、Windows Vista を新規インストールしてデュアルブートを構成するときは、次を参考にしてください。
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:
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
追加したディストリビューションあるいは Windows を削除する方法を紹介します。 OSを入れ替える場合は上書きインストールされて自動的に削除されますが、参考になると思います。 下記のマニュアルは実際の詳しい手順を分かりやすく解説しています。
Red Hat Enterprise Linux のアンインストール(日本語)# 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 GNU/Linux の安定版と旧安定版を組み合わせた、デュアルブートを構成することは、インストーラーの自動設定で容易に行えます。あるいは、これに習っ て、安定版とテス ト版を組み合わせることも可能です。
最初にパーティションの設定を手動で行い、空き領域を残しておくようにします。2つ目は、その空き領域を指定してインストールします。
この方法では、一方のディストリビューションでパッケージのバージョンが古くて困るときでも、あえて安定版と旧安定版、あるいはテスト 版との間で パッケージを借用する必要がなくなります。HDDの容量が膨大なっている現在、かえってこれを有効に活用できます。menu.lst の例を 参照してください。
# 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
# 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
# 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
以下の /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
# 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
注意:Windows の項目が2つ表示されますが、一方は「レスキュー・セーフ・モード」で、他方は「通常モード」です。このメニューは、/boot /grub /menu.lst を参照しています。
GRUB の再インストールを行ってシステムの修復を図ります。詳しくは、GRUB を再インストールするには(@IT)という記事を参照してください。例えば、次のようなコマンドを実行します。
# grub-install /dev/sda
grub-install コマンドに関するオプションは、次のコマンドで知ることができます。
$ man grub-install