LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-08-2008, 02:43 PM   #1
wombat53
Member
 
Registered: Jun 2005
Location: Australia
Distribution: Linux linux01 3.9.5-301.fc19.x86_64
Posts: 179

Rep: Reputation: 30
Unhappy "Move" from Grub loader to WIN NT bootloader?


Hi
I have a recently installed Fedora Core 9, located on the second disk of a 2 disk machine. WIN occupies the first, and Linux the second disk. I use GRUB as the bootloader. How can I find out on which disk the GRUB bootloader resides? As I recall when installing, you are given the option of which disk to use, and are encouraged (by anaconda) to use the one on which Lx is installed.

If this is the case, then is the WIN MBR retained, unchanged?

Is it possible to painlessly revert to using the WIN NT bootloader, and use it to present Lx as an OS option?

In the past I did this with a widely documented but perhaps outdated method: copy the first 512 bytes of the Lx boot partition (DD command): then copy that file to a floppy. Boot WIN, copy the floppyy file to the C:\ directory, and finally add a simple one line entry in boot.ini file pointing to that Lx file. With this clumsy - but effective - method, one could use the WIN NT loader to present Lx as an option, leaving the MBR in place.

I'm asking because my Linux is "experimental", a sandbox, for learning, and if the Lx or Grub should get corrupted in some way and didn't come up, my WIN would also be unavailable. Or so I believe.

Thanks for taking to time to read this
George
 
Old 08-08-2008, 03:24 PM   #2
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 9,189

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
The method you described to boot from windows will work and here is a site describing it in detail. This won't work w/vista as it is a different bootloader entirely.

http://www.linux.com/articles/113945

Which drive to you have set to boot first in the BIOS? If it's the drive w/Linux on it, your windows mbr should be unchanged. If your first boot drive is the drive w/windows, that's where Grub stage1 is, the mbr. Grub has stages and stage1 is a 512 byte file that goes in the mbr, the stage2 contains the majority of the bootloader and is in the /boot/grub directory of your Linux partition. If it is the latter case, you can use your windows CD and do "fdisk /mbr" (unless you are using vista) to repair your windows drive mbr to just boot windows. Then you can use the info at the site above to boot Linux from windows. That being said, Grub is a lot easier.

Good Luck!
 
Old 08-08-2008, 07:09 PM   #3
wombat53
Member
 
Registered: Jun 2005
Location: Australia
Distribution: Linux linux01 3.9.5-301.fc19.x86_64
Posts: 179

Original Poster
Rep: Reputation: 30
yancek - Thanks
You ask: "Which drive to you have set to boot first in the BIOS? If it's the drive w/Linux on it, your windows mbr should be unchanged."
How do I indentify this boot drive, i.e which drive is set to boot first? As indicated, I went along with anaconda's recomendation, to have the bootloader on the Linux install disk (the second disk drive (SDB)).
And if it is indeed the second drive, the drive with the LINUX installation, are you saying my WIN MBR remains unchanged, and that I will not have to run FDSIK/MBR?
If this is indeed the case, what I don't understand is how I "stop" GRUB from starting first, such that the WIN NT bootloader comes up first. It seems that some manual change must be made somewhere...presumably to change the disk from which to "boot first in the BIOS"?
George
 
Old 08-08-2008, 07:46 PM   #4
wombat53
Member
 
Registered: Jun 2005
Location: Australia
Distribution: Linux linux01 3.9.5-301.fc19.x86_64
Posts: 179

Original Poster
Rep: Reputation: 30
yancek - further to my reply above, using a hex editor on the first sector of the first drive (C) (presumably the MBR) I see all kinds of NT, NTFS related stuff.
George
 
Old 08-09-2008, 11:14 AM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 9,189

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
First, are you able to boot both xp and Fedora?
Changing the disk to boot first can be done in several ways. The easiest is entering BIOS on boot up. If you haven't done this before, when you boot, you will see a message at the bottom of the screen for a few seconds which tells you which key to hit to enter Setup/BIOS. This could be DEL, F2,etc. you'll just have to watch. There will be a "Boot Sequence" somewhere, it may be under a heading such as Advanced BIOS Settings. These vary depending upon motherboard/chipset manufacturer. The settings you can change also depend upon the motherboard.

You can also change cable attachments on your hardrive or jumper settings, one for master, one for slave to set one to boot first (master). If you know these, you should have your answer.

Without getting into a lot of info about how Grub works, I think the simplest way to find out (assuming you are now able to boot both windows and Fedora) where the stage1 of Grub is would be to physically disconnect the windows drive and see if Fedora boots. Then do the reverse to see if windows boots.

Been trying to find a Grub command which would give the answer but have been unsuccessful. The "find /boot/grub/stage1" command just tells which partitions have the stage1 file which doesn't tell which is in the mbr. With a dozen Linux OS's you should get a dozen positives on this command. Maybe someone else will post with a simpler way/command?

Based on your last post, I think your windows drive mbr still has the windows bootloader info.

Last edited by yancek; 08-09-2008 at 11:17 AM.
 
Old 08-09-2008, 01:47 PM   #6
wombat53
Member
 
Registered: Jun 2005
Location: Australia
Distribution: Linux linux01 3.9.5-301.fc19.x86_64
Posts: 179

Original Poster
Rep: Reputation: 30
yancek - "First, are you able to boot both xp and Fedora?
yes, sure, without problems, when the machine comes up, GRUB gives me its menu.
Let me restate I have no doubt disk 1 (of 2) has WIN (XP) in its MBR, and I am pretty sure I responded "yes" to installer's question of where do I want to boot from, the default being where Lx was installed (disk 2). In fact, upon installation, I tentatively responded Disk 1, and it asked me if I was sure I wanted the bootloader on a disk other than where Lx was installed, from which I can only conlude my setup is the default, and that to have done it otherwise (which would presumably have clobbered WIN MBR) was somehow "unnatural"..not done.
I entered setup, and the options are from drive C:, from CD, and third (USB, whose device I was not familar with). There was not a 4th option. The BIOS hardware display indicated knowledge of two hard disk drives, listing with WIN disk first, the Lx disk second.

Interstingly, when I examined the first sector I had copied from /DEV/SDB1, the boot partition on the Lx drive, it was all zeros, unlike the WIN MBR which had some human redable material.

My new question is how POST and boot processes "find" GRUB to launch upon boot, insofar as boot seems not to go straight to sector zero of the first hard disk drive looking for an OS (or bootloader, I guess). I always thought that was the boot sequence.
I'm a bit reluctant to reset to jumper setings etc.
Thanks
George
 
Old 08-09-2008, 02:38 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 9,189

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
I agree with your assessment of the boot sequence, the mbr is on sector 1, cylinder 0, head 0, sector 1, with File Allocation Table on sector 0.
Since both systems are working it's more a curiosity. Anyhow, try logging on to Fedora in a terminal as root, enter grub to get the prompt (grub>), then type: geometry (hd0) (hit enter key)
type: geometry (hd1) (hit enter key)

This will give you the partition number and also the filesystem type.
Go to the /boot/grub folder and open a file called device.map. Should look like this:
(hd0) /dev/hda
(hd1) /dev/hdb
(fd0) /dev/fd0

This should tell you which drive Grub sees as first. Grub may not see the drives the same way BIOS does.
I think the simplest and most certain way to see if your windows mbr/bootloader are intact is to disconnect the cable to the Fedora drive. No changing jumpers needed.

Seems a little weird?

When you used your hex editor to look at the mbr on sda, did it look something like this? This is supposed to be a copy of mbr of xp install:

Absolute Sector 0 (Cylinder 0, Head 0, Sector 1)
0 1 2 3 4 5 6 7 8 9 A B C D E F
0000 33 C0 8E D0 BC 00 7C FB 50 07 50 1F FC BE 1B 7C 3.....|.P.P....|
0010 BF 1B 06 50 57 B9 E5 01 F3 A4 CB BD BE 07 B1 04 ...PW...........
0020 38 6E 00 7C 09 75 13 83 C5 10 E2 F4 CD 18 8B F5 8n.|.u..........
0030 83 C6 10 49 74 19 38 2C 74 F6 A0 B5 07 B4 07 8B ...It.8,t.......
0040 F0 AC 3C 00 74 FC BB 07 00 B4 0E CD 10 EB F2 88 ..<.t...........
0050 4E 10 E8 46 00 73 2A FE 46 10 80 7E 04 0B 74 0B N..F.s*.F..~..t.
0060 80 7E 04 0C 74 05 A0 B6 07 75 D2 80 46 02 06 83 .~..t....u..F...
0070 46 08 06 83 56 0A 00 E8 21 00 73 05 A0 B6 07 EB F...V...!.s.....
0080 BC 81 3E FE 7D 55 AA 74 0B 80 7E 10 00 74 C8 A0 ..>.}U.t..~..t..
0090 B7 07 EB A9 8B FC 1E 57 8B F5 CB BF 05 00 8A 56 .......W.......V
00A0 00 B4 08 CD 13 72 23 8A C1 24 3F 98 8A DE 8A FC .....r#..$?.....
00B0 43 F7 E3 8B D1 86 D6 B1 06 D2 EE 42 F7 E2 39 56 C..........B..9V
00C0 0A 77 23 72 05 39 46 08 73 1C B8 01 02 BB 00 7C .w#r.9F.s......|
00D0 8B 4E 02 8B 56 00 CD 13 73 51 4F 74 4E 32 E4 8A .N..V...sQOtN2..
00E0 56 00 CD 13 EB E4 8A 56 00 60 BB AA 55 B4 41 CD V......V.`..U.A.
00F0 13 72 36 81 FB 55 AA 75 30 F6 C1 01 74 2B 61 60 .r6..U.u0...t+a`
0100 6A 00 6A 00 FF 76 0A FF 76 08 6A 00 68 00 7C 6A j.j..v..v.j.h.|j
0110 01 6A 10 B4 42 8B F4 CD 13 61 61 73 0E 4F 74 0B .j..B....aas.Ot.
0120 32 E4 8A 56 00 CD 13 EB D6 61 F9 C3 49 6E 76 61 2..V.....a..Inva
0130 6C 69 64 20 70 61 72 74 69 74 69 6F 6E 20 74 61 lid partition ta
0140 62 6C 65 00 45 72 72 6F 72 20 6C 6F 61 64 69 6E ble.Error loadin
0150 67 20 6F 70 65 72 61 74 69 6E 67 20 73 79 73 74 g operating syst
0160 65 6D 00 4D 69 73 73 69 6E 67 20 6F 70 65 72 61 em.Missing opera
0170 74 69 6E 67 20 73 79 73 74 65 6D 00 00 00 00 00 ting system.....
0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
01B0 00 00 00 00 00 2C 44 63 .....,Dc

I'm curious about this so if you resolve it, could you please post how? Appreciate it.

Last edited by yancek; 08-09-2008 at 02:41 PM.
 
Old 08-09-2008, 04:59 PM   #8
wombat53
Member
 
Registered: Jun 2005
Location: Australia
Distribution: Linux linux01 3.9.5-301.fc19.x86_64
Posts: 179

Original Poster
Rep: Reputation: 30
yancek - grub's device map indicates:
(hd0) /dev/sda
(hd1) /dev/sdb

I erred before: I was looking at sector zero, which you have said is FAT: I always thought it was the MBR. (It has the distinguishing marker of "...NTFS" starting as the 4th ASCII chracter in the block).

Sector 1 has the distiguishing marker of characters "..N.T.L.D.R" starting the third character, and little else that is meaningful. It is different to what your dump indicates.

So, I'm unsure as to the fate on my WIN MBR, now.
George
 
Old 08-09-2008, 06:23 PM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 9,189

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
Whaat happened with the "geometry" commands I suggested in last post? If you run the geometry (hd0) you should see filesystem type ntfs if that is seen by grub as your first (windows) drive.

I think the surest way to determine if windows drive can boot on its own is to disconnect Fedora drive to boot windows.
 
Old 08-10-2008, 12:58 PM   #10
wombat53
Member
 
Registered: Jun 2005
Location: Australia
Distribution: Linux linux01 3.9.5-301.fc19.x86_64
Posts: 179

Original Poster
Rep: Reputation: 30
yancek - here is grub geometry listing
grub> geometry (hd0)
drive 0x80: C/H/S = 30401/255/63, The number of sectors = 488397168, /dev/sda
Partition num: 0, Filesystem type unknown, partition type 0xde
Partition num: 1, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type unknown, partition type 0x7

grub> geometry (hd1)
drive 0x81: C/H/S = 9732/255/63, The number of sectors = 156355584, /dev/sdb
Partition num: 0, Filesystem type is ext2fs, partition type 0x83
Partition num: 1, Filesystem type is ext2fs, partition type 0x83
Partition num: 2, Filesystem type unknown, partition type 0x82

where Part 0 on /dev/sda is a small DELL UTILITY partition pre-installed with the machine 8200 Series).
George

P.S For the sake of completeness, fdisk -l:

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfd478bc7

Device Boot Start End Blocks Id System
/dev/sda1 1 2 16033+ de Dell Utility
/dev/sda2 * 3 4846 38909430 7 HPFS/NTFS
/dev/sda3 4847 30401 205270537+ f W95 Ext'd (LBA)
/dev/sda5 4847 30401 205270506 7 HPFS/NTFS

Disk /dev/sdb: 80.0 GB, 80054059008 bytes
255 heads, 63 sectors/track, 9732 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1d93c117

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 25 200781 83 Linux
/dev/sdb2 26 9350 74903062+ 83 Linux
/dev/sdb3 9351 9732 3068415 82 Linux swap / Solaris
 
Old 08-11-2008, 12:35 PM   #11
wombat53
Member
 
Registered: Jun 2005
Location: Australia
Distribution: Linux linux01 3.9.5-301.fc19.x86_64
Posts: 179

Original Poster
Rep: Reputation: 30
yancek
Here's a very interesting URL
http://www.blogmanno.com/?q=node/9

"B) Using Windows XP

In Windows XP, you can uninstall GRUB as follows:

Boot from the Windows XP CD and press the "R" key during the setup in order to start the Recovery Console. Select your Windows XP installation from the list and enter the administrator password. At the input prompt, enter the command "FIXMBR" and confirm the query with "y". The MBR will be rewritten and GRUB will be uninstalled. Press "exit" to reboot the computer."

Seprately, for these purposes does it matter if one uses the WIN XP HOME CD (insofar as my WIN XP PROF is currently "not available". I am trying to retrieve it)
Thanks
George
 
Old 08-11-2008, 03:36 PM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 9,189

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
Your last post describes the standard method of fixing windows mbr. You can also use SuperGrubDisk to fix windows mbr (as well as Grub).

Your recent post of fdisk -l command output shows windows ntfs partition on sda2 and it is active/bootable. The geometry command shows the same partition (1) as windows with partition type 0x7 (that's windows).

So both Grub and Fedora see your windows drive as the first drive which would mean that part of Grub (stage1) is in the mbr of the first (windows) drive and points to the Fedora bootloader on sdb1, (hd1,0).

Simplest way to test this is to disconnect the Fedora drive and try to boot . Should be unsuccessful.

If you want your windowss mbr intact and want to boot from windows, the link in my first post describes how to do it in detail. This shouldn't be a problem and I believe that if you are currently able to boot both windows and Fedora, best left alone. Using an xp recovery cd or SuperGrubDisk should resolve any problems with booting you may have in the future.
 
Old 08-11-2008, 04:40 PM   #13
wombat53
Member
 
Registered: Jun 2005
Location: Australia
Distribution: Linux linux01 3.9.5-301.fc19.x86_64
Posts: 179

Original Poster
Rep: Reputation: 30
yancek - I want to to thank you for your time on this. I agree that the WIN disk is probably not currently bootable. Pls remind me re the two connectors on the HDD ribbon cable. Which connector connects to the master (HD0 - WIN), and which one the slave (HD1 - Lx)?
Thanks again
George
 
Old 08-11-2008, 04:56 PM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 9,189

Rep: Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987Reputation: 1987
Just disconnect the ribbon/sata cable from the back of the drive. Or just remove the cable from the power supply to the back of your drive.
 
  


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
Grub bootloader stops at "grub" at bootup i_lurve_linux Ubuntu 2 02-24-2007 10:12 AM
uninstall boot loader "Lilo" install "Grub" sethis Linux - Newbie 6 11-30-2006 10:32 AM
GRUB bootloader spits out "GRUB hard disk error" Crampedson Linux - Software 2 01-26-2005 07:34 PM
"Operating system not found", problem with the motherboard/GRUB Loader maybe?? brynjarh Linux - General 3 12-14-2004 03:17 PM
how to change "kernel arguments" in grub boot loader permanently stupid_guy Linux - Newbie 7 06-09-2003 11:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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
Open Source Consulting | Domain Registration