grub

ブートローダーはgrubを使っています。たいへん気に入っています。 詳細は展開したファイルの docs/grub.info* に詳しい説明があります。

参考

turbolinux Technical Knowledge Center No. 277


以下はコマンド(grub shell)で各OSを起動させる例です。 サンプルメニューが表示された場合、キーボードの ``c''を叩くと コマンドモードになります。キーボードの配列が日本語ではなく英語に なっています。<例 ``( ''は``)''>

    GRUB  version 0.5.96.1  (639K lower / 12998K upper memory)

[ Minimal BASH-like line editing is supported.  For the first word, TAB
  lists possible command completions.  Anywhere else TAB lists the possible
  completions of a device/filename.  ESC at any time exits. ]

grub> 

# grubシェルのプロンプトです。使えるコマンドは help と叩くと表示されます。
# halt, reboot, quit などが使えます。

grub> root (hd0, #ここでタブキーを叩く
 Possible partitions are:
   Partition num: 0,  Filesystem type is fat, partition type 0xb
   Partition num: 1,  Filesystem type is fat, partition type 0x1b
   Partition num: 3, [BSD sub-partitions immediately follow]
     BSD Partition num: 'a',  Filesystem type is ffs, partition type 0xa5
   Partition num: 4,  Filesystem type is fat, partition type 0xb
   Partition num: 5,  Filesystem type is fat, partition type 0xb
   Partition num: 6,  Filesystem type is fat, partition type 0xb
   Partition num: 7,  Filesystem type is fat, partition type 0xb
   Partition num: 8,  Filesystem type is ext2, partition type 0x83
   Partition num: 9,  Filesystem type is unknown, partition type 0x82
   Partition num: 10,  Filesystem type is ext2, partition type 0x83
   Partition num: 11,  Filesystem type is ext2, partition type 0x83
   Partition num: 12,  Filesystem type is ext2, partition type 0x83
   Partition num: 13,  Filesystem type is ext2, partition type 0x83
   Partition num: 14,  Filesystem type is ext2, partition type 0x83
# 0,1,3 は基本領域、4,5,〜14 は論理領域です。

grub> root (hd0,8)
 Filesystem type is ext2fs, partition type 0x83
grub> cat /etc/fstab
/dev/hda9/ext2default11
/dev/cdrom/mnt/cdromiso9660noauto,owner,ro00
/dev/fd0/mnt/floppyautonoauto,owner00
none/procprocdefaults00
none/dev/ptsdevptsgid=5,mode=62000
/dev/hda10swapswapdefaults00
# このことからルートデバイスは /dev/hda9 であることがわかります。

grub> kernel /boot/ #ここでタブキーを叩く
 Possible files are: System.map-2.4.5-3 module-info-2.4.5-3 vmlinux-2.4.5-3 vml
inuz-2.4.5.3 vmlinuz System.map module-info kernel.h boot-menu.b boot-text.b bo
ot.b chain.b message-turbo os2_d.b message initrd grub boot.0.300 map

# ここで起動したいカーネルを選択できます。デフォルトのカーネルは vmlinuz
# にリンクされています。

grub> kernel /boot/vmlinuz root=/dev/hda9

# ハードディスクがscsiの場合は grub> initrd /boot/initrd も必要です。

grub> boot

# Debian GNU/Linux の場合

grub> root (hd0,13)
grub> kernel /vmlinuz root=/dev/hda14 read-only
grub> boot

# Slackware Linux の場合

grub> root (hd0,14)
grub> kenel /vmlinuz root=/dev/hda15 ro
grub> boot

# オプションに read-only または ro を指定します。

# FreeBSD4.4の場合

grub> root (hd0,3,a)
grub> kernel /boot/loader
grub> boot

# kernel /MY_KERNEL などとすることも可能。<訂正>不可能です。
昔はできましたが # Windows95 または Windows98 の場合 grub> unhide (hd0,0) grub> hide (hd0,1) grub> rootnoverify (hd0,0) grub> makeactive grub> chainloader /bootsect.dos grub> boot grub> unhide (hd0,1) grub> hide (hd0,0) grub> rootnoverify (hd0,1) grub> makeactive grub> chainloader +1 grub> boot # Windows95/98,DOS などのOSが二つインストールされている場合は片方を隠し # パーティションにします。一番目のパーティションのWindows95を ntldr # 経由ではなく直接起動させるために /bootsect.dos としています。 # Windows2000はntldr経由で起動させます。 grub> unhide (hd0,0) grub> hide (hd0,1) grub> rootnoverify (hd0,0) grub> makeactive grub> chainloader +1 grub> boot # この場合は boot.ini にエントリーがWindows2000一つだけなので選択画面が # 表示されずに起動します。

grub のセットアップに続く


マルチブートに付いての情報はgoogleで "ブートとハードディスクのすべて" と入力して検索してみてください。