Stuck at grub legacy prompt after boot.
Hi, I have CentOS 6 installed on my server and accidentally deleted the contents of /boot partition, so I d/loaded a CentOS LiveCD and booted from it.
I chrooted into /mnt/sysimage I created and mount -o bind the lvs that contain /usr and / respectively and I reinstalled grub grubby xen and the kernel with yum reinstall blah... /boot got populated again but /boot/grub/grub.conf was not created so I used one of my other server to mimic it of course changing the sd_LVM_LV= values to suit the other server's, when I reboot 'm stuck at the grub> prompt where I can type commands and I can certainly boot using: Code:
kernel /vmlinuz Apparently Grub is not reading my grub.conf which *IS* there indeed. I've read a zillion threads and forums but they take me nowhere. If anyone can help this n00b, thanks. |
Do the necessary backup once the server is up then reboot the server with the Redhat installation DVD. Choose the option "install or upgrade an existing system", it should fix your problem if you follow the upgrade properly. Do this at your own risk.
|
I don't know if this will be of any help, but long ago, I downloaded to my collection of helpful docs, a howto that explains how to restore grub-legacy. Unfortunately, I didn't document the source, so I don't know to whom the credit should go, but it's saved me many, many times. Anyway, heres an example taken from that howto:
Code:
title Red Hat Linux (2.4.18-14) |
Quote:
As soon as my brother gets to the office and can turn on the server (remote location) I'll try that. In the meantime I'd like to know what's the file that grub looks for when it goes into stage2 grub.conf or menu.lst?, I have them both, menu.lst being a symlink to grub.conf. Also as I have my root filesystem on LVM I have this cryptic line. Code:
title CentOS (3.2.6-0.choon.centos6.x86_64) Code:
Probing devices to guess BIOS drives. This may take a long time. Thanks for taking the tme to answer. |
I think menu.lst is the standard name for the file, although Red Hat and its derivatives use grub.conf and simlink it with menu.lst.
I stay away as far away from lvm as I can, which is a good thing given that I have absolutely no knowledge regarding how to set it up or what a valid gurb.conf/menu.lst configuration should look like. Someone more knowledgeable than I will have to help you decipher that one. |
I've no knowledge on LVM or Grub.conf. I've Arch and Opensuse on my system plus a boot partition for chainloading that i set up, and all three run Grub Legacy, and none have a grub.conf to my knowledge.
Here's my tip: In your first post, you stated it was a "/boot partition" In your menu.list, are you setting root to the right place? Quote:
I don't know the details behind your partitions, but that line needs to point to your root partition. This could likely be your problem. Sometimes the simple things get overlooked. |
Thank you very much for your advise I'll try it tomorrow because server is remote and I started it manually and it's running so I don't wanna screw it unless there's someone there to type in commands for me.
Thank you very very much. |
Quote:
The root (hd?,?) is for the grub root directory. The root=???? keyword on the kernel command is what points the kernel to your Linux root directory. Totally separate concepts. @dgonzalezh are you running under Xen or not ?. If you booted as per post #1, it doesn't look like Xen. Perhaps go here, and let us see the RESULTS.txt so we can see what installed where. |
1 Attachment(s)
Quote:
That's clear for me, fortunately I corrected some problems now I'll show you what I have did and the system boots into grub prompt and I can start he OS from there issuing Code:
kernel /xen.gz I did this, to try to recover Code:
grub> find /grub/stage1 I even tried find /grub/grub.conf and it worked, found the file at (hd1,0) Quote:
Quote:
After looking at it I see that Grub is installed on both /sda and sdb and my grub stuff is located at sbd. Here's some info that the script didn't get OS: CentOS 6.2 x86_64 XEN: 4.1.3-rc2-pre I see that everytjing looks like it's fine now, but as I said the server is miles away from me and as it's late now no one there to issue commands if I screw things up, but I guesss I'm a hair away from getting the server back to normal operation. Thanks for your replies, that's why I use GNU/Linux, you're the best people. |
Looks like the last bit you need is to do the setup to hd0, not hd1. The BIOS will (in all likelihood) be set to boot that.
|
Quote:
Code:
[root@xen ~]# cat /boot/grub/device.map Again apreciate your insight and help. |
Quote:
|
Quote:
Code:
grub> root (hd1,0) Thanks. |
All times are GMT -5. The time now is 08:23 PM. |