LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-13-2005, 08:23 PM   #1
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,692
Blog Entries: 9

Rep: Reputation: 45
grub problem(s) ???


Just followed the instructions to upgrade my kernel (in gentoo).

Now I can't boot into the system - I just get dumped into a grub bash prompt i.e. grub>

I've had a good dig round but the only thing that I found to try is to do
Quote:
grub> root (hd0,0)
grub> setup (hd0)
Now I haven't got a clue as to what that does. I've managed to get a system to use - I'm using a kanotix live CD.

I have looked at the /boot partition and can see a grub.conf but that appears to be empty. There is also a grub.conf.bak which appears to be the previous grub.conf from before the kernel upgrade. Unfortunately I can't just copy one file to the other, as the kanotix is telling me that the system is read-only

Any advice/ideas/suggestions are greatly appreciated. This is the first time I've ever tried to do a repair/mend/rescue with a live CD so it's all rather over my head.

regards

John
 
Old 11-13-2005, 08:42 PM   #2
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
I boot from a grub floppy.......like so.....
Code:
grub> root (hd1,7)
grub> kernel /boot/vmlinuz root=/dev/hdb8 ro
grub> boot
 
Old 11-13-2005, 08:44 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Having an empty grub.conf would certainly cause such a problem.

There are many things to check.
1) when you upgraded the kernel, did you copy the compressed kernel image to /boot? There is already one there (probably called vmlinuz) so give the copy a name like vmlinuz<version number>.
2) copy the grub.conf.bak to grub.conf. You have most of the information you need in there, it just needs editing to name the new kernel image in /boot.
3) if gentoo used initrd.gz in /boot, make a new one for the new kernel, named as with vmlinuz<version number> above.
4) edit grub.conf to point to those two new files in /boot.

to be able to do the edit fron Kanotix, there is a way to remount a partition rw instead of ro. I don't remember the command off the top of my head. Search these boards; it's come up quite a few times before.

As far as the grub setup is concerned, grub> root (hd0,0) is correct only if gentoo is installed in the first partition of the first drive (hda1 in Linux terminology).

Posting your grub.conf and /etc/fstab might be of some help.
 
Old 11-13-2005, 08:57 PM   #4
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,692

Original Poster
Blog Entries: 9

Rep: Reputation: 45
Well I can't copy the grub.conf.bak to the grub.conf because I don't know how to do that with a live CD distro - I can look at the files, but the kanotix says that they're read only on the main installed system i.e. the kanotix is allowing me to look but not touch, because I can't boot into the main system to be able to do the copy thing.

There must be a way of doing this with a live CD I just can't work out what it is.

Because I've only to get in the once and I can the re-run the genkernel facility to re-compile the new kernel (or failing that, revert to the old one).

But how to do that through the live CD ???

regards

John

edit - is there any known way of making the grub> prompt show me the grub.conf (baring in mind that I can't actually get into the main system and the grub prompt just keeps telling me "unknown command" when I try stuff) as I can always just hand type in the info from the grub.conf.bak if I need too???

Last edited by bigjohn; 11-13-2005 at 09:09 PM.
 
Old 11-13-2005, 09:50 PM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
OK. Here's how to convince Kanotix to let you write to the Gentoo partition. Since it's now mounted ro, you need to open a term window, su to root if you're not root already, and give this command:

mount -o remount, rw /dev/hda1

(or wherever gentoo is installed). That should remount the partition rw, and you can then edit files and save them.
 
Old 11-13-2005, 10:11 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally posted by bigjohn
is there any known way of making the grub> prompt show me the grub.conf (baring in mind that I can't actually get into the main system and the grub prompt just keeps telling me "unknown command" when I try stuff) as I can always just hand type in the info from the grub.conf.bak if I need too???
Reading manuals can usually be a good passtime - the grub maual reveals the following;
Code:
configfile /boot/grub/grub.conf.bak
 
Old 11-14-2005, 07:57 AM   #7
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,692

Original Poster
Blog Entries: 9

Rep: Reputation: 45
Quote:
Originally posted by syg00
Reading manuals can usually be a good passtime - the grub maual reveals the following;
Code:
configfile /boot/grub/grub.conf.bak
Yes you are probably right syg00 - my problem has alway been with documentation - I don't understand what it's telling me more often than not i.e. I don't have the ability to take on the "technical mindset". I'm not an enthusiast, I consider myself "just" a user.

Also, on the occassions that these kind of problems occur, I'm presented with so many possibilities, invariably I choose the wrong one and mess things up further - I suppose I'm "a fitter, not a mechanic or an engineer".

Quote:
Originally posted by bigrigdriver
OK. Here's how to convince Kanotix to let you write to the Gentoo partition. Since it's now mounted ro, you need to open a term window, su to root if you're not root already, and give this command:

mount -o remount, rw /dev/hda1

(or wherever gentoo is installed). That should remount the partition rw, and you can then edit files and save them.
Ok, so I've managed to get into the system and have got too the stage where I've deleted all the references to the new kernel (too prevent confusion on my part), and also any older (take that too mean unnecessary, as I also had about 3 or maybe 4 much older kernels) ones.

I'm left with the previous working version and the one before that, both of which worked fine.

I've also copied the info across, so I have a complete grub.conf - which should, in theory, work.

It doesn't. I'm still back at square 1 inasfaras the system is dropping me back into the grub> prompt - I have managed to work out how to boot the system manually from there, but right now it doesn't matter what I do, I can't make it start grub properly. I've even unmerged it and then re-emerged it, just incase I'd messed the default settings in someway - but too no avail.

Perhaps you could advise me about how to correct that???

regards


John

p.s. bigriddriver - unusual choice of username. Do you actually drive a large rig?? If so which (size/weight/length etc as I myself, have a regular chair in a 44 ton 55ft volvo unit/semi setup - brand new this week so it still smells of cab cleaner/valeting spray)???
 
Old 11-14-2005, 09:28 AM   #8
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,692

Original Poster
Blog Entries: 9

Rep: Reputation: 45
OK, I'm pretty confident that this is about 90% sorted i.e. I've managed too sort the kernel upgrade. I've got the external modules sorted - alsa and the nvidia driver (currently posting this via the new kernel, with the nvidia splash having indicated it's working and listening to the Smiths brilliant "What difference does it make" via Amorak).

The second kernel compile, via the genkernel utility worked pretty well - the only confusion being that when it had finished doing it's thing, I was left with an empty grub.conf, but there was also a file called grub.conf~ now I have no idea what the ~ bit means, but I just copied it over to the grub.conf and that now seems to be OK

Quote:
default 0
timeout 20
splashimage=(hd0,0)/grub/splash.xpm.gz

title=Gentoo Linux (2.6.14-gentoo-r2)
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.14-gentoo-r2 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev
initrd /initramfs-genkernel-x86-2.6.14-gentoo-r2
#title=Gentoo Linux (2.6.13-gentoo-r5)
#root (hd0,0)
#kernel /kernel-genkernel-x86-2.6.13-gentoo-r5 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev
#initrd /initramfs-genkernel-x86-2.6.13-gentoo-r5
Now the problem seems to be with grub itself. It's still dropping me into the grub> prompt and I have to put in the boot info/kernel version manually.

So any advice/assistance on how to make it boot properly again would be received greatfully.

regards

John
 
Old 11-14-2005, 10:15 AM   #9
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
There seems to be a discrepancy in your grub.conf. You list root (hd0,0), but real_root=/dev/hda3 (which would be root (hd0,2) in grub lexicon).

Could you post the contents of /etc/fstab for comparison with grub.conf.

PS: I drive 18 wheelers; a variety of tractors (volvo, peterbilt, and freightliner mostly) with tanker trailers, augers, and dry vans. Rig length up to 68 foot, max weight without special permit 40 ton.
 
Old 11-14-2005, 10:39 AM   #10
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,692

Original Poster
Blog Entries: 9

Rep: Reputation: 45
Quote:
Originally posted by bigrigdriver
There seems to be a discrepancy in your grub.conf. You list root (hd0,0), but real_root=/dev/hda3 (which would be root (hd0,2) in grub lexicon).

Could you post the contents of /etc/fstab for comparison with grub.conf.

PS: I drive 18 wheelers; a variety of tractors (volvo, peterbilt, and freightliner mostly) with tanker trailers, augers, and dry vans. Rig length up to 68 foot, max weight without special permit 40 ton.
I "think" I've got it sorted. I was reading through the "plethora" of stuff here and found one that said about a similar problem - the answer to which I'd already tried about 3 or 4 times - but I figured WTF it can only not work again.

So after a quick
Code:
/sbin/grub-install /dev/hda
I did the test reboot and you could have knocked me down with a feather when the bugger booted properly.

As far as I can see (apart from the fact that it seems to work), your suggestion of a possible discrepancy, the stuff I read about grub and various bits of gentoo stuff, grub doesn't care about where the /boot partition/directory is i.e. hd0,0 as I have a seperate /boot partition but if it had been just a /boot directory within the / partition, then it would indeed have been hd0,2 as for the real_root=/dev/hda3, that is just something that the gentoo docs say about arguements that need to be passed to the kernel so that it knows where the "real_root" is, I've also had to use that when I was booting with lilo - So much too learn and so little time (and brains) to learn it!

regards

John

p.s. Good to know that theres other linux using professional drivers out there, apart from me and one of the blokes who works in my "yard" (who was responsible for getting me into linux in the first place). We (my employer/me/colleage) "do" bulk milk as part of a (nameless for self preservation) company aka "Big Milk" (we're talking 10's of billions of litres per annum). They (the bosses) are just finishing off changing our fleet from Mercedes to Volvo (back handers if you ask me). All maximum EU kerb weights - people do easily forget that milk is heavy. Got full certification for hazchems etc, but theres not much of that work in my area so you take what you can get to pay the bills!

At least they're "big boys trucks", not vans/pickups and other rubbish that "children" try to term "truck"! Dunno if you're interested, but you could always have a look here and you might get some of an idea of the crap "we" have to put up with over here!

Thanks for the assistance my friend, good luck and drive safe!
 
  


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
HDD problem, scancode problem and grub EJ_INSIDE Debian 2 07-15-2004 09:36 AM
problem with grub deNiro Debian 4 06-05-2004 10:54 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM
grub problem ianunderwood Linux - General 4 05-31-2003 05:45 AM
GRUB problem hfawzy Linux - Newbie 4 04-11-2003 12:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:46 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration