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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I need to reinstall my windows Parititon (Because Windows has too many problems and you always have to reinstall to fix it) and if I do this my grub file will be gone so I need to know how do you reinstall GRUB?
To reinstall grub run /sbin/grub-install /dev/hda. That will install grub into the mbr of the primary master drive ( hda ). Remember to make a boot disk so that you can boot back into linux after reinstalling windows. I got the info for reinstalling grub here .
OK I check the GRUB file and all the stuff that was listed before is still there? But what I did was I re install the grub on my kernel 2.4.17 cause none of the grub files was listed but is listed on my redhat kernel 2.4.9-39 so I never tried reinstall Windows YET......
You might be able to get linux to boot up by passing some information to grub. It needs to know where its files are and where the kernel is located and the name of the kernel.
I'll use my system as an example. I don't have a separate /boot partition, so I'll tell grub where my root ' / ' partition is. If you have a separate /boot partition, tell grub what that partition is. My root partition is hda6. Grub calls that hd0,5. My kernel name is ' vmlinuz '. With this information, I can tell grub what it needs to boot linux.
I would run the following commands at the grub prompt:
Great!!! Now let's see if we can get it to boot up completely.
To answer your last post, grub.conf is a symbolic link and the red flashing letters indicate that the link is broken.
First, you need to look into the /boot/grub folder and see if you see a file named menu.lst or grub.conf. The file will hold the configuration information that grub needs to boot. Once you find it, fix the broken link by first running rm /etc/grub.conf
and then running either ln -s /boot/grub/menu.lst /etc/grub.conf
or ln -s /boot/grub/grub.conf /etc/grub.conf
Now run grub in a terminal. Run the same root command that you used to boot into linux.
Then run setup (hd0)
The (hd0) part will install grub in your mbr. After running setup, it will print out some information. You'll need to copy from the line that looks something like this: Run "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2"
The part you want is between the " ". ( install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 ). Copy this to the command line and to the end of it add this: (hd?,?)/etc/grub.conf. It'll look like this: install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 (hd?,?)/etc/grub.conf
The question marks in the line are to be replaced by the same numbers you used in the root line that you used to boot linux. Then hit Enter to run the install command. Now, run quit and you're done installing grub. You'll want to check the contents of your menu.lst or grub.conf files to make sure the information is correct. If it is, then reboot.
Ok I dont have a folder in etc/boot?
then i went and did part 1 rm /etc/grub.conf I remove my old grub.conf file
did part 2 ln -s /etc/boot/grub/menu.lst /etc/grub.conf
Part 3 didnt work
Then tells me Running "install /grub/stage1 d (hd0) (hd0)1+22 p (hd1,0) /grub/stage2 grub/grub.conf" "error 15 file not found"
This is from my grub.conf file when I use my rescue disk to look inside it
OK. I noticed that I had made a mistake in my post. You were supposed to look in the /boot/grub folder. Look in there to see if the menu.lst or grub.conf file is in there.
From the information in your grub.conf file, is this how your system is set up? You have linux installed on the primary slave ( hdb ). Your root ' / ' partition is hdb2 and you have a separate /boot partition hdb1. Is this correct?
I need some information. What do the root and kernel lines look like that you type in to boot into linux? When you run ls /boot do you see a folder named grub? What is the complete path to your grub.conf file that you looked inside for the two lines listed in your last post? Does your grub.conf have only those two lines in it?
Ok I get my grub to come up now. And I always could see the grub folder in boot but not if I boot into my kernel2.4.17 the red fashing grub.conf file was in the etc folder but I guess that worked cause I can get it to come up now. Thx
But for a reference how do you reinstall grub?
Last edited by Alinuxnoob; 04-07-2002 at 05:27 PM.
When you say that you got grub to come up, do you mean you got the splash screen to show up? Are you able to boot into windows?
The grub folder should be in the /boot folder. When you do an ls /boot/grub, you should see the grub files like stage1, stage2, and grub.conf. If grub.conf is there, you can fix the symbolic in the /etc folder. Do ls -l /etc/grub.conf. If it lists the file grub.conf, then run rm /etc/grub.conf and then run ln -s /boot/grub/grub.conf /etc. That should fix the broken link.
To reinstall, boot up linux and then run:
The root= line needs to have the partition where grub's files are located. In my case, mine are on the root ' / ' partition. So, I would use hd0,5. Yours is on the separate /boot partition. So, you would use hd1,0. The setup line is where you tell it to install grub's boot loader. If you use hd0, that would put into the mbr of the primary master drive hda.
I don't know why when you boot using your kernel 2.4.17 you can't see the grub folder in the /boot folder.