LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   GRUB Reinstall (http://www.linuxquestions.org/questions/ubuntu-63/grub-reinstall-604015/)

MikRose 12-02-2007 09:02 PM

GRUB Reinstall
 
I had Ubuntu CE (7.04) on my primary drive, then updated it to 7.10. I received a CD from friends and couldn't view it as quickly as I wanted to by investigating Linux, so I took out the hard drive and installed another one identical to the first (IDE, 80G). I installed XP Home on that drive, used Windows Media Player to view the CD, then decided to put both drives in the computer. I put XP first, since Linux has no problem being a Slave, but didn't get a choice of systems when I rebooted. (bios is set to CD, IDE0, IDE1) I have tried all the posts I can find about using "fdisk -l", and then GRUB, root (hd1,0), then setup (hd0), but on re-boot still no luck with option of systems. Since I've played around with things, I'm ready to simply take out the XP drive and just use the Linux drive. How do I get the GRUB back on the drive since it won't boot? I have a SUPER BOOT I burnt, and a live CD for 7.04, but do not want to lose any information on the drive, just reinstall the GRUB. I'm cross-eyed from reading posts, and realize I've probably missed how easy this should be. At least I learned how to fix the mbr on my XP when I lost that temporarily! Thanks

FredGSanford 12-03-2007 01:39 AM

If you can use your Ubuntu CD to do an "upgade" rather than an install. Go through the process the same as an install, only don't choose install! Choose upgrade instead. It will give you the opportunity to install packages. just skip this step and it should take you to where you can update or reconfigure the boot loader. Redo this part, installing Grub to the MBR. Make sure you also have Windows in there as a boot choice. Follow through to the end and reboot. I've done this before, different distro, in a similar situation and it worked. Let us know how you come out. I hope this helps...

atanwar 12-03-2007 05:59 AM

I am not sure about ubuntu... but try booting with recovery options by booting using ubuntu CD and then use grub-install with required options. it will update MBR on the disk.
check man pages for grub-install.

i myself got struck with similar problem few years back... it helped me to install grub.

ronnybob 12-03-2007 10:43 AM

Grub Reinstall
 
What Happened to me was I removed the batt. from my box, and when I replaced it, it lost all it's memory, then when I booted an error 17 came up,and it would not boot. Go into the BIOS and boot area and see if the CD-rom is first and primary HDD is second, then stay in the boot area not the booting line up and check all hardware in this order, your primary HDD that has the O/S on it should be first,save and exit, try that and see what happens.

pennyg 12-03-2007 12:27 PM

SuperGrub
 
I haven't needed to redo my grub but this <http://supergrub.forjamari.linex.org/> claims to have what you need.

Don1500 12-03-2007 01:05 PM

Quote:

Originally Posted by MikRose (Post 2978022)
I had Ubuntu CE (7.04) on my primary drive, then updated it to 7.10. I received a CD from friends and couldn't view it as quickly as I wanted to by investigating Linux, so I took out the hard drive and installed another one identical to the first (IDE, 80G). I installed XP Home on that drive, used Windows Media Player to view the CD, then decided to put both drives in the computer. I put XP first, since Linux has no problem being a Slave, but didn't get a choice of systems when I rebooted. (bios is set to CD, IDE0, IDE1) I have tried all the posts I can find about using "fdisk -l", and then GRUB, root (hd1,0), then setup (hd0), but on re-boot still no luck with option of systems. Since I've played around with things, I'm ready to simply take out the XP drive and just use the Linux drive. How do I get the GRUB back on the drive since it won't boot? I have a SUPER BOOT I burnt, and a live CD for 7.04, but do not want to lose any information on the drive, just reinstall the GRUB. I'm cross-eyed from reading posts, and realize I've probably missed how easy this should be. At least I learned how to fix the mbr on my XP when I lost that temporarily! Thanks

Here is a "How To" from the Ubuntu Forum:
http://ubuntuforums.org/showthread.p...GRUB+REINSTALL
If you can do this you're OK, if not then, like I did, you need to reinstall Ubuntu.

thomas.hedden 12-03-2007 01:22 PM

> I put XP first, since Linux has no problem being a Slave,
> but didn't get a choice of systems when I rebooted.
It appears to me that the problem is that your computer is
booting off the XP drive first, which doesn't have GRUB,
so it won't give you a choice of OS. If you boot the Linux
drive first, then you'll get GRUB and then you should be
able to choose the OS. (First you will have to update GRUB
so that it knows about the XP installation. Some of the
other replies have suggested ways to do this. Also see:
http://ubuntuforums.org/archive/index.php/t-158075.html
If XP doesn't want to be on a slave drive, then you could
also try making it a master on the second IDE channel,
instead of a slave on the first one. But I would definitely
have the Linux installation with GRUB be the first to boot.

w0orw 12-03-2007 06:56 PM

Here is the fix of last resort in case you need it -
I have an old AMD which I use for testing various O/S and hardware configs.
I have two hard drives installed. I run the red and yellow wires to each
hard drive thru a double pole toggle switch. This permits me to activate
either or both hard drives. It is not necessary to switch the IDE cables.
Just remember not to play with the switches unless the PC is off.

It works for me....

MikRose 12-04-2007 12:34 AM

Grub Install
 
Thank you all for the suggestions! FredgSanford = I don't have a choice for "upgrade" on any of my Linux CDs.
Atanwar = I have done that many times. I can find the stage1, then try to move it to other drive, but so far no luck.
ronnybob = Done that and also experimented with all possibilities I can think of. Now Boot is CD/IDE-0/IDE-1.
pennyg = I have burned the Supergrub on a CD, but when I have it in and boot to CD, I get all of the information to boot in DOS and then the screen stops for me to enter something after (A>) I think it is, but I don't know what to type in and Help doesn't help!
Don1500 = I've done most of the steps listed, but will go through them again. thomas.hedden = I have CD first boot, then XP (IDE-0), then Linux (IDE-1). Whether I boot to IDE 0 or IDE 1 first, there is no Grub that shows up. I think I deleted it from Linux drive per my original post and then overwrote it when used fixmbr on XP drive. Getting Grub back on Linux, in order to move it to XP's mbr is my latest issue. But at this point, if I can just get Grub back on the Linux drive, I may just boot to it all the time unless I need an XP function. I have switched the Hard Drives around on the cable also with no luck. Also, have tried many solutions listed in the website you gave, but will filter through the ones I haven't. wOorw = I need Grub on a disk first, then I can wire a switch if necessary.

pjeeanah 12-04-2007 06:56 AM

I might suggest that you remove the XP disk and put the disk containing linux only on your machine. Then you can boot with the ubuntu CD and select repair. I think with this you can get the linux mbr back on the disk. After getting the linux mbr you can get the linux to boot. You can then add your XP disk and update your menu.lst in linux to have an option for XP.

TeddyB 12-04-2007 11:51 AM

Using Knoppix for system rescue.
 
Ok, I have been looking into a similar issue myself, due to the fact that I currently have a corrupt Windows partition on a system that also houses Debian. As anyone that has played with duel boot knows, Windows doesn't play nice. Now I don't know how the following will be affected by your multiple drives situation, but this is how I aim on dealing with the issue.

Your un-installation of Grub should only be in the MBR itself, the Program should continue to exist on your system. So my approach is to take a Knoppix disk ( http://knopper.net/knoppix/index-en.html ), or if you have a preferred Live CD, and boot that.

The beauty of a Live CD is that it loads a completely functional copy of Linux from RAM. You can then set your Partitions to writable (if need be), and use the command 'chroot' to change the recognized root file system for the existing instance of Linux. i.e. What your doing is running the Knoppix OS in your RAM but using your local root file system. You can then mount your additional file system partitions if your file system is divided as such (i.e. /home /usr/ etc.)

(More information on this can be found here: http://troubleshooters.com/linux/kno...pix_rescue.htm )

Once you have your file system mounted. You should be able to call up the GRUB Command Line Interface from your shell. The following help file discusses this in detail.

( http://www.gnu.org/software/grub/manual/grub.html )

I think that both sections 3.3 as well as 15.2 & 15.3 have a bearing on this. Section 3 mentions the best way of installing Grub is though use of a Boot Disk, With instructions for creating both Floppy and CD-Rom Boot Disk. 3.3 Talks of using the grub-install command, and I tend to Favor section 15, Invoking GRUB natively and using the instructions in 3.2

This all seems kinda daunting and with my ultra-limited experience, I don't dare suggest the method you should use to reinstall grub. But the information is all there for you to research, and maybe one of our resident Experts will be able to clarify it if need be.

I hope this helps;
TeddyB

MikRose 12-04-2007 04:04 PM

Thanks....pgeeanah = I have several CDd of Linux Ubuntu versions: Knoppix, 5.10, 6.06, 7.04, CE, (and the Linux drive I'm trying to access again had CE updated to 7.10), but none of them have the option to "repair". That would be great if I could find one that did. One of them allows me to type in "rescue", but when I try to follow the commands I have no positive results! TeddyB = I just tried having only the Linux drive in earlier, and tried to "find /grub/stage1" using most of my CDs, but none could find the file. So, if I investigate further with what you tell me about getting grub back on the drive. I am just so chicken about losing my files, and not real familiar with using "commands", that it takes a step by step approach, and much of what I've read leaves some of the obvious steps out (at least to them) and I run into a brick wall. Of course my medications don't help...! I'll let you know.

TeddyB 12-04-2007 07:20 PM

I hope it helps Mike,

Grub's Stage Files should be located in /usr/lib/grub/i386-pc under your Linux File System.

Duck2006 12-05-2007 11:56 AM

Stage1 is in
/boot/grub/stage1
in ubuntu

Spirals 12-07-2007 05:10 PM

reinstalling grub - on Debian
 
The following fix worked for me aster a lot of reading and experiment. I ran into this problem after I suffered a corrupted XP installation. I have always installed XP on C: drive (hda1) and Linux (various flavors) on the hdd2 (with hdd1) for swap and hdc1 to hdc4 for "mounted on" working/data partitions.
To restore grub: I booted Debian running in ram, from CD and (presuming your Linux installation on the hdd2 is OK) type: grub <hit return>, on the grub command line type: root (hd2,1) <hit return>,then type: setup (hd0,0) <hit return>, finally type: quit <hit return>. Your finished. Shutdown and fter a cold reboot (power off) I get the grub menu up. Its that simple! Hope this helps.(dja.)


All times are GMT -5. The time now is 09:09 AM.