LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 02-01-2011, 02:51 PM   #1
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Slackware 14; CentOS; Vyatta
Posts: 372

Rep: Reputation: 33
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

Last edited by spoovy; 02-01-2011 at 02:56 PM.
 
Old 02-01-2011, 02:56 PM   #2
EDDY1
Guru
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,087

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

commands
"os-prober"
"update-grub"

You may have to use "su" or "sudo"
 
Old 02-01-2011, 03:00 PM   #3
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Slackware 14; CentOS; Vyatta
Posts: 372

Original Poster
Rep: Reputation: 33
I am well aware that i'm using grub2 thanks.

Last edited by spoovy; 02-01-2011 at 03:04 PM.
 
Old 02-01-2011, 03:05 PM   #4
EDDY1
Guru
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,087

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
You don't edit grub.cfg
you run command
os-prober
then
update-grub
 
Old 02-01-2011, 03:08 PM   #5
EDDY1
Guru
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,087

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
If it doesn't work open disk manger and mount windows partition and rerun commands.
 
Old 02-01-2011, 03:09 PM   #6
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Slackware 14; CentOS; Vyatta
Posts: 372

Original Poster
Rep: Reputation: 33
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.
 
Old 02-01-2011, 03:12 PM   #7
EDDY1
Guru
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,087

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
os-prober is a debian tool.
 
1 members found this post helpful.
Old 02-01-2011, 03:14 PM   #8
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Slackware 14; CentOS; Vyatta
Posts: 372

Original Poster
Rep: Reputation: 33
aha I did not realise that. i'll try it, thanks.
 
Old 02-01-2011, 03:17 PM   #9
spoovy
Member
 
Registered: Feb 2010
Location: London, UK
Distribution: Slackware 14; CentOS; Vyatta
Posts: 372

Original Poster
Rep: Reputation: 33
That worked. Thanks EDDY, I had always assumed that the os probing functionality was built into grub2 itself.
Cheers again
 
Old 02-01-2011, 03:18 PM   #10
EDDY1
Guru
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,087

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
You're welcome
Check out the last post on this thread
http://www.linuxquestions.org/questi...-grub2-706272/
 
Old 02-01-2011, 03:45 PM   #11
EDDY1
Guru
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,087

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Don't forget to mark as solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How come I can't edit /boot/grub/grub.conf or /boot/grub/menu.lst in Fedora 14? trien27 Fedora 4 01-22-2011 04:02 PM
Grub menu doesnt load at startup : dual boot : grub in the /boot partition jayesh.bhoot Linux - General 7 10-23-2010 03:58 AM
Creating a Grub2 boot-cd with a (grub.cfg) menu ..my solution ssenuta Linux - General 3 02-04-2010 06:16 PM
Why /boot/grub/grub.conf is symlinked to /boot/grub/menu.lst raj_hcl1986@rediffma Linux - Newbie 2 10-19-2008 02:19 AM
need to access /boot/grub/menu.lst and /boot/grub/device.map neouto Linux - Newbie 8 09-04-2005 11:45 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration