LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Boot menu not matching grub.cfg (https://www.linuxquestions.org/questions/linux-newbie-8/boot-menu-not-matching-grub-cfg-860073/)

spoovy 02-01-2011 02:51 PM

Boot menu not matching grub.cfg
 
I had debian squeeze already installed, then installed win 7. Windows overwrote by MBR, as I expected it to, so I used an ubuntu live cd to reinstall grub2 to debian root.

I rebooted, and sure enough I had grub back. The boot menu has debian on it. Just debian (crunchbang actually, but its the same thing).

So I added a script in /etc/grub.d (called Windows_11) to create a windows chainloader entry in grub.cfg, and ran update-grub.

Update-grub picks up my /etc/grub.d/Windows_11 script, and adds an appropriate chainloader entry to /boot/grub/grub.cfg.

So I would expect this new chainloader entry to show up in my boot menu when I boot up. But it doesn't; on booting I only have the option to select debian.

Here is my /boot/grub/grub.cfg -

Code:

### BEGIN /etc/grub.d/10_linux ###
menuentry 'CrunchBang Linux, with Linux 2.6.32-5-686' --class crunchbang --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set b3c06cb6-5520-404a-af49-8fd2940d7673
        echo        'Loading Linux 2.6.32-5-686 ...'
        linux        /boot/vmlinuz-2.6.32-5-686 root=UUID=b3c06cb6-5520-404a-af49-8fd2940d7673 ro selinux=1 quiet splash
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-2.6.32-5-686
}
menuentry 'CrunchBang Linux, with Linux 2.6.32-5-686 (recovery mode)' --class crunchbang --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set b3c06cb6-5520-404a-af49-8fd2940d7673
        echo        'Loading Linux 2.6.32-5-686 ...'
        linux        /boot/vmlinuz-2.6.32-5-686 root=UUID=b3c06cb6-5520-404a-af49-8fd2940d7673 ro single selinux=1
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-2.6.32-5-686
}
menuentry 'CrunchBang Linux, with Linux 2.6.32-3-686' --class crunchbang --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set b3c06cb6-5520-404a-af49-8fd2940d7673
        echo        'Loading Linux 2.6.32-3-686 ...'
        linux        /boot/vmlinuz-2.6.32-3-686 root=UUID=b3c06cb6-5520-404a-af49-8fd2940d7673 ro selinux=1 quiet splash
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-2.6.32-3-686
}
menuentry 'CrunchBang Linux, with Linux 2.6.32-3-686 (recovery mode)' --class crunchbang --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set b3c06cb6-5520-404a-af49-8fd2940d7673
        echo        'Loading Linux 2.6.32-3-686 ...'
        linux        /boot/vmlinuz-2.6.32-3-686 root=UUID=b3c06cb6-5520-404a-af49-8fd2940d7673 ro single selinux=1
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-2.6.32-3-686
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### 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 ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/Windows_11 ###
menuentry “Windows 7″ {
set root=(hd0,3)
chainloader +1
}
### END /etc/grub.d/Windows_11 ###


So the boot menu is not reflecting the content of grub.cfg. I tried moving the chainloader section into the same section as the debian entries but it still didn't show up in the boot menu.

How is this even possible?

Any help gratefully accepted.

Spoov

EDDY1 02-01-2011 02:56 PM

Grub2 is different
http://www.dedoimedo.com/computers/grub.html

commands
"os-prober"
"update-grub"

You may have to use "su" or "sudo"

spoovy 02-01-2011 03:00 PM

I am well aware that i'm using grub2 thanks.

EDDY1 02-01-2011 03:05 PM

You don't edit grub.cfg
you run command
os-prober
then
update-grub

EDDY1 02-01-2011 03:08 PM

If it doesn't work open disk manger and mount windows partition and rerun commands.

spoovy 02-01-2011 03:09 PM

Read my post please. I never said anywhere that I edited grub.cfg.

And isn't os-prober part of grub1? I don't have an os-prober binary anyway on this squeeze box.

EDDY1 02-01-2011 03:12 PM

os-prober is a debian tool.

spoovy 02-01-2011 03:14 PM

aha I did not realise that. i'll try it, thanks.

spoovy 02-01-2011 03:17 PM

That worked. Thanks EDDY, I had always assumed that the os probing functionality was built into grub2 itself.
Cheers again

EDDY1 02-01-2011 03:18 PM

You're welcome
Check out the last post on this thread
http://www.linuxquestions.org/questi...-grub2-706272/

EDDY1 02-01-2011 03:45 PM

Don't forget to mark as solved.


All times are GMT -5. The time now is 07:06 AM.