お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。

#1 2010-10-16 13:05:56

dein
メンバ
登録日: 2009-02-24

起動の時のgrubの画面に windowsを表示させたい。

grubでubuntuとwindowsを表示させたいんですが、うまくできません。

os-proberを実行すると

/dev/sda1:Microsoft Windows XP Home Edition:Windows:chain
/dev/sdb1:Windows 7 (loader):Windows1:chain

と表示され、update-grubを実行するんですが、
追加されませんでした。
対処方法があったらお願いします。

Ubuntu 10.04 LTS -を使用しています。

オフライン

 

#2 2010-10-16 14:49:04

uotora
メンバ
登録日: 2008-06-18

Re: 起動の時のgrubの画面に windowsを表示させたい。

端末から

コード:

sudo fdisk -l

の内容と /boot/grub/grub.conf の内容を提示して下さい。

オフライン

 

#3 2010-10-16 17:32:44

dein
メンバ
登録日: 2009-02-24

Re: 起動の時のgrubの画面に windowsを表示させたい。

fdisk -l の結果が

ディスク /dev/sda: 1000.2 GB, 1000204886016 バイト
ヘッド 255, セクタ 63, シリンダ 121601
Units = シリンダ数 of 16065 * 512 = 8225280 バイト
セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
I/O size (minimum/optimal): 512 bytes / 512 bytes
ディスク識別子: 0xedabedab

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sda1   *           1       92185   740474208+   7  HPFS/NTFS

ディスク /dev/sdc: 250.0 GB, 250000000000 バイト
ヘッド 255, セクタ 63, シリンダ 30394
Units = シリンダ数 of 16065 * 512 = 8225280 バイト
セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
I/O size (minimum/optimal): 512 bytes / 512 bytes
ディスク識別子: 0x1ecfb89b

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sdc1               1       29170   234307993+  83  Linux
/dev/sdc2           29171       30394     9831780    5  拡張領域
/dev/sdc5           29171       30394     9831748+  82  Linux スワップ / Solaris

ディスク /dev/sdb: 1000.2 GB, 1000204886016 バイト
ヘッド 255, セクタ 63, シリンダ 121601
Units = シリンダ数 of 16065 * 512 = 8225280 バイト
セクタサイズ (論理 / 物理): 512 バイト / 512 バイト
I/O size (minimum/optimal): 512 bytes / 512 bytes
ディスク識別子: 0x48da8bd6

デバイス ブート      始点        終点     ブロック   Id  システム
/dev/sdb1   *           1          13      102400    7  HPFS/NTFS
パーティション 1 は、シリンダ境界で終わっていません。
/dev/sdb2              13      121602   976657408    7  HPFS/NTFS

で、/boot/grub/grub.confの内容が

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
  set saved_entry=${prev_saved_entry}
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z ${boot_once} ]; then
    saved_entry=${chosen}
    save_env saved_entry
  fi
}

function recordfail {
  set recordfail=1
  if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
}
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
insmod ext2
set root='(hd2,1)'
search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
set locale_dir=($root)/boot/grub/locale
set lang=ja
insmod gettext
if [ ${recordfail} = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.32-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    linux    /boot/vmlinuz-2.6.32-25-generic root=UUID=43330517-de25-41d9-bc3a-25b77412d05f ro   quiet splash
    initrd    /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    echo    'Loading Linux 2.6.32-25-generic ...'
    linux    /boot/vmlinuz-2.6.32-25-generic root=UUID=43330517-de25-41d9-bc3a-25b77412d05f ro single
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.32-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    linux    /boot/vmlinuz-2.6.32-24-generic root=UUID=43330517-de25-41d9-bc3a-25b77412d05f ro   quiet splash
    initrd    /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    echo    'Loading Linux 2.6.32-24-generic ...'
    linux    /boot/vmlinuz-2.6.32-24-generic root=UUID=43330517-de25-41d9-bc3a-25b77412d05f ro single
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-23-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    linux    /boot/vmlinuz-2.6.32-23-generic root=UUID=43330517-de25-41d9-bc3a-25b77412d05f ro   quiet splash
    initrd    /boot/initrd.img-2.6.32-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-23-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    echo    'Loading Linux 2.6.32-23-generic ...'
    linux    /boot/vmlinuz-2.6.32-23-generic root=UUID=43330517-de25-41d9-bc3a-25b77412d05f ro single
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.32-23-generic
}
menuentry 'Ubuntu, with Linux 2.6.31-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    linux    /boot/vmlinuz-2.6.31-22-generic root=UUID=43330517-de25-41d9-bc3a-25b77412d05f ro   quiet splash
    initrd    /boot/initrd.img-2.6.31-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.31-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    echo    'Loading Linux 2.6.31-22-generic ...'
    linux    /boot/vmlinuz-2.6.31-22-generic root=UUID=43330517-de25-41d9-bc3a-25b77412d05f ro single
    echo    'Loading initial ramdisk ...'
    initrd    /boot/initrd.img-2.6.31-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    linux16    /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
    insmod ext2
    set root='(hd2,1)'
    search --no-floppy --fs-uuid --set 43330517-de25-41d9-bc3a-25b77412d05f
    linux16    /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

オフライン

 

#4 2010-10-16 18:19:50

uotora
メンバ
登録日: 2008-06-18

Re: 起動の時のgrubの画面に windowsを表示させたい。

/boot/grub/grub.conf の内容を提示して下さい。

の内容間違ってました、正しくは /boot/grub/grub.cfg でした。大変申し訳有りませんが、再度/boot/grub/grub.cfg の内容を提示してください。
もう一点確認を /etc/grub.d/30_os-prober が存在してますか。

なお /etc/grub.d/ には以下のファイルが存在してるはずです。
00_header
05_debian_theme
10_linux
20_memtest86+
30_os-prober
40_custome
README

オフライン

 

#5 2010-10-16 18:41:15

dein
メンバ
登録日: 2009-02-24

Re: 起動の時のgrubの画面に windowsを表示させたい。

grub.confがなかったので/boot/grub/grub.cfgを投稿していたみたいです。
なので先ほど投稿したのが/boot/grub/grub.cfgです。

/etc/grub.d/の中身ですが、記入されていたものは、すべてありました。

オフライン

 

#6 2010-10-16 20:00:35

uotora
メンバ
登録日: 2008-06-18

Re: 起動の時のgrubの画面に windowsを表示させたい。

ファイル確認されたこと了解いたしました。grub.cfgの内容ですが、30_os-proberが正常に機能していないようです。端末から

コード:

sudo chmod +x /etc/grub.d/30_os-prober

実行後

コード:

sudo update-grub

を実行します。その後再起動です。

オフライン

 

#7 2010-10-16 20:50:03

uotora
メンバ
登録日: 2008-06-18

Re: 起動の時のgrubの画面に windowsを表示させたい。

追記です。当方が記述したことはオリジナルのGRUBについてです。
最初の投稿文からの推察ですが、どこかのURLを参考にされ改造されているようですが、支障無ければそのへんの情報と /etc/defalut/grub の内容を提示してください。

オフライン

 

#8 2010-10-16 21:59:16

marin
メンバ
登録日: 2007-02-13

Re: 起動の時のgrubの画面に windowsを表示させたい。

これのことでしょうか。

 sudo os-prober

   /dev/sda1:Windows Vista (loader):Windows:chain
   /dev/sda2:Windows Recovery Environment (loader):Windows1:chain

上記結果は自分の場合ですが、これは間違っています。
本当は、/dev/sda1がリカバリー領域で/dev/sda2がvistaのCドライブなんですが。
GRUBの起動選択画面でも、上のように間違って表示されます。たいした問題でも
ないのでそのままにしています。

オフライン

 

#9 2010-10-17 01:11:03

hir0
メンバ
登録日: 2008-09-28

Re: 起動の時のgrubの画面に windowsを表示させたい。

### BEGIN /etc/grub.d/40_custom ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
    insmod ntfs
    set root='(hd0,1)'
    makeactive
    chainloader +1
}
### END /etc/grub.d/40_custom ###

これで解決するということなのかも???

オフライン

 

#10 2010-10-17 07:42:09

uotora
メンバ
登録日: 2008-06-18

Re: 起動の時のgrubの画面に windowsを表示させたい。

marinさん、情報ありがとう御座いました。スクリプトファイルの内容は理解出来ないのですが、sudo os-proberを実行してみました、結果は

/dev/sda2:Microsoft Windows XP Professional:Windows:chain
/dev/sdb5:Ubuntu 9.10 (9.10):Ubuntu:linux

で、/dev/sdc1:Ubuntu 10.04(10.04):Ubuntu:linuxの部分が欠落していました。

hir0さん、40_customでは解決しないと思います。deinさんの意図は推測ですが、WindowsをGrubメニューのトップ表示させ起動順序を変更させることじゃないかと思います。

オフライン

 

#11 2010-10-17 17:01:27

dein
メンバ
登録日: 2009-02-24

Re: 起動の時のgrubの画面に windowsを表示させたい。

uotora による投稿:

ファイル確認されたこと了解いたしました。grub.cfgの内容ですが、30_os-proberが正常に機能していないようです。端末から

コード:

sudo chmod +x /etc/grub.d/30_os-prober

実行後

コード:

sudo update-grub

を実行します。その後再起動です。

返信送れてしまって申し訳ありません。
この通りやったらうまくいきました。
ありがとうございます。

オフライン

 

Board footer

Powered by FluxBB