Linux - SoftwareThis 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
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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
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
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.
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
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:
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
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.
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
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
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.