デュアルブート時のデフォルト(標準)起動OS設定(Grub)

Grubを利用したデュアルブート時のデフォルト(標準)起動OS設定の説明です。

Grubのデフォルト(標準)起動OS設定

※ここの説明は「Wubi」をによって構築された,デュアルブートの場合は,適用できません。その際は,Windows 内にある,「boot.ini」を探して下さい。

Ubuntuではインストール時に,Windowsなど既存の他OSが有る場合,ブートローダー「Grub」を利用して簡単にデュアルブートを構築してくれます。この時,デフォルト(標準)で起動するOSは,Ubuntuに設定されます。
これをWindowsにする方法を説明します。

デフォルト起動OS変更

デフォルト起動OSを変更するには,/boot/grub/フォルダにある「menu.lst」ファイルを編集します。

  1. 端末を起動して下さい。
  2. トラブルに備えてバックアップファイルを作成しておきます。

    sudo cp /boot/grub/menu.lst /boot/grub/menu.lst_back

    /boot/grub/フォルダに有るmenu.lstをmenu.lst_backの名で複製。

    起動不能からの復旧方法

  3. テキストエディタでmenu.lstを編集します。

    sudo gedit /boot/grub/menu.lst

    Geditでboot/grub/フォルダにあるmenu.lstファイルを編集。

  4. テキストエディタのGeditが起動して「menu.lst」が編集状態になります。Geditでmenu.lstを編集開始するイメージ図
  5. title」という文字列を探してください。一番始めに出てくる物を「0 (ゼロ)」として,Windowsが何番目に来るか勘定して下さい。この例ですと,Windows4番目です。
    ## ## End Default Options ##
    
    title		Ubuntu, kernel 2.6.15-52-386 ( 00番め )
    root		(hd1,0)
    kernel		/boot/vmlinuz-2.6.15-52-386 root=/dev/sdb1 ro quiet
    initrd		/boot/initrd.img-2.6.15-52-386
    savedefault
    boot
    
    title		Ubuntu, kernel 2.6.15-52-386 (recovery mode) ( 01番め )
    root		(hd1,0)
    kernel		/boot/vmlinuz-2.6.15-52-386 root=/dev/sdb1 ro single
    initrd		/boot/initrd.img-2.6.15-52-386
    boot
    
    title		Ubuntu, memtest86+ ( 02番め )
    root		(hd1,0)
    kernel		/boot/memtest86+.bin 
    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: ( 03番め )
    root
    
    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/sda1
    title		Microsoft Windows XP Home Edition ( 04番め )
    root		(hd0,0)
    savedefault
    makeactive
    chainloader	+1
  6. menu.lst内の始めの方に有る,「#default num」という文字列を探して下さい。
    その項目の下にある,defaultの数値を書き換えます。
    ## 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'.
    # WARNING: If you are using dmraid do not change this entry to 'saved' or your
    # array will desync and will not let you boot your system.
    default		0 
    
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout		2

Geditを終了してパソコンを再起動して下さい。
Grubブート画面で,設定したOSに勝手にカーソルが行きます。

grubブート画面でWindowsがデフォルトで選択されているイメージ図

※起動しない時に備えて 起動不能からの復旧方法」を軽く読んで下さい。

設定番号

menu.lstでデフォルト番号を3にしてみた場合で,grubブート画面で,Other_operating_system という,変な箇所にカーソルが行ってしまってるイメージ図

設定する番号は,もしかして,違ってくるかも知れません。その際は適宜変更下さい。