Grub question (Ahem....help! Now it just says 'GRUB')

Otto Haliburton ottohaliburton at comcast.net
Wed Sep 29 18:02:23 UTC 2004



> -----Original Message-----
> From: redhat-install-list-bounces at redhat.com [mailto:redhat-install-list-
> bounces at redhat.com] On Behalf Of Mark Knecht
> Sent: Wednesday, September 29, 2004 12:25 PM
> To: Getting started with Red Hat Linux
> Subject: Re: Grub question (Ahem....help! Now it just says 'GRUB')
> 
> Rick Stevens wrote:
> > Mark Knecht wrote:
> >>
> >>
> >>
> >> I'm unclear whether you think this would have helped my problem. I
> >> think not. Using Stuart's info he said grb had two parts. In my case
> >> grub said 'GRUB' but didn't say 'GRUB second phase loader' or whatever
> >> that language is. I assume grub cannot find fstab on it's own,
> >> correct?
> >
> >
> > Correct.  /etc/fstab is used by the "mount -a" command in the startup
> > scripts.  The MBR part of grub (first stage) needs to know where the
> > second stage is located.  That's what the "root=" thing is for in
> > grub.conf--it tells grub where /boot is (and hence, where the second
> > stage loader and the grub config file are).
> >
> 
> <SNIP from Stuart Sear's response>
> 
> GRUB is split into two parts, the first and second stages. The first
> stage is a small (446b IIRC) binary file that goes onto the MBR (or
> indeed first sector) of your bootable disc/partition. This is a
> supremely unintelligent binary which simply loads the second stage
> bootloader (by disc sector).
> 
> The second stage is the full binary that provides your boot menu,
> allowing you to choose between kernels (and other OSs if configured that
> way). It is the second stage that looks for /boot/grub/grub.conf (well
> actually menu.lst, which is symlinked to grub.conf)
> 
> So if you change the location of your root (or indeed /boot) FS you need
> to reinstall your 1st stage BL, which is what the grub-install command
> does.
> 
> <SNIP>
> 
> OK then, to finish up from my side (unless I'm incorrect in this
> summary) here's what happened. My /dev/hda7 / (root) partition did not
> change numbers. It has /dev/hd7 before and after the move. My /dev/hda5
> /boot partition also did not change numbers. It was /dev/hda5 before and
> after.
> 
> However, when I move /dev/hda7 the sectors that the second stage of grub
> is located on moves. grub is not really smart enough to look somewhere
> within /dev/hda7, but actually has to be given the exact secotr numbers.
> Since this changed grub was hosed.
> 
> The fix, odd as it is, is to reinstall grub to my boot partition. In my
> case nothing new would be written onto the boot partition, and nothign
> new would be written onto the / (root) partition, but the act of
> writting /dev/hda7 again causes the grub-install process to figure out
> what the new sector numbers are and set up the portion of grub on the
> /boot partition correctly.
> 
> Weird, but I guess it works. Makes me wonder...
> 
> Thanks,
> Mark
> 
> _______________________________________________

my 2c and them I'm outta here.  First the partition numbers are not the ones
you are thinking of you can have a hda7 and a hdb7 etc.  There is a logical
argument that the physical sector of the second stage has not changed.
Third, and finally normally GRUB prints message that it could not find
second stage and you said you got GRUB only. So finally, I believe you
loaded the second stage but ....  If you want to test it further rename
grub.conf and then boot and see what happens.






More information about the Redhat-install-list mailing list