LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 02-01-2004, 07:41 PM   #1
maestro52
Member
 
Registered: Aug 2003
Location: Texas
Distribution: Fedora 9
Posts: 177

Rep: Reputation: 30
Question PROBLEM with grub and my newly compiled kernel!


I am using mdk 9.2

I know that may have been a slightly vague question, but I wasn't sure how to address it.

My situation is this; I appear to have actually been successful with compiling a a kernel. The instructions I used tell me that I must change the boot and such in grub or lilo. Since I use grub, I looked for the grub.config and there isn't one.

Upon further research I discovered that grub uses what looks like menu.lst or menu.Ist. As you should be able to see they both look the same but the first one is a short L and the second one is a capital i. So I am not sure which is correct.

Before I state my last question I want you to see the instruction I have for grub and it is as follows;
____________________________________________
title New Kernel
kernel /vmlinuz-x.x.x ro root=LABEL=/ hdd=ide-scsi
initrd /initrd-x.x.x.img
(Note: )
look at the previous parameters in the grub.conf file and note what "root=" and use what is existing.

Exit and Save grub.conf
type "/sbin/grub-install"
____________________________________________

Now I put the following into the menu.lst;
____________________________________________
title 2422-21mm1gsw
kernel (hd0,4)/boot/vmlinuz-2.4.22-21mm.1gsw devfs=mount hdc=ide-scsi
acpi=ht splash=silent vga=788 root=/dev/hda5
initrd (hd0,4)/boot/initrd-2.4.22-21mm.1gsw.img
____________________________________________

BUT when I tried to do the "/sbin/grub-install" I get the following error;
____________________________________________
[root@localhost linux]# /usr/sbin/grub-install
install_device not specified.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

-h, --help print this message and exit
-v, --version print the version information and exit
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-shell=FILE use FILE as the grub shell
--force-lba force GRUB to use LBA mode even for a buggy
BIOS
--recheck probe a device map even if it already exists

INSTALL_DEVICE can be a GRUB device name or a system device filename.
____________________________________________

So now I have absolutely no idea of what to do. Can someone please help me? I have so far not shut down my computer or rebooted for fear of a this kernel screwing up the boot. PLEASE HELP!


Last edited by maestro52; 02-01-2004 at 07:42 PM.
 
Old 02-01-2004, 07:45 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
The configuration file is either called grub.conf or menu.lst (as in lowercase L). It should be in the /boot/grub directory unless you have a wierd install of grub. Sometimes it is also linked into /etc on some distributions.
 
Old 02-01-2004, 09:26 PM   #3
maestro52
Member
 
Registered: Aug 2003
Location: Texas
Distribution: Fedora 9
Posts: 177

Original Poster
Rep: Reputation: 30
Question Thankyou BUT??

You have only answered part of my question. It is very good to know that it is supposed to be menu.(small L)st, but what about the problem with the instructions for /sbin/grub-install? I did that first and it went like this,
__________________________________________________________________________
[root@localhost linux]# /sbin/grub-install
bash: /sbin/grub-install: No such file or directory
__________________________________________________________________________

Then I tried,
__________________________________________________________________________
[root@localhost linux]# /usr/sbin/grub-install
install_device not specified.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

-h, --help print this message and exit
-v, --version print the version information and exit
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-shell=FILE use FILE as the grub shell
--force-lba force GRUB to use LBA mode even for a buggy
BIOS
--recheck probe a device map even if it already exists

INSTALL_DEVICE can be a GRUB device name or a system device filename.
________________________________________________________________________

Neither of the above worked. So what am I supposed to do now. Is it perhaps not necessary to do the grub-install with mdk9.2?

If I must do the grub-install, how do I do it?

 
Old 02-01-2004, 10:42 PM   #4
NewtonMan
LQ Newbie
 
Registered: Oct 2003
Location: Wichita,KS
Distribution: Slackware, CPUBuilders
Posts: 25

Rep: Reputation: 15
just # vim /etc/grub.conf

you can edit and point another line to your new kernel. there is an examle at the top of the conf file. also i like to use the list from http://www.newtolinux.org.uk/wiki/in...20own%20kernel

to run myself through a recompile

if this isn't clear enough i'll try to walk you through it a little more
 
Old 02-01-2004, 11:49 PM   #5
maestro52
Member
 
Registered: Aug 2003
Location: Texas
Distribution: Fedora 9
Posts: 177

Original Poster
Rep: Reputation: 30
Exclamation Sounds great, BUT!

You are using SLACKWARE, I am using Mandrake. Mdk does a lot of things differently. I am not having a problem with my compile itself. IT WORKED!

In MDK they have the grub config file renamed as menu.lst.

I have established that info three times now. The point is ONLY this, and I will reword it slightly due to the compile instructions you referred me to.

First: MDK requires that IT WE USE LILO (after we input new info to lilo) WE MUST do a lilo at the command prompt to cause lilo to rebuild itself with the new information from the new compile and input.

However, there is no information about what to do with grub!!

The compile instructions I have tell me to input info inot the grub config, even the instructions you referred me to tell me to input new info in the grub config, bUT THAT IS menu.lst in Mandrake 9.2.

BUT THAT IS NO PROBLEM!!

The problem is that the first instructions mention the necessity to do a grub-install and I think it is assuming I do not already have it installed. Mandrake iso comes with it already installed and I AM USING IT.

The instructions you referred me to say nothing about a grub-install. So is it or is it not necessary for some kind of grub-install to be done FOR MANDRAKE? If so, HOW?
 
Old 02-02-2004, 01:44 PM   #6
NewtonMan
LQ Newbie
 
Registered: Oct 2003
Location: Wichita,KS
Distribution: Slackware, CPUBuilders
Posts: 25

Rep: Reputation: 15
if you'll notice i also use CPUbuilders, which is derived from redhat, like a brother to mandrake so to speak. but your right i use another distro, i obviously have no clue. have fun figureing it out then.
 
Old 02-02-2004, 02:30 PM   #7
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
Ok....

grub does not, if properly installed, require you to run anything after you change the configure file, no matter what distro you run. That is a lilo thing because lilo installs the boot configuration to the boot sector. Grub can actually access the partition the menu.lst file is on and read it, which is exactly how it was intended to work. So edit the file, reboot, and have fun.

grub-install is only to be done the FIRST time you install grub on a machine.

Last edited by jtshaw; 02-02-2004 at 02:31 PM.
 
Old 02-02-2004, 04:59 PM   #8
maestro52
Member
 
Registered: Aug 2003
Location: Texas
Distribution: Fedora 9
Posts: 177

Original Poster
Rep: Reputation: 30
Lightbulb jtshaw ??

This may sound like a stupid question, but with all the confusing thinngs I have been reading I just want to be safe.

I am truly happy to know that I can trust grub to pretty much pick up things on it's own. However, you mentioned, "So edit the file, reboot, and have fun."

Should I understand that to mean I should remove the new kernel info I placed into the grub menu.lst and THEN reboot?


Another question!

I did all that I mentioned and then rebooted (I became impatient...a serious problem I have) . When the boot menu came up it had my new kernel on the list of kernels, but it stated it could not find the new kernel file. I chose the old kernel and went in to investigate and found that the vmlinz for my new kernel and the System.map for my new kernel were not in the boot as they should have been.

I managed to get the vmlinuz and System.map entry for my new kernel, but am am trying to be a little more patient for skilled information this time. So I thought I would let you know what I have done and see if everything is ok for reboot.

FIRST:
It says, **"make a new link to the new kernel"**
ln -s /usr/src/linux-x.x.x /usr/src/linux (before the kernel config)

Which I did not have to do since mdk had already done so.

Then: (after mrproper and the kernel config), it says to make dep
change Extraversion in the makefile
make clean
make bzmage
make modules
make
make modules_install
Then/part 2: It says to;

Remove the following links:
rm -rf /boot/System.map
rm -rf /boot/vmlinuz

Then copy the newly created kernel and system.map to /boot
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-x.x.x
cp /usr/src/linux/System.map /boot/System.map-x.x.x

Make the new links:
ln -s /boot/vmlinuz-x.x.x /boot/vmlinuz
ln -s /boot/System.map-x.x.x /boot/System.map

(I did all of the above again)

Next remove existing initrd.img file:
rm -rf /boot/initrd.x.x.x.img

..And create the new one:
/sbin/mkinitrd /boot/initrd-x.x.x.img x.x.x
(Note: )
The last set of x.x.x is the eqivalent to your new kernel version and it looks to /lib/modules for that version.

I did all of the above and somehow the new vmlinuz and System.map were not input into the boot, even though the old ones were removed.

As I said I did mange to get the new vmlinuz and System.map in the boot and then I input info into the grub menu.lst and also input info into lilo.config (to be safe), but everytime I do a lilo at the command prompt it tells me there is no /boot/vmlinuz and I see it there right this moment.

So my final questions are what do I do about the lilo part and do I actually remove the new kernel entry from the menu.lst?


I sure do hope you will forgive this apparent stupidity, but I am really trying to learn. So I appreciate all your help.


 
Old 02-02-2004, 05:14 PM   #9
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 66
Where are you getting all this information from? My suggestion is to always keep your old kernel until you are sure the new one boots. I name my system.map file system.map.<kernelversion> and I name my kernel image vmlinuz-<kernelversion>. Whenever I make a new kernel I always keep the old known good one around in case I made a mistake, because trust me, they happen.

You don't need both grub and lilo. Grub and Lilo are designed to do the same thing, pick one and go with it. I recommend grub because it is easier to configure, and if you make a mistake you can type commands into to boot any kernel on your hard drive at boot up. There are some great docs at www.gnu.org/software/grub if you want more information on it.
 
  


Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting Newly Compiled Kernel binarybob0001 Linux - General 2 11-20-2005 04:06 AM
newly compiled kernel, boot fails class_struggle Linux - Newbie 2 07-30-2004 09:10 AM
Newly compiled kernel behaves as if it was the old one? grayFalcon Linux - Software 4 06-03-2004 04:52 AM
uh-oh; boot problem in newly compiled 2.6.0 kernel with GRUB tombomb300 Linux - Newbie 10 01-28-2004 11:58 AM
Problem with newly compiled 2.4.22 kernel Xero720 Slackware 2 09-06-2003 12:23 PM


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