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
 
LinkBack Search this Thread
Old 09-15-2008, 10:00 AM   #1
SpLaSh212
Member
 
Registered: Mar 2006
Posts: 42

Rep: Reputation: 15
grub stage2 file moved, can't boot


hey guys,
according to grub's documentation:
Quote:
The difference between stage1 and *_stage1_5 is that the former doesn't understand any filesystem while the latter understands one filesystem (e.g. e2fs_stage1_5 understands ext2fs). So you can move the Stage 2 image to another location safely, even after GRUB has been installed.
from http://www.gnu.org/software/grub/man...es.html#Images

So I tried to move the stage2 file to another partition, I expected to get the grub cmd so I can find the stage2 file (with the 1.5 fs drivers) but when the system boots, it just hangs with the text "GRUB"

what didn't I understand correctly ?
thanks alot !
 
Old 09-15-2008, 12:51 PM   #2
Midas7g
LQ Newbie
 
Registered: Apr 2004
Location: Atlanta, GA
Distribution: Ubuntu 8.04
Posts: 6

Rep: Reputation: 0
Not that I've ever tried this before, but the way the doc describes it, it sounds like GRUB is loaded using Stage 1, which picks a Stage 1.5 filesystem. This allows GRUB to read that filesystem, so then Stage 2 can exist in any filesystem and not have to be explicitly in any exact location.

Stage 1 (load GRUB) > Stage 1.5 (pick filesystem) > Stage 2 (load OS in selected filesystem)

Quote:
These are called Stage 1.5, because they serve as a bridge between stage1 and stage2, that is to say, Stage 1.5 is loaded by Stage 1 and Stage 1.5 loads Stage 2.
Since Stage 1.5 calls Stage 2, I would assume that you'd have to adjust a Stage 1.5 file to point to the new location of Stage 2. When the docs say that the Stage 2 file can be moved anywhere, I think it means it can reside anywhere, including inside a filesystem.

Quote:
While Stage 2 cannot generally be embedded in a fixed area as the size is so large, Stage 1.5 can be installed into the area right after an MBR, or the boot loader area of a ReiserFS or a FFS.
So, to summarize:
Stage 1 fits in the MBR and boots GRUB
Stage 1.5 fits either inside or just after the MBR (since it's so small)
Stage 2 can reside anywhere because Stage 1.5 points at it. Stage 2 can't fit in the MBR (or just after) because it is too big.
 
Old 09-15-2008, 01:56 PM   #3
SpLaSh212
Member
 
Registered: Mar 2006
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Midas7g View Post
Stage 1 (load GRUB) > Stage 1.5 (pick filesystem) > Stage 2 (load OS in selected filesystem)
stage 1.5 is for file system type (ext, reiserfs,iso9660 etc.), so when u say that "load OS in selected filesystem" it doesn't sounds right, because what if I had 30 hard drives with ext fs ?
I don't think grub is gonna try to find the stage 2 in all of those disks...

Quote:
Since Stage 1.5 calls Stage 2, I would assume that you'd have to adjust a Stage 1.5 file to point to the new location of Stage 2. When the docs say that the Stage 2 file can be moved anywhere, I think it means it can reside anywhere, including inside a filesystem.
The problem with that sentence is that, first of all, the root command is the command that points to the right place of needed files (including stage2).
And second of all, when u delete stage1_5 files it doesn't stops boot..
The system just boots regularly
 
Old 09-15-2008, 02:49 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
I am getting a headache trying to follow this....

The way to avoid all this is to simply install** GRUB with the first "root" statement pointing to the correct partition--ie the one that contains the /boot/grub files, menu.lst, etc.. Once you have done that, don't try to relocate any GRUB elements, stages, etc.

The "booting" link below might be helpful.


**My reading and experience both favor the GRUB shell method (as opposed to grub-install).
 
Old 09-16-2008, 10:24 AM   #5
SpLaSh212
Member
 
Registered: Mar 2006
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pixellany View Post
I am getting a headache trying to follow this....

The way to avoid all this is to simply install** GRUB with the first "root" statement pointing to the correct partition--ie the one that contains the /boot/grub files, menu.lst, etc.. Once you have done that, don't try to relocate any GRUB elements, stages, etc.

The "booting" link below might be helpful.


**My reading and experience both favor the GRUB shell method (as opposed to grub-install).
well, it's always easier to install from scratch ..
the real deal is to fix it
 
Old 09-16-2008, 01:56 PM   #6
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.13.2
Posts: 1,468
Blog Entries: 10

Rep: Reputation: 142Reputation: 142
Well, then, to fix it, start the grub shell, use the "find" command to find your stage2 files and modify your menu.lst and you should be good to go.
 
Old 09-17-2008, 10:37 AM   #7
SpLaSh212
Member
 
Registered: Mar 2006
Posts: 42

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by mostlyharmless View Post
Well, then, to fix it, start the grub shell, use the "find" command to find your stage2 files and modify your menu.lst and you should be good to go.
thats the problem... if stage2 file is moved, the grub shell isn't starting, it just says "GRUB" and hangs ..
 
Old 09-17-2008, 03:13 PM   #8
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Slackware 14.1 (multilib) with kernel 3.13.2
Posts: 1,468
Blog Entries: 10

Rep: Reputation: 142Reputation: 142
Actually I was thinking of using the grub shell at the command prompt or with a boot disk such as SuperGrub, not the boot shell, which, as you point out, is disabled. SO... I'd get a SuperGrub disk, boot from it, and proceed. Or copy the files back to where they were and proceed.

Quote:
so when u say that "load OS in selected filesystem" it doesn't sounds right, because what if I had 30 hard drives with ext fs ?
I don't think grub is gonna try to find the stage 2 in all of those disks...
Since you know where you moved the stage2 files presumably you could just change menu.lst to point to the new location. The "find" command will indeed look in all 30 places. Don't know about the "not needing stage 1.5"; I think you'll only proceed with booting as normal under some cicumstances that way.

Maybe I'm just confused about the problem.
 
  


Reply

Tags
grub, hang, mbr, stage


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB Loading Stage2... unicornsoftsol Linux - Newbie 1 06-30-2008 03:19 AM
Grub won't boot windows after it has been moved stevesutt89 Linux - General 6 11-21-2007 11:32 PM
Boot hangs on "GRUB loading stage2" emorrell Linux - Software 1 10-06-2006 11:03 AM
help! GRUB Stage2 error neolithicvirgo Suse/Novell 18 02-23-2005 11:50 AM
how do I get stage2 into grub as an executable aus9 Programming 0 09-21-2004 12:35 AM


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