GRUB setup

Arkady Grudzinsky grudziar at linuxhightech.com
Wed Feb 4 09:10:10 PST 2004


Thanks to everyone for your help.  I have solved my problem and learned a
good deal in the process.  Just for the summary:

PROBLEM:

GRUB installed according to LFS 5.0 book did not work, because MBR is
located on (hd0) and LFS with GRUB was installed on (hd1).  GRUB command
'setup (hd0)' in this setup does not correctly point to stage2 and
menu.lst files.

SOLUTION:

The problem was solved by correcting a number of mistakes.  Remind my hard
drive configuration:

hda1	(hd0,0) ext2	/boot of the host system SuSE 7.2 with LILO
hda2	(hd0,1) swap
hda3	(hd0,2) reiserfs / of the host system

hde1	(hd1,0) swap
hde2	(hd1,1) reiserfs / of LFS with GRUB

GRUB was installed into (hd1,1)/boot/grub and initially set up by typing
root (hd1,1)
setup (hd0)
in GRUB shell.

The first mistake was that 'setup (hd0)' invoked 'install ... d (hd0)
(hd0)1+18 ...'.  The blocklist, apparently, did not point to stage2 file.
Replaced the blocklist with the path name 'install ... d (hd0)
(hd1,1)/boot/grub/stage2 ...'.  After that GRUB loaded from the hard drive
and entered GRUB command prompt (no menu yet).

The second mistake was that 'setup (hd0)' invoked 'install ...' with a 'p'
option which incorrectly set up my menu.lst.  Deleted the 'p' option from
the 'install ...' command to let GRUB find menu.lst file in default
locations.  After that GRUB loaded and displayed a menu.

The third mistake was incorrect menu.lst setup.  I confused between the
'root (hd?,?)' grub command and 'root=/dev/hd?' parameter for the kernel.
Since I did not have a device.map file in my /boot/grub directory, I
thought that GRUB would not be able to understand the /dev/hd? syntax and
specified all hard drives in GRUB notation:  'kernel (hd0,0)/vmlinuz
root=(hd0,2)'.  I did not realize that 'root=(hd0,2)' IS NOT a GRUB
command, but a kernel parameter and is interpreted by kernel.  Kernel,
therefore, could not find its root partition.  Naturally,  'kernel
(hd0,0)/vmlinuz root=/dev/hda2' solved the problem.

Thanks to your participation.  My LFS system is bootable now which fills
my heart with pride :).

Arkady.

May the source be with you.

On Wed, 4 Feb 2004, Harun Musa wrote:

> try this
>
> on LFS system
>
> ~#mount -t ext2 /dev/hda2 /mnt/somewhere
> ~#mkdir /mnt/somewhere/grub
> ~#cp /usr/share/grub/i386-pc/* /mnt/somewhere/grub
> ~#cp /boot/lfskernel /mnt/somewhere
> ~#cd /mnt/somewhere/grub
> ~#vi menu.lst
> -------
> default 0
> timeout 20
> color magenta/cyan
>
> title SuSE
> kernel (hd0,1)/vmlinuz root=/dev/hda3
>
> title LFS
> kernel (hd0,1)/lfskernel root=/dev/hde2
>
> ------
> save & exit
>
> ~#grub
> grub>root (hd0,1)
> grub>setup (hd0)
> grub>quit
>
> ~#reboot
>
>
> On Tue, 3 Feb 2004 09:19:20 -0800 (PST)
> Arkady Grudzinsky <grudziar at linuxhightech.com> wrote:
>
> > On Tue, 3 Feb 2004, Harun Musa wrote:
> >
> > > please setup GRUB on your host system
> > > no need to enter grub prompt just edit menu.lst
> > > & copy lfskernel to /boot partition (host)
> >
> >
> > Thanks, Harun.
> >
> > The problem with this solution is that the host system was using LILO and
> > it is not bootable any more.
> >
> > However, I managed to make my new system bootable.  First good news was
> > that I could load my "shiny LFS" using grub prompt loaded from a diskette.
> > Then I examined the install command that GRUB graciously prints out after
> > executing 'setup (hd0)'. I tried two changes to that install command.
> > First, in the clause 'd (hd0) (hd0)1+18', I replaced the blocklist with
> > the path name to my stage2: 'd (hd0) (hd1,1)/boot/grub/stage2'.  After
> > that, I was able to get GRUB prompt from the hard drive (no menu yet).
> > Second, I got rid of the arguments that patch the configuration file that
> > come after the "p".  And then -- "TA-DA!" the menu magically appears.
> >
> > Now I have another problem.  I tried to add an item to GRUB menu for my
> > host system which resides on two partitions: hda1 (ext2, /boot) and hda3
> > (reiserfs, /).  In menu.lst, I entered
> >
> > title SuSE
> > root (hd0,2)
> > kernel (hd0,0)/vmlinuz
> >
> > This produces grub error 18 (selected cylinder exceeds maximum supported
> > by BIOS) after execution of 'root (hd0,2)'.  Typing 'root (hd0,<TAB>' in
> > grub prompt gives me the same error when trying to recognize (hd0,2).
> > Error 18 explanation in GRUB info says that it happens when the hard drive
> > is too large for BIOS to handle.  No hint about how to fix it.  The
> > strange thing is that when I invoke GRUB shell from bash after I load the
> > LFS system, Error 18 no longer appears and partition (hd0,2) is correctly
> > recognized.  BIOS appears to be irrelevant in that case.
> >
> > Does anyone know why I am getting this error?
> >
> > I have a feeling that this problem has something to do with initrd which I
> > have to learn about.
> >
> > Thanks.
> >
> > Arkady.
> >
> > >
> > >
> > > title LFS
> > > kernel (hd0,1)/lfskernel root=/dev/hde2
> > >
> > >
> > > > > Hi, everyone.
> > > > > <snip>
> > > > > Here is the list of the hard drives and partitions on my system:
> > > > >
> > > > > hda1	swap
> > > > > hda2	ext2		host system /boot
> > > > > hda3	reiserfs	host system /
> > > > >
> > > > > hde1	swap
> > > > > hde2	reiserfs	LFS /
> > > > >
> > > > > hdg1	swap
> > > > > hdg2	reiserfs
> > > > >
> > > > > I copied the stage1, stage2, and reiserfs_stage1_5 into
> > > > > /boot/grub of my
> > > > > LFS partition.
> > > > >
> > > > > In grub shell I typed:
> > > > >
> > > > > root (hd1,1)
> > > > > setup (hd0)
> > > > >
> > > > > That produced a message that the necessary files were found and the
> > > > > install was successful.
> > > > >
> > > > > In menu.lst I have:
> > > > >
> > > > > ...
> > > > > title LFS 5.0
> > > > > kernel (hd1,1)/boot/lfskernel root=/dev/hde2
> > > >          ^^^^^^^^^^^^^
> > > > Correct if I am wrong, normally there is a space between "(hd1,1)" and
> > > > "/boot/lfskernel".
> > > >
> > > > > When I try to reboot the system, I get "GRUB GRUB GRUB..." in
> > > > > a cycle all
> > > > > over the screen.
> > > >
> > > > Good luck
> > > >
> > > > --
> > > > http://linuxfromscratch.org/mailman/listinfo/lfs-support
> > > > FAQ: http://www.linuxfromscratch.org/lfs/faq.html
> > > > Unsubscribe: See the above information page
> > > >
> > >
> > >
> > > --
> > > myLFS ,myDISTRO ,myRULEZ
> > > http://groups.yahoo.com/group/mylfs
> > > --
> > > http://linuxfromscratch.org/mailman/listinfo/lfs-support
> > > FAQ: http://www.linuxfromscratch.org/lfs/faq.html
> > > Unsubscribe: See the above information page
> > >
> >
> > --
> > http://linuxfromscratch.org/mailman/listinfo/lfs-support
> > FAQ: http://www.linuxfromscratch.org/lfs/faq.html
> > Unsubscribe: See the above information page
> >
>
>
> --
> myLFS ,myDISTRO ,myRULEZ
> http://groups.yahoo.com/group/mylfs
> --
> http://linuxfromscratch.org/mailman/listinfo/lfs-support
> FAQ: http://www.linuxfromscratch.org/lfs/faq.html
> Unsubscribe: See the above information page
>




More information about the lfs-support mailing list