Ask Your Question
0

How to add fedora to grub2 menu.

asked 2012-09-26 15:09:08 -0500

skore13 gravatar image

updated 2013-01-26 12:20:19 -0500

hhlp gravatar image

Situation: I've installed fedora 17 to my PC and then I installed Windows 7 so it didn't boot to Fedora. Today, I've finally managed how to install and configurate grub2. If you want to know how: First, I booted up fedora live cd, then I mount /dev/sda4 as /boot then I run: grub2-install /dev/sda then grub2-mkconfig -o /boot/grub2/grub.cfg and finally I rebooted. And it was big surprise when I saw windows 7 only. So my question is: how can I add fedora to my grub menu?

my terminal outputs:

grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
/usr/share/grub/grub-mkconfig_lib: line 53:  3577 Segmentation fault      (core dumped) "${grub_probe}" -t fs "$path" > /dev/null 2>&1
/usr/share/grub/grub-mkconfig_lib: line 53:  3579 Segmentation fault      (core dumped) "${grub_probe}" -t fs "$path" > /dev/null 2>&1
/usr/share/grub/grub-mkconfig_lib: line 53:  3581 Segmentation fault      (core dumped) "${grub_probe}" -t fs "$path" > /dev/null 2>&1
/usr/share/grub/grub-mkconfig_lib: line 53:  3583 Segmentation fault      (core dumped) "${grub_probe}" -t fs "$path" > /dev/null 2>&1
Found Windows 7 (loader) on /dev/sda2
Found Fedora release 17 (Beefy Miracle) on /dev/mapper/vg_skore13--fed17-lv_root
done

grub2-mkconfig

Generating grub.cfg ...
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-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="${saved_entry}"
if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi
export menuentry_id_option
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 load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}
/usr/share/grub/grub-mkconfig_lib: line 53:  4246 Segmentation fault      (core dumped) "${grub_probe}" -t fs "$path" > /dev/null 2>&1
/usr/share/grub/grub-mkconfig_lib: line 53:  4248 Segmentation fault      (core dumped) "${grub_probe}" -t fs "$path" > /dev/null 2>&1
/usr/share/grub/grub-mkconfig_lib: line 53:  4250 Segmentation fault      (core dumped) "${grub_probe}" -t fs "$path" > /dev/null 2>&1
/usr/share/grub/grub-mkconfig_lib: line 53:  4252 Segmentation fault      (core dumped) "${grub_probe}" -t fs "$path" > /dev/null 2>&1
if loadfont unicode ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
Found Windows 7 (loader) on /dev/sda2
menuentry 'Windows 7 (loader) (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-chain-243E1A133E19DE9C' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  243E1A133E19DE9C
    else
      search --no-floppy --fs-uuid --set ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-10-14 16:12:00 -0500

Ashwini gravatar image

after running grub2-mkconfig -o ... . run grub2-install /dev/sda

the easier way, boot from live cd, run 0s-prober after mounting boot partition, run grub2-mkconfig then grub2-install /dev/sda

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2012-09-26 15:09:08 -0500

Seen: 4,299 times

Last updated: Jan 26 '13