Skip to contentSkip to conversation

Help with Grub2

DISCUSSION BandiPat 3 participants 12 messages Feb 1, 2009 – Feb 2, 2009

lore
Share & tools
lore

BandiPat

author
#0 lore raw

Ok, I've poured over this for 2 days now, so find myself needing some expert help! Let me go over what I have done. I'll try to give as much details as possible. If you don't see it, just ask.

Compiled and installed grub2. Remove LILO from MBR. Ran grub-install /dev/sda. Run grub-setup /dev/sda. Ran update-grub to let it create a grub.cfg file. So far, so good and checking everything, it all looks great according to the instructions I have been able to find. By the way, I have done a lot of researching these past 2 days! That's how I came to find this mail list, but wanted to wait to finish my testing before using it.

Rebooted the computer which gave me the Welcome to Grub, then the grub rescue prompt. I tried several things there without any success. Here are some of the things I checked. Tried setting some things there, then boot, but no luck. Checked with the "set" command:
prefix=(hd0,2)/boot/grub
root=hd0,2

All looks good so far. Tried "boot", got error: no loaded kernel
Tried "insmod linux", got error: out of partition (I think this might be needed for the kernel with Zenwalk)

Did "ls", got (hd0) (hd0,1) (hd0,2) (hd0,3) (hd0,4)

Used "qemu -hda /dev/sda" once which corrupted my sda2 partition, so did a fresh install of Zenwalk. Upsetting, but no harm, no foul. Acted like it was working, but things moved so fast, it was booting before I could stop it. I thought it just tested, but didn't boot. That didn't seem to be the case. After the fresh install, used it again, but it went right back to the "grub rescue>" prompt.

Here's my provided grub.cfg:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/local/sbin/update-grub using templates

# from /usr/local/etc/grub.d and settings from /usr/local/etc/default/grub
#

### BEGIN /usr/local/etc/grub.d/00_header ###
set default=0
set timeout=5
set root=(hd0,2)
terminal console
### END /usr/local/etc/grub.d/00_header ###

### BEGIN /usr/local/etc/grub.d/10_hurd ###
### END /usr/local/etc/grub.d/10_hurd ###

### BEGIN /usr/local/etc/grub.d/10_linux ###

menuentry "GNU/Linux, linux 2.6.27.10" {
	linux	(hd0,2)/boot/vmlinuz-2.6.27.10 root=/dev/sda2 ro
}
menuentry "GNU/Linux, linux 2.6.27.10 (single-user mode)" {
	linux	(hd0,2)/boot/vmlinuz-2.6.27.10 root=/dev/sda2 ro single
}

### END /usr/local/etc/grub.d/10_linux ###
================
Only thing I added to try was the "insmod linux" in the upper part. Here is my setup on the HD:
sda1=swap
sda2=/
sda3=/home
sda4

My head hurts, so I might have left something out. Just ask and I'll try to supply it. :-)

Ok, thanks in advance. Would love to figure this out and get it working. I'm sure it's just something small, something I'm overlooking, but I'm just not seeing it. After I get this running, I'll be writing a small manual to include in the Zenwalk package I've built as well as detailed instructions on our Wiki!! ;-)

Pat

Signature · 3 lines
       ---Zenwalk v5.4--Linux 2.6.27---
        Registered Linux User #225206
"Ever tried Zen computing?"  http://www.zenwalk.org
#1 lore raw
Quoted 7 lines · BandiPat

Compiled and installed grub2. Remove LILO from MBR. Ran grub-install /dev/sda. Run grub-setup /dev/sda. Ran update-grub to let it create a grub.cfg file. So far, so good and checking everything, it all looks great according to the instructions I have been able to find. By the way, I have done a lot of researching these past 2 days! That's how I came to find this mail list, but wanted to wait to finish my testing before using it.

you should only need to use grub-install and update-grub (or grub-mkconfig)

Running grub-setup after grub-install without matching arguments given by grub-install to grub-setup it can create non-working setup.

So commands needed are:

grub-install
update-grub (or grub-mkconfig, or manually create grub.cfg)

Now if you get stuck to rescue console you probably want to start loading normal mode first (insmod normal.mod) and required modules needed for booting. I think we should write something about rescue console to wiki.

Here is what probably happened:

When you issues grub-setup manually you probably forgot to specify filesystems and such so grub cannot load natively from MBR your system.

As grub-setup is advanced tool it should not be used manually, please try with only grub-install and see if it help.

author
#2 lore raw
Quoted 24 lines · Vesa Jääskeläinen
Quoted 7 lines · BandiPat

Compiled and installed grub2. Remove LILO from MBR. Ran grub-install /dev/sda. Run grub-setup /dev/sda. Ran update-grub to let it create a grub.cfg file. So far, so good and checking everything, it all looks great according to the instructions I have been able to find. By the way, I have done a lot of researching these past 2 days! That's how I came to find this mail list, but wanted to wait to finish my testing before using it.

you should only need to use grub-install and update-grub (or grub-mkconfig)

Running grub-setup after grub-install without matching arguments given by grub-install to grub-setup it can create non-working setup.

So commands needed are:

grub-install
update-grub (or grub-mkconfig, or manually create grub.cfg)

Now if you get stuck to rescue console you probably want to start loading normal mode first (insmod normal.mod) and required modules needed for booting. I think we should write something about rescue console to wiki.

Quoted 8 lines

Here is what probably happened:

When you issues grub-setup manually you probably forgot to specify filesystems and such so grub cannot load natively from MBR your system.

As grub-setup is advanced tool it should not be used manually, please try with only grub-install and see if it help.
_______________________________________________

Ok, thanks for the suggestion and I do wish it had been that easy, but I still get the grub rescue prompt only. If I try to do "insmod normal", I get "error: out of partition".

Here is my lsmod results:
_chain 1
biodisk 1

pc          1
xfs         1
fshelp      1

That appears to be getting most of the needed modules, but again, I'm new to this, so not sure. I only used "grub-install /dev/sda" and then did "update-grub /dev/sda" to get my grub.cfg file. All that seems to produce good results, no error messages. One time I did grub-install wrong and got an error message about the core.img. I think that was "grub-install "(hd0,2)", which give me that error, but using /dev/sda worked as it should.

Any other info you need, I'll try to supply, but I continue to remain baffled. :-\

Thanks,
Pat

#3 lore raw

Am Sonntag, den 01.02.2009, 10:05 -0500 schrieb BandiPat:

Quoted 7 lines

Ok, thanks for the suggestion and I do wish it had been that easy, but I still get the grub rescue prompt only. If I try to do "insmod normal", I get "error: out of partition".

Here is my lsmod results:

xfs 1

What exact grub2 version do you use? There was a bug with out of partition and XFS but that should be fixed since months.

Signature · 1 line
Felix Zielcke
author
#4 lore raw
Quoted 10 lines · Felix Zielcke

Am Sonntag, den 01.02.2009, 10:05 -0500 schrieb BandiPat:

Quoted 5 lines

Ok, thanks for the suggestion and I do wish it had been that easy, but I still get the grub rescue prompt only. If I try to do "insmod normal", I get "error: out of partition".

Here is my lsmod results:

xfs 1

What exact grub2 version do you use? There was a bug with out of partition and XFS but that should be fixed since months.

Using the 1.96 stable release presently which is suppose to support xfs now, isn't it? If there is another version available, please send it to me or point me to it.

Thanks,
Pat

Signature · 3 lines
       ---Zenwalk v5.4--Linux 2.6.27---
        Registered Linux User #225206
"Ever tried Zen computing?"  http://www.zenwalk.org
#5 lore raw

Am Sonntag, den 01.02.2009, 11:11 -0500 schrieb BandiPat:

Quoted 3 lines

Using the 1.96 stable release presently which is suppose to support xfs now, isn't it? If there is another version available, please send it to me or point me to it.

The 1.96 release is pretty old, almost a year.
Better get the SVN trunk:
svn co svn://svn.sv.gnu.org/grub/trunk/grub2

That should hopefully work for you.

Signature · 1 line
Felix Zielcke
author
#6 lore raw
Quoted 10 lines · Felix Zielcke

Am Sonntag, den 01.02.2009, 11:11 -0500 schrieb BandiPat:

Quoted 1 line

Using the 1.96 stable release presently which is suppose to support xfs now, isn't it? If there is another version available, please send it to me or point me to it.

The 1.96 release is pretty old, almost a year.
Better get the SVN trunk:
svn co svn://svn.sv.gnu.org/grub/trunk/grub2

That should hopefully work for you.

===========
Felix,
You are my new hero! That was the problem, the XFS I was using. Once I got the newest release built and installed, everything worked as it should. Yaaay! I can't thank you enough for your help. It's really a very simple and painless process, if all things are correct.

Now I just need to add some other entries to use, plus I would like to make the loader screen a bit prettier. If I just want to boot to runlevel 3, can I use the standard boot entry that takes me to the gui and just add "append=3" as the last entry?

I also want to add a memtest entry. The boot loader screen is themeable, isn't it or you can use a graphic, jpg or png, etc? Sorry for all the questions, but I'm excited that it finally works. Now I want to start playing and learning.

Thanks again!
Pat

Signature · 3 lines
       ---Zenwalk v5.4--Linux 2.6.27---
        Registered Linux User #225206
"Ever tried Zen computing?"  http://www.zenwalk.org
#7 lore raw

Am Sonntag, den 01.02.2009, 13:00 -0500 schrieb BandiPat:

Quoted 5 lines

Felix,
You are my new hero! That was the problem, the XFS I was using. Once I got the newest release built and installed, everything worked as it should. Yaaay! I can't thank you enough for your help. It's really a very simple and painless process, if all things are correct.

Nice.

Quoted 4 lines

Now I just need to add some other entries to use, plus I would like to make the loader screen a bit prettier. If I just want to boot to runlevel 3, can I use the standard boot entry that takes me to the gui and just add "append=3" as the last entry?

No append=3 is LILO syntax not GRUB.
You do it like this:
linux /boot/vmlinuz-2.6.26-1-amd64 root=/dev/sda1 3
By the way you can use grub-mkconfig to generate a grub.cfg for you.

Quoted 4 lines

I also want to add a memtest entry. The boot loader screen is themeable, isn't it or you can use a graphic, jpg or png, etc? Sorry for all the questions, but I'm excited that it finally works. Now I want to start playing and learning.

Oh for the graphic mode to work you need to have /usr/src/unifont.bdf file which is for Debian/Ubuntu in bf-utf-source package and then compile grub2 with `./configure --enable-grub-mkfont' so that the fonts files needed for it are generated.
And then you can use a background image with something like this in grub.cfg:
insmod png
background_image /my/image.png
or you can use insmod jpeg or tga

Themes are not yet supported but Colin's gfxmenu branch will be merged soon.

Signature · 1 line
Felix Zielcke
author
#8 lore raw
Quoted 5 lines · Felix Zielcke

Am Sonntag, den 01.02.2009, 13:00 -0500 schrieb BandiPat:

Quoted 2 lines

Felix,
You are my new hero! That was the problem, the XFS I was using. Once I got the newest release built and installed, everything worked as it should. Yaaay! I can't thank you enough for your help. It's really a very simple and painless process, if all things are correct.

Quoted 8 lines

Nice.

Quoted 1 line

Now I just need to add some other entries to use, plus I would like to make the loader screen a bit prettier. If I just want to boot to runlevel 3, can I use the standard boot entry that takes me to the gui and just add "append=3" as the last entry?

No append=3 is LILO syntax not GRUB.
You do it like this:
linux /boot/vmlinuz-2.6.26-1-amd64 root=/dev/sda1 3
By the way you can use grub-mkconfig to generate a grub.cfg for you.

=========
Yes, I saw that grub-mkconfig replaced update-grub for that. A question about that though. When I ran grub-mkconfig /dev/sda, I looked for the file in /boot/grub directory, but none was there. What I did get was the complete file shown in the shell I was using. I just copied that into a new grub.cfg then copied it over to /boot/grub. Is that normal behavior or did I do something wrong or did it put the file somewhere else?

I knew that Suse uses an image for their grub loader screen, but never investigated that aspect when i was using it. I'll play with that a bit as I would like to do something prettier. Right now, I'm very pleased to have gotten it working on the computer!

Pat

#9 lore raw

Am Sonntag, den 01.02.2009, 14:09 -0500 schrieb BandiPat:

Quoted 6 lines

Yes, I saw that grub-mkconfig replaced update-grub for that. A question about that though. When I ran grub-mkconfig /dev/sda, I looked for the file in /boot/grub directory, but none was there. What I did get was the complete file shown in the shell I was using. I just copied that into a new grub.cfg then copied it over to /boot/grub. Is that normal behavior or did I do something wrong or did it put the file somewhere else?

You called it wrong. You should have typed `grub-mkconfig -o /boot/grub/grub.cfg'

Signature · 1 line
Felix Zielcke
author
#10 lore raw
In reply to Felix Zielcke
Quoted 10 lines · Felix Zielcke

Oh for the graphic mode to work you need to have /usr/src/unifont.bdf file which is for Debian/Ubuntu in bf-utf-source package and then compile grub2 with `./configure --enable-grub-mkfont' so that the fonts files needed for it are generated.
And then you can use a background image with something like this in grub.cfg:
insmod png
background_image /my/image.png
or you can use insmod jpeg or tga

Quoted 3 lines

Themes are not yet supported but Colin's gfxmenu branch will be merged soon.
----------------------------

One last question Felix, I hope. I think it will be, I just want this last part to work. I have the bf-utf-source package which appears to only copy two .bdf files to /usr/src and nothing else. Can I safely assume then that I can extract the contents out and manually copy them to /usr/src and grub2 will be happy?

Except of course doing the above configure for grub-mkfont, I need do nothing else except provide the unifont.bdf? If that is the case, then I'll just add these to my Zenwalk package for grub2, so it will be complete and ready for images?

Thanks again,
Pat

#11 lore raw

Am Sonntag, den 01.02.2009, 17:17 -0500 schrieb BandiPat:

Quoted 5 lines

One last question Felix, I hope. I think it will be, I just want this last part to work. I have the bf-utf-source package which appears to only copy two .bdf files to /usr/src and nothing else. Can I safely assume then that I can extract the contents out and manually copy them to /usr/src and grub2 will be happy?

Yes this works.

Quoted 4 lines

Except of course doing the above configure for grub-mkfont, I need do nothing else except provide the unifont.bdf? If that is the case, then I'll just add these to my Zenwalk package for grub2, so it will be complete and ready for images?

Yes.

Signature · 1 line
Felix Zielcke