View previous topic :: View next topic |
Author |
Message |
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Oct 30, 2002 4:04 pm Post subject: OK, I admit I've screwed up my MBR... (I think) |
|
|
When I try to boot windows 200, I get thefollowing error..
NTLDR is missing
Press any key to restart
Windows is on one partion on /dev/hda or (hd0, 0)
I tried
rootnoverify (hd0,0)
chainloader +1
and
rootnoverify (hd0,0)
makeactive
chainloader +1
neither work.. when I installed grub I used
root (hd1, 0) #Since my boot is on /dev/hdb
setup (hd0)
quit
From the posts I've been reading, I think that I've overwritten my MBR, and that was a Bad Thing As far as windows 2000 is concerned...
So... I think that what i need to do is restore my windows partition, and somehow issue the commands set grub up agan with the commands
root (hd1, 0)
setup (hd1)
if that is what I need to do, how do I go about doing this without a complete re-install of gentoo?
I'm a linux newbie, battling my way into linux literacy =).. And yes, I did try searching the forums before posting this, but the information I received was kind of fragmented and this is the best I could put together before asking the questions... Hope one day I can help back and answer other ppl's q's =)
Josh. |
|
Back to top |
|
|
rommel Veteran
Joined: 19 Apr 2002 Posts: 1145 Location: Williamsburg Virginia
|
Posted: Wed Oct 30, 2002 4:11 pm Post subject: |
|
|
windows is on one partition of hda? how bout posting your partition table showing how you have installed windows and linux. |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Oct 30, 2002 4:12 pm Post subject: |
|
|
How do I post my partition table? do you want my fstab file? (I can copy parts out by hand since my computer is offline...) |
|
Back to top |
|
|
rommel Veteran
Joined: 19 Apr 2002 Posts: 1145 Location: Williamsburg Virginia
|
Posted: Wed Oct 30, 2002 4:18 pm Post subject: |
|
|
no wait......i think i read it too fast
you want to installl grub to the first hard drive so root (hd0,0)...then setup should point to the / partition of your linux install.
i would be guessing but probably the / of your linux is (hd1,2) , this would be hdb3...making hdb2 swap and hdb1 your /boot
you can repair the win2k installation using the windows cd and then reinstall grub using a grub floppy or if you dont have that use the iso you installed gentoo from
and yeah teh fstab would show your linux partitioning , but not windows unless you have included it to access it through linux. |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Oct 30, 2002 4:26 pm Post subject: |
|
|
rommel wrote: | no wait......i think i read it too fast
you want to installl grub to the first hard drive so root (hd0,0)...then setup should point to the / partition of your linux install.
i would be guessing but probably the / of your linux is (hd1,2) , this would be hdb3...making hdb2 swap and hdb1 your /boot
you can repair the win2k installation using the windows cd and then reinstall grub using a grub floppy or if you dont have that use the iso you installed gentoo from |
My partitions are set up as thus..
/dev/hda
/dev/hda1 fat32 all of the disk.
/dev/hdb
/dev/hdb1 boot ext2 100 MB
/dev/hdb2 swap 1024 MB
/dev/hdb3 reiserfs 5GB it's my home
/dev/hdb4 reiserfs the rest (about 14GB) reiserfs
my gentoo linux boots fine right now..
I could not setup root on hd0 since it couldn't find /boot/grub/stage1 then.. I had to set root to hd1 instead..
***EDIT*** that shoudl be root to hd1,0 instead... the location of my boot partition so it could find stage 1.
***END EDIT***
my question is, if I pointed setup to the / (or boot partition I think makes more sense) on my /dev/hdb, and my computer (I think every computer does this) boots from the MBR which is on /dev/hda, then wouldn't my boot process just ignore grub?
Josh. |
|
Back to top |
|
|
s003apr Apprentice
Joined: 04 Oct 2002 Posts: 162
|
Posted: Wed Oct 30, 2002 6:53 pm Post subject: |
|
|
you need to overwrite the Master boot record. That was not a mistake.
If when booting the computer you are given the grub boot menu or prompt then you did in fact overwrite the MBR.
It also shouldn't matter where you setup grub, and once again, as long as you are getting the grub menu, then you must have set this part up correctly.
This means that the problem is specific to finding the NT loader (NTLDR). I'm not sure what the NTLDR is exactly (it may be the bootloader or something subordinate to the bootloader.)
You've probably already figured the following out:
from www.fsf.org/manual/grub-0.92
Quote: |
Load another boot loader to boot unsupported operating systems
If you want to boot an unsupported operating system (e.g. Windows 95), chain-load a boot loader for the operating system. Normally, the boot loader is embedded in the boot sector of the partition on which the operating system is installed.
Set GRUB's root device to the partition by the command rootnoverify (see rootnoverify):
grub> rootnoverify (hd0,0)
Set the active flag in the partition by the command makeactive5 (see makeactive):
grub> makeactive
Load the boot loader by the command chainloader (see chainloader):
grub> chainloader +1
+1 indicates that GRUB should read one sector from the start of the partition. The complete description about this syntax can be found in Block list syntax.
Run the command boot (see boot).
However, DOS and Windows have some deficiencies, so you might have to use more complicated instructions. See DOS/Windows, for more information. |
You may want to check this out:
www.fsf.org/manual/grub-0.92 |
|
Back to top |
|
|
s003apr Apprentice
Joined: 04 Oct 2002 Posts: 162
|
Posted: Wed Oct 30, 2002 7:03 pm Post subject: |
|
|
Quote: | my question is, if I pointed setup to the / (or boot partition I think makes more sense) on my /dev/hdb, and my computer (I think every computer does this) boots from the MBR which is on /dev/hda, then wouldn't my boot process just ignore grub? |
Not really sure what your asking but:
If you look in /boot/grub, you'll see a stage1 and a stage2. My understanding is that stage1 is what overwrites the MBR and it then uses stage2
so essentially when you say root (hdX,Y) you are telling it where the /boot is and where stage2 is, when you say setup (hdX), you are telling it to write the to the MBR of hdX
but if you don't want to use grub as the primary bootloader then I believe you can tell it to setup (hdX,Y), which would write it to the boot sector of that particular partition. |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Oct 30, 2002 7:12 pm Post subject: |
|
|
Thanks for the manual link, I'll go there now and read up... I can't really mess with my system right now cause I'm compiling X and KDE, but I'll report back on how things went tomorrow =) |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Oct 30, 2002 7:19 pm Post subject: |
|
|
I looked into the manual, and the only hints it gave were for systems where windows was not installed on the first drive//partition...
In my case, windows is already installed on the first drive//partition.
The only thing I will try next time I reboot is to move makeactive after chainloader +1.
That is the only thing that I can see would make a difference =( The rest I've already tried, except the map since my windows is on /dev/hda1...
As a last resort I am going to try and hide all of my /dev/hdb partitions from windows as well...
Josh. |
|
Back to top |
|
|
rommel Veteran
Joined: 19 Apr 2002 Posts: 1145 Location: Williamsburg Virginia
|
Posted: Wed Oct 30, 2002 7:30 pm Post subject: |
|
|
well i dont think you have to do that , i have win2k on sda and then gentoo on a raid 0 array across sdb ,sdc , sdd
when i installed grub i installed root to the win2k drive sda since its hd0 and thats where grub wants to be...then i ran setup to hd1 which is where grub is actually installed on the /boot partition of gentoo (sdb1)
so if you run root (hd0,0) and setup (hd1) what happens?EDIT: uuuggg...sorry i'm an idiot...i just ran the installation from a grub floppy again...its root (hd1,0) and setup (hd0), atleast thats whats working for me with win2k on my first hard drive and linux on the second.
Code: | default 0
timeout 30
splashimage=(hd1,0)/boot/grub/splash.xpm.gz
title=Gentoo Kernel 2.4.19-r9
root (hd1,0)
kernel /boot/bzImage root=/dev/md0 hdc=scsi vga=788
title=Linus Kernel 2.4.19
root (hd1,0)
kernel /boot/bzImage.old root=/dev/md0 hdc=scsi vga=788
title=Windows 2000 Professional
root (hd0,0)
chainloader +1
|
this is my grub menu.lst
Last edited by rommel on Wed Oct 30, 2002 7:46 pm; edited 1 time in total |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Oct 30, 2002 7:44 pm Post subject: |
|
|
WEll, if I ran root hd(0,0) it said that Image1 could not be found..
I did find /boot/grub/Image1 and it said it found it on hd(1,0).. so I set root to exist there.
Then I ran setup on hd0 since I thought you were required to do that to have grub boot up your computer...
the setup hd1 is what I think I should have done, so it doesn't overwrite the boot sector on hd0.. but then I had s003apr tell me that overwriting the master boot record was the correct course of action...
I'm thoroughly confused =)
But right now my computer is compiling X and KDE... is it safe to ctrl C and resume later? If so I can test out what you suggested right now...
Josh. |
|
Back to top |
|
|
rommel Veteran
Joined: 19 Apr 2002 Posts: 1145 Location: Williamsburg Virginia
|
Posted: Wed Oct 30, 2002 7:53 pm Post subject: |
|
|
well i didnt help any with the confusion , so i appologize for that....but you want grub to overwrite the mbr and you want to use it to load the win2k ntldr. |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Oct 30, 2002 8:53 pm Post subject: |
|
|
For anyone following this post, my plan of action is to find my win2k cd and try repairing tomorrow and then reinstall grub by booting off the livecd...
Thanks for everyone who's help me so far.
Josh. |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Oct 30, 2002 8:54 pm Post subject: |
|
|
For anyone following this post, my plan of action is to find my win2k cd and try repairing tomorrow and then reinstall grub by booting off the livecd...
Thanks for everyone who's help me so far.
Josh. |
|
Back to top |
|
|
|