Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-12-2007, 12:47 AM   #1
LQ Newbie
Registered: Jan 2007
Location: Just outside Redmond, WA
Distribution: RHEL4
Posts: 1

Rep: Reputation: 0
Question How do I recreate a working grub.conf ???

I'm running RHEL4 - breaking grub.conf - so I can learn how to fix it.

I was told to purposely break Linux to learn about it. I want to learn about grub.conf and what happens when I corrupt it purposely. So I vi'd it and changed root to DAVE.

Obviously the system does not boot - but here is my question.

If/when it gets corrupted, how do you guys recreate it?
at the prompt grub> I looked at help and it did not clue me in.

Some article I found discussed reinstalling it with
/sbin/grub-install /dev/hda or (boot device)
But this does not work for me at the grub> prompt.

Here is what I am doing -
So when I reboot and I interrupt the boot process at STAGE2 I open the grub> command prompt and type:
/sbin/grub-install (hd0,0) -- returns unrecognized command.

no luck.
So I try tip #2 at the grub> prompt typing:
setup (hd0)
quit - unrecognized command.

At this point I'm feeling like a tool and I decided that maybe I need to reboot with a CD and run - linux rescue
That didn't work either.

How EXACTLY do I get to the prompt at which running the command
/sbin/grub-install --- will actually work?

Old 01-12-2007, 01:02 AM   #2
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
Generally you have to boot with a linux live CD or use your CD to boot into rescue mode. You'll get to a bash terminal w/ rescue mode, not a grub> prompt. With a liveCD, you'll of course be able to open a terminal.

If you want to learn a lot about grub, do the things in this post. You'll be able to use the grub prompt to boot anything (and thus repair your existing grub).

I would not necessarily say you have to break linux to learn it. I prefer to read through config files (always making a backup first) and then do some subtle changes until I understand what I'm doing. Then as I get the hang of it, try something more bold...

Or if you really want to learn linux, they say to use Slackware. Everything is mucking through config files to get it working. No gui helpers at all...
Old 01-12-2007, 03:13 AM   #3
Registered: Apr 2006
Location: Place for all OpenSource
Distribution: OpenBSD 4.1, FC5
Posts: 50

Rep: Reputation: 15
Yep just enter the liveCD u have, and choose rescue option
Mount the RH partition,
#mount -t <file-system> /dev/sd~ /mnt/<wateva_the_dir>
then u need to chroot-ing the mounted RH dir
#chroot /mnt/wateva
and then u need a lil fdisk
#fdisk -l
see for the last time that your RH partition (I assume /dev/sda1)
edit the menu.lst or grub.conf
#vi /etc/grub/menu.lst
and then re-install the grub
#/sbin/grub-install /dev/sda1
then reboot and a lil pray



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
Recreate xorg.conf xaphalanx Fedora 2 04-18-2006 02:53 PM
can some fc4 user mail his grub.conf and tell me how can i make this grub read this amolgupta Linux - Software 1 03-15-2006 04:04 AM
Is lilo.conf file format is same for grub.conf? Chundo Linux - Newbie 1 01-30-2006 06:21 PM
create lilo.conf or grub.conf through commands newpenguin Linux - Software 1 11-28-2003 08:22 PM
lilo.conf and grub.conf no read access shanenin Linux - Software 1 10-02-2003 03:53 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration