LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-20-2010, 08:32 AM   #1
jayesh.bhoot
LQ Newbie
 
Registered: Sep 2010
Posts: 6

Rep: Reputation: 0
Grub menu doesnt load at startup : dual boot : grub in the /boot partition


Yesterday I installed Arch Linux on my laptop. I had Windows 7 already installed on /dev/sda1 (hd0,0).
The root partition or Arch is on /dev/sda3 (hd0,2).
Also, I installed grub on root partition and not on MBR.
I configured grub accordingly.

The grub entries look like below :
Code:
# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst

# DEVICE NAME CONVERSIONS 
#
#  Linux           Grub
# -------------------------
#  /dev/fd0        (fd0)
#  /dev/sda        (hd0)
#  /dev/sdb2       (hd1,1)
#  /dev/sda3       (hd0,2)
#

#  FRAMEBUFFER RESOLUTION SETTINGS
#     +-------------------------------------------------+
#          | 640x480    800x600    1024x768   1280x1024
#      ----+--------------------------------------------
#      256 | 0x301=769  0x303=771  0x305=773   0x307=775
#      32K | 0x310=784  0x313=787  0x316=790   0x319=793
#      64K | 0x311=785  0x314=788  0x317=791   0x31A=794
#      16M | 0x312=786  0x315=789  0x318=792   0x31B=795
#     +-------------------------------------------------+
#  for more details and different resolutions see
#  http://wiki.archlinux.org/index.php/GRUB#Framebuffer_Resolution 

# general configuration:
timeout   9
default   0
color light-blue/black light-cyan/blue

# boot sections follow
# each is implicitly numbered from 0 in the order of appearance below
#
# TIP: If you want a 1024x768 framebuffer, add "vga=773" to your kernel line.
#
#-*

# (0) Arch Linux
title Arch Linux
root (hd0,2)
kernel /boot/vmlinuz26 root=/dev/disk/by-label/rootp ro nomodeset
initrd /boot/kernel26.img

# (1) Arch Linux
title Arch Linux Fallback
root (hd0,2)
kernel /boot/vmlinuz26 root=/dev/disk/by-label/rootp ro nomodeset
initrd /boot/kernel26-fallback.img

# (2) Windows
title Windows7
rootnoverify (hd0,0)
#makeactive
chainloader +1
Here "rootp" is the label that i gave to the root partition. I would also like to mention that I did give a try of using /dev/sdx format for fstab entries as well as grub entries.
I found everything right in the menu.lst file. But when I boot, the grub command line hits the screen instead of the desired menu.

From the command line, I made the grub identify its root partition by :

Code:
root (hd0,2)
Also, from here I was not only able to boot the linux kernel (by using the appropriate kernel and initrd commands), but I was also able to generate the menu by running the following the command :

Code:
configfile /boot/grub/menu.lst
The menu appeared and worked correctly, i.e., both windows and arch loaded from that menu correctly.

So why doesnt the grub menu load at the first place?
 
Old 10-20-2010, 04:01 PM   #2
MrUmunhum
Member
 
Registered: May 2006
Location: Mt Umunhum, CA, USA
Distribution: Debian/ Fedora
Posts: 414

Rep: Reputation: 33
if you want to boot Grub, install it in the MBR.
 
Old 10-21-2010, 04:01 AM   #3
jayesh.bhoot
LQ Newbie
 
Registered: Sep 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by MrUmunhum View Post
if you want to boot Grub, install it in the MBR.
Yeah. I am aware of that option. But isn't what I am trying possible? Even the arch wiki instructed to install the grub on the boot partition.
 
Old 10-21-2010, 04:46 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,207

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
Originally Posted by jayesh.bhoot View Post
I installed grub on root partition and not on MBR.
I configured grub accordingly.
...
But when I boot, the grub command line hits the screen instead of the desired menu.
...
So why doesnt the grub menu load at the first place
If you didn't install grub to the MBR you woudn't even get a grub prompt.
Quote:
Even the arch wiki instructed to install the grub on the boot partition.
That is not my recollection - installing to the partition boot sector record is an option. However you still need code in the MBR to find it.
 
Old 10-22-2010, 10:46 AM   #5
jayesh.bhoot
LQ Newbie
 
Registered: Sep 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
If you didn't install grub to the MBR you woudn't even get a grub prompt.
Well, I was/am kind of confused with that fact.

Quote:
That is not my recollection - installing to the partition boot sector record is an option. However you still need code in the MBR to find it.
I got this idea from this page :
http://wiki.archlinux.org/index.php/...Arch_Dual_Boot

And regarding the need to have some code in MBR, yes, I agree to that.
I did not have a detailed idea about how it worked.

Anyways, I set up the grub using
Code:
 setup (hd0)
which I guess is used to install and configure the grub in the MBR.

Do correct me if I am wrong in my understanding.
Now I have the menu appearing at startup. So I consider this problem as solved.

However if someone has any elaborations over this problem please share.
 
Old 10-22-2010, 11:01 AM   #6
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,651

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Generally, Grub is installed during the installation of your operating system and the default is always (or almost always) to install to the master boot record.

The standard methods of installing Grub if it was not successfull during the operating system install are:

grub-install /dev/sda

This would need to be run from your Linux partition you want to boot if you have multiple Linux installations.

To install Grub to the third partition of the first drive from the grub prompt:

root (hd0,2)
setup (hd0)
quit

The above works on Grub Legacy. Grub2 numbering is different, numbering partitions from one rather than zero. I haven't used Grub2 so I don't know if this method still works.
 
Old 10-22-2010, 06:07 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,207

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
We don't know what you were planning to do - as in use the Win7 bootloader, or grub - or what you may have done to try to achieve it.
Had you done a normal Arch install, grub would be installed to the MBR, and would find that menu.lst - unless it was moved subsequently. The use of "setup (hd0)" following a "root(hd?,?)" to identify the grub root directory will (usually) fix things. The grub-install mentioned above is merely a wrapper around these commands - although it does do some sanity checks.
 
Old 10-23-2010, 03:58 AM   #8
jayesh.bhoot
LQ Newbie
 
Registered: Sep 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Yes! Even I feel that I confused you people.
But I followed the same steps that yancek and syg00 suggested and its all working perfectly now.
So, I would rather call this as solved than creating more confusion.

Thank you for help
 
  


Reply

Tags
grub, menu


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installed Fedora as dual boot but Grub boot menu is not showing up nilocjin Linux - Newbie 4 06-03-2009 02:09 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
WinXP, FC-5 Dual Boot, Grub failing to load FC-5 (can't mount selected partition) rcmpsc Fedora 4 09-21-2006 09:53 AM
no grub menu after startup in dual boot FC3 and XP Remko Fedora - Installation 6 01-19-2005 04:44 AM
Grub boot loader doesnt load (but soo close) Boomba Linux - Newbie 5 01-19-2004 12:55 AM


All times are GMT -5. The time now is 10:31 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