LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-02-2008, 02:10 AM   #1
chipotphe
Member
 
Registered: Nov 2007
Posts: 62

Rep: Reputation: 15
grub, how it works


Hello,

I had a working system (booting with Grub in mbr).
I played around with some partitions, and now my system always starts with grub> prompt.

I ask myself how can this be so?

I know grub is working with stages : stage 1 (in mbr) stage 1,5 and stage 2.


When I get grub> prompt, I think I am in stage 2. (isn't it?)
How can stage 1 (or stage 1,5) find my stage2 ? (after partition handling on an other partition !)

I think I do not make use of stage 1,5 (I do not notice anything of starting that during my system start)

I in past I saw, during my system start : GRUB
GRUB loading stage 1,5 (or GRUB loading stage2).

Now I do not see anything about this !
I get directly GRUB> prompt.


I want to know this because I am curious. I want to understand how grub works.
I know : I can probably make a correction to this situation by reinstalling grub. (But I do not want to do so until I understand what is happening).

When this would happen again afterward, I know why and I can correct it better.


Summary:
Who can explain me how grub stage1 find it next stage(s), and where they are (must be) located?


Thanks,
 
Old 12-02-2008, 04:53 AM   #2
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 302
Blog Entries: 1

Rep: Reputation: 34
do
info grub
everything is listed in there.
 
Old 12-02-2008, 04:57 AM   #3
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 302
Blog Entries: 1

Rep: Reputation: 34
http://www.gnu.org/software/grub/manual/grub.pdf
 
Old 12-02-2008, 06:04 AM   #4
chipotphe
Member
 
Registered: Nov 2007
Posts: 62

Original Poster
Rep: Reputation: 15
I have read and reread the doc several times.
But I do not find WHERE the and how the links are (hard)coded.

Must be somewhere in stage 1 (via hexeditor must it be possible) to see where next stage must be.

But what offset to look ? ?
 
Old 12-02-2008, 06:07 AM   #5
RMLinux
Member
 
Registered: Jul 2006
Posts: 260

Rep: Reputation: 37
Quote:
Originally Posted by chipotphe View Post
I have read and reread the doc several times.
But I do not find WHERE the and how the links are (hard)coded.

Must be somewhere in stage 1 (via hexeditor must it be possible) to see where next stage must be.

But what offset to look ? ?
In post new threads. you type this in this forum "Title: how grub works" then "click here to find similar threads" ...this will help you..
 
Old 12-02-2008, 07:33 AM   #6
Total-MAdMaN
Member
 
Registered: May 2008
Distribution: Gentoo
Posts: 306

Rep: Reputation: 34
It's coming up with a prompt because, by "playing around with some partitions", you've probably changed the partition that holds the boot information grub requires. You need to find out which partition this is, then adjust menu.lst to point to the correct partition.
 
Old 12-02-2008, 07:40 AM   #7
chipotphe
Member
 
Registered: Nov 2007
Posts: 62

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Total-MAdMaN View Post
It's coming up with a prompt because, by "playing around with some partitions", you've probably changed the partition that holds the boot information grub requires. You need to find out which partition this is, then adjust menu.lst to point to the correct partition.
I think that the location of stage2 is "hard-coded" as an absolute startsector into stage1.
And I also think that the link to menu.lst is a kind of a "symbolic link" coded in stage2. (pointing to my original partition number)

I am looking for a confirmation about this.
 
Old 12-02-2008, 10:51 AM   #8
Duck2006
Member
 
Registered: Sep 2006
Distribution: Ubuntu 8.04 Hardy Heron LST
Posts: 346

Rep: Reputation: 33
Some info on grub and how it works.

http://www.dedoimedo.com/computers/grub.html
http://www.geocities.com/thestarman3/asm/mbr/GRUB.htm
http://www.gnu.org/software/grub/manual/grub.html
 
  


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
bootdisk works but not grub cabo Linux - General 4 03-29-2006 02:22 PM
GRUB works, then it doesn't Tarkan2467 Linux - Distributions 7 03-29-2006 02:06 PM
Grub 21 Error, tried some solutions, nothing works yet ColinBehr Linux - General 4 02-12-2006 01:27 PM
Grub only half works Gsee Linux - General 32 01-16-2005 07:52 PM
aaaarg! grub doesn't works!!! [ITA]freeware Linux - Software 6 07-22-2004 06:42 AM


All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration