how to find kernel for distro to create grub entry
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to find kernel for distro to create grub entry
I just installed gentoo to the last remaining partition on one of my hard drives. That gives me (hd1,0) as swap, (hd1,1) as debian, (hd1,2) as FreeBsd, and (hd1,3) as gentoo. On my other hard drive I have vista (hd0,0).
When I boot up the computer all OS's show, and all will boot except Gentoo. The grub entry for gentoo is :
title Gentoo 2008r1
root (hd1,3)
chainloader +1
If my understanding of grub is correct, I need a line between root (hd1,3) and chainloader +1 for the kernel.
Can someone assist me with what information goes on that line, and how to find the specifics to the kernel for my gentoo installation to allow grub to boot into gentoo on startup?
If there is more information that I need to post, please tell me what commands to run from Debian and I will get the information posted.
Thank you for your help!
Last edited by msc8127; 03-12-2009 at 08:48 PM.
Reason: funky typo
mmm... the last line looks like, the Windows entry in grub, except that "rootnoverify" is used.
Well if you see the others Linux opctions you need something like this
title Entry title root HD and partition kernel kernel-path and option initrd initial RAM disk [to load modules]
----
Next, and example
title Gentoo Linux 2.6.24-r5
root (hd0,0)
kernel /boot/kernel-genkernel-x86-2.6.24-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3 # you can tell the kernel where is the root [/]
initrd /boot/initramfs-genkernel-x86-2.6.24-gentoo-r5
ramdisk=8192 real_root=/dev/sda3 # you can tell the kernel where is the root [/]
is not another line, is part of the second [kernel] line.
in the last line you passing the ram-disk path, usually is /boot/, you find it there, if you dont see this file, maybe you dont use the "genkernel" of gentoo, and you kernel dont need a ramdisk, and can start alone without any modules.
The gentoo grub entry expects that you installed grub (in gentoo) to the gentoo partition. If there isn't a grub boot loader on (hd1,3), it won't boot. If it isn't installed there, you could manually locate the gentoo kernel & initrd file in the grub shell, boot up to gentoo, and then run "grub-install /dev/sdb4" to install it there. Another option is to copy the gentoo boot stanza in the gentoo install's /boot/grub/menu.lst file and add it to the menu.lst file of your main grub distro. It is usually best to either chainload the other distro's or to update grub in only you first Linux distro.
The grub shell has auto-completion which helps to locate the kernel & initrd file and save you from having to type everything.
example booting Gentoo from the grub shell. Use the correct versions of course, or the shortcut.
kernel (hd1,3)/boot/vmlinuz-<version>
initrd (hd1,3)/boot/initrd-<version>
boot
If that's the case, all you need to do is mount whatever partition Gentoo is actually on and navigate to the /boot/ directory to find the vmlinuz file and /boot/grub to find the menu.lst for Grub and copy its entry to the Debian. I assume you are using Debian Grub to boot?
If that's the case, all you need to do is mount whatever partition Gentoo is actually on and navigate to the /boot/ directory to find the vmlinuz file and /boot/grub to find the menu.lst for Grub and copy its entry to the Debian. I assume you are using Debian Grub to boot?
I installed Gentoo from the 2008r1 livecd and during it's installation it said that is was installing GRUB to the MBR.
At that point I figured it would overwrite the current GRUB on the MBR which was installed by debian that is booting Vista, Debian, and BSD.
However when I restarted after the Gentoo installation was completed I got the same boot options as what I had before (Debian GRUB).
So I logged into Debian and added what I posted in the initial post in this thread for Gentoo and that of course isn't letting me boot gentoo. That is where my confusion is coming from...what information I need for the Debian boot/grub/menu.lst that I need to get Gentoo to boot from Grub.
Gentoo shows up as a boot option, but it gets error 13 I believe when I select Gentoo, whereas vista, Debian and BSD all will boot with their current configurations.
Grub Error 13 : Invalid or unsupported executable format
This error is returned if the kernel image being loaded is not recognized as Multiboot or one of the supported native formats (Linux zImage or bzImage, FreeBSD, or NetBSD).
Does the quote below mean you had all prior options at boot but NONE for Gentoo?? If that's the case, it would seem it did not install to mbr?
Quote:
However when I restarted after the Gentoo installation was completed I got the same boot options as what I had before (Debian GRUB).
You said you could boot into Debian so you could run 'fdisk -l' command to make sure of the Gentoo partition (if you don't know it), mount that partition in Debian and navigate to the /boot/grub/ directory to see if the files are there. If you find your Gentoo menu.lst, you could just copy its entry to Debian.
The entry for Gentoo in Debian you posted earlier (below) should work. No reason you can't chainload Linux. I would add (hd1,3) after chainloader but I'm not sure that's necessary. This obviously assumes that Gentoo is install on your second drive, fourth partition.
Quote:
title Gentoo 2008r1
root (hd1,3)
chainloader +1
I've never used Gentoo so I'm not sure if there is anyting unusual about its boot process?
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1549f232
Device Boot Start End Blocks Id System
/dev/sda1 1 182 1461883+ 82 Linux swap / Solaris
/dev/sda2 183 19549 155565427+ 83 Linux
/dev/sda3 19550 28667 73240177+ a5 FreeBSD
/dev/sda4 28668 38913 82300995 83 Linux
Disk /dev/hdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x8f8004b1
Device Boot Start End Blocks Id System
/dev/hdb1 * 1 38914 312568832 7 HPFS/NTFS
In that the /dev/sda4 is the gentoo installation. I'll try chainloading it again.
When I initially rebooted the computer, no entry for gentoo showed up. At that point I went into Debian and added the lines listed in the first post for Gentoo. From there I got the error 13 when I selected Gentoo from the grub list.
On the boot info script I have that script downloaded to my desktop, but I'm still trying to figure out what to enter command wise to make it run.
the download page at sourceforge.net said as root to run /home/shane/boot_info_script27.sh but for whatever reason that doesn't work when I run that command as su
I'll keep trying to figure it back and will post the details if I do get it figured out.
debian:/home/shane# /home/shane/boot_info_script27.sh
bash: /home/shane/boot_info_script27.sh: No such file or directory
I guess I can't figure out what command runs the script. I've tried every variation I could find on google of running the script after downloading it to my desktop and I am having no luck getting it to work.
I am trying the command as su in terminal.
so, since i'm sure it's something obvious, what am I doing wrong?
==========
so, since i'm sure it's something obvious, what am I doing wrong?
==========
msc8127:
There is nothing wrong with installing gentoo at the beginning of logical partition sdb4. what is wrong now is that your grub at the mbr and sda2 cannot point (cannot pass duty) to the gentoo kernel.
At the grub boot prompt, before timeout expires, press Esc or Tab, you'll be taken to a blue listing of "default O.S options", try create new entry for gentoo there, just to boot for that session, there are options for help offered by Grub at that stage, try F1, F2 etc, also "e" "o" and "O" capital O, as well as "b" to boot. Just take time to learn to take control of the options offered by grub at that stage.
Find out how to edit and create this new entry there:
there is no need for grub to chainload a linux kernel located within the same device, only when grub passes the duty to another bootloader like for example an ntloadr.sys to load an XP or non-linux kernel.
Note: editing at this prompt does not affect your menu.lst on the drive; at reboot the former record is restored.
If above entry cannot trigger your gentoo kernel waiting at /dev/sda4 you may again Ctl+Alt+Del and repeat the process by specifying another target drive, say:
If still no good, try to check your next line, the syntax of the kernel line, if your entry misses just one character to the name of gentoo kernel sitting at sda4 the latter will not acknowledge and will never boot. Usually, kernels are named as "linuz-2.26.xxxx-<architecture>-<blah>" or a link to it is created at the / usually named as "vmlinuz". Either of these names if found you can apply to the grub prompt.
Note: the entry for "initrd" should be after the kernel line. But if you have a good RAM there is no need to use initrd. You can compile an initrd later when things are going already and add the same to the gentoo entry at the menu.lst.
If you have not yet installed grub at gentoo you must install it now for it to become "grub-aware" but do not apply "grub-install" command in order not to change your current mbr.
If you want to back up your current MBR, just in case, at debian issue this command:
dd if=/dev/sda of=/boot/MYMBR bs=512 count=1
keep the mbr file safe, to be restored this way if needed:
dd if=/boot/MYMBR of=/dev/sda
I have tried fresh install slackware at the last slice of logical drive, without LILO and without grub, I used the Mint (@sda1) grub prompt (edit) to point at the slackware kernel, and indeed it triggered the new kernel. That's how good Grub is.
You can make it. Goodluck.
Hope this can help a bit.
Last edited by malekmustaq; 03-14-2009 at 01:19 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.