LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-26-2005, 05:56 PM   #1
thesalmon83
LQ Newbie
 
Registered: Feb 2005
Location: Chicago
Distribution: Fedora
Posts: 10

Rep: Reputation: 0
WinXP deleted my Grub


I had to install Fedora first and WinXP after, and I figured it would prompt me before modifying my MBR. but it didn't...

I don't re-install my linux because it took me a long time to get it to work as well as it was working. How can I just reinstall Grub so that I can load it again?
 
Old 03-26-2005, 06:09 PM   #2
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
Sure, if you can boot off a gentoo live cd:
Gentoo-Live-cd

Then mount all your linux partitions.
Code:
mount /dev/hda(x) /mnt/gentoo
mount /dev/hda(y) /mnt/gentoo/boot
mount -t proc none /mnt/gentoo/proc
swapon /dev/hda(z)
mount -t devfs none /mnt/gentoo/dev (edit: always do this!)
Where (x) is your root partition, (y) is your boot partition, and (z) is your swap partition.

Once this is done, you can chroot to /mnt/gentoo and run grub
Code:
chroot /mnt/gentoo /bin/bash
grub
Once you get to the grub prompt ("grub>"), just set it up like it was before. On my system, the setup is like so:
Code:
root (hd0,0)
setup(hd0)
quit
Then exit the chroot environment, unmount, and reboot with:
Code:
exit
swapoff /dev/hda(z)
umount /mnt/gentoo/proc
umount /mnt/gentoo/boot
umount /mnt/gentoo/dev (edit: always do this!)
umount /mnt/gentoo
reboot

Last edited by visaris; 03-26-2005 at 06:42 PM.
 
Old 03-26-2005, 06:12 PM   #3
thesalmon83
LQ Newbie
 
Registered: Feb 2005
Location: Chicago
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
is there a way to do it with my Fedora DVD?
 
Old 03-26-2005, 06:13 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
Just for clarity, you don't have to use a gentoo livecd, you can use any live cd which has grub on it, which is pretty much all of them...
 
Old 03-26-2005, 06:24 PM   #5
thesalmon83
LQ Newbie
 
Registered: Feb 2005
Location: Chicago
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
visaris, the information you gave me seems to be useful, but I don't know what devfs or chroot is :-/

Also, the link you gave me is for a 600+ MB iso file, but I'm reading that there's a smaller (about 50MB) Gentoo LiveCD for Rescue, would it serve the same purpose? I don't want to wait 2 hours or get lost in other software that comes with the whole distribution...

Last edited by thesalmon83; 03-26-2005 at 06:27 PM.
 
Old 03-26-2005, 06:33 PM   #6
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
You don't need to know what chroot is at this point, just copy visaris's commands verbatim. If you do want to find out what chroot does then see the manpage, but basically it just changes the '/' directory to somewhere arbitrary, in this case your already installed linux system.

And yes the minimal live cd should work, although I cannot guarantee it has grub on it (but I am sure it does...).

If you still have fedora install disks you can use disk 1 to boot your system and reinstall grub from there...

type 'linux rescue' from the cdrom boot prompt
 
Old 03-26-2005, 06:37 PM   #7
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
I'm a retard, there are a few changes I need to make to my directions. It doesn't matter if your distro uses devfs. All that matters is that gentoo does. Because you are booting off the gentoo cd, follow those directions _with_ the devfs parts.

chroot is a really neat command. What it does is pretend like your current linux environment no longer exists, and creates a new "sub-environment". The reason I tell you to use this is because you will boot up off the cd, and then once all your partitions are mounted right, you will "chroot" to your harddrive partition. This will create a new sub-environment that thinks it is running off of the harddrive instead of off the cd you just booted with. Once that has been done, any commands you type will be "running off" your harddrive. That way when you type "grub" and set up your boot loader again, it will be using all the same versions and executable files, etc that are included with your distro.

And yes, I think the minimal cd will work. It doesn't matter if the boot cd you use has grub; we will be using the grub that comes with _your_ distro. (chroot, remember?)

Last edited by visaris; 03-26-2005 at 06:40 PM.
 
Old 03-26-2005, 06:38 PM   #8
thesalmon83
LQ Newbie
 
Registered: Feb 2005
Location: Chicago
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
I do have the Fedora installation disc, it's just one a DVD.
When I start from it, it asks me to format or upgrade my installation before it asks me to install grub.

How can I install grub from it only?


I'm now downloading the minimal version of Gentoo LiveCD and I'll try booting with it soon.
 
Old 03-26-2005, 06:47 PM   #9
Nalorin
Member
 
Registered: Mar 2005
Location: C-eh?-N-eh?-D-eh?
Distribution: 2.6.11-1.14_FC3
Posts: 58

Rep: Reputation: 15
at the VERY first page (the black and red and blue one or whatever, where it tells you the options that you can use for the install instructions... it only stays like that for about 10-30 seconds, then automatically goes to the install gui for fedora.

so basically, if your computer is set to boot from cd:

1) turn on your computer with Fedora DVD in the drive...
2) AS SOON AS it loads the VERY First screen from off the dvd, type at the > "linux rescue" instead of "linux ide=nodma i8042.nomux etc.etc"
3) follow steps and bingo!


P.S. Thanks - it actually answered my question, which was the same !
 
Old 03-26-2005, 07:10 PM   #10
thesalmon83
LQ Newbie
 
Registered: Feb 2005
Location: Chicago
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
I booted with the Fedora Core DVD and typed "linux rescue", it went into Anaconda in rescue mode and told me that some file already exists and the whole system stoped and told me it was now ready to be turned off.

I'm having trouble getting Windows to recognize my CD burner in Nero for some reason, so I can't try the LiveCD.

Does anyone know a way around this?
 
Old 03-26-2005, 07:13 PM   #11
thesalmon83
LQ Newbie
 
Registered: Feb 2005
Location: Chicago
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
I remember a friend used to have a program on that loaded linux after clicking an icon on his desktop... does anyone know if this would help me? name of the program?
 
Old 03-26-2005, 07:35 PM   #12
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
I've never done this, but it may work.

http://www.tprthai.net/bootmgr.htm

Once you do get your burner working in windows/linux, do yourself a favor and burn that gentoo linux cd. There is nothing better than a bootable linux cd that just dumps you to a command prompt without any bullsh!t.
 
Old 03-26-2005, 08:28 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,350

Rep: Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908Reputation: 1908
Using the install DVD boot to rescue mode.
The root partition should be mounted to /mnt/sysimage.

Enter the commands:

chroot /mnt/sysimage
grub-install

This should reinstall grub. You will not need to add an entry for XP to the /etc/ grub.conf file

title windows or dos partition 2
rootnoverify (hd0,1)
chainloader +1

Change hd0,1 to match where your xp partition ID.
 
  


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
Dual boot WinXP/Debian, grub error booting WinXP ChemBot Linux - General 5 02-22-2007 05:13 PM
Dual-booting MEPIS and WinXP, I want Grub to default to WinXP jjf Linux - Newbie 8 01-19-2006 04:27 AM
deleted linux partition adn the boot loader was deleted also,now i have only gnu grub boris199 Linux - Laptop and Netbook 2 01-29-2005 05:53 PM
Problems w/Grub (WinXP, WinXP & SUSE) worldofaaron Linux - Newbie 12 01-24-2004 07:26 PM
i got RH8 & WinXP installed and properly working by GRUB. how can i reinstall WINXP? kublador Linux - Newbie 4 06-23-2003 01:00 PM

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

All times are GMT -5. The time now is 09:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration