View Full Version : How to install GRUB on the MBR
gonzalo76
26th March 2004, 05:03 AM
GRUB (GRand Unified Bootloader)
Briefly, a boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to an operating system kernel software (such as Linux). The kernel, in turn, initializes the rest of the operating system (e.g. a GNU system).
GNU GRUB Homepage
http://www.gnu.org/software/grub/
Problem
"There is not a boot manager screen at all, it just boots right into windows but GRUB boot window does not appear. I cannot figure out to access fedora, I do not have a boot disk and need to know if there is someway to boot into fedora"
"I forgot to install GRUB, I didn't install GRUB in the MBR, I chose to install GRUB on the first track on the partition where I installed Fedora but that was not an active primary partition".
Solution
You have to install GRUB on the MBR (Master Boot Record). To do this just follow this steps:
(First of all, enter your BIOS setup and in BOOT Sequence window choose to boot with CDROM first.)
1) Boot with your Fedora Core Installation CD 1.
2) Type "linux rescue" at the prompt.
3) Answer the questions about keyboard and language.
4) Tell the rescue mode to use your proper partition to mount (the one that you want to get booted into)
5) When you come to the console prompt type: chroot /mnt/sysimage
6) Type grub
7) Set the GRUB's root device to the partition containing the boot directory like this:
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
I have Windows 98 in hd0,0 ; Windows XP in hd0,1, Fedora Core /boot partition in hd0,2 and Mandrake /boot partition in hd0,6. So in my case the command should be: > root (hd0,2)
If you are not sure which partition actually holds this directory, use the command 'find' like this:
grub> find /boot/grub/stage1
This will search for the file name '/boot/grub/stage1' and show the devices which contain the file.
Once you've set the root device correctly, run the command 'setup'.
8) Then, run the command setup
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists....... no
Checking if "/grub/stage1" exists....... yes
Checking if "/grub/stage2" exists....... yes
Checking if "/grub/e2fs_stage1_5" exists....... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"....... 15 sectors are embedded
succeded
Running "install /grub/stage1 (hd0) (hd0) 1+15 p (hd0,2)/grub/stage2 /grub/grub.conf....... succeded
Done
This command will install GRUB boot loader on the Master Boot Record (MBR) of the first drive.
9) Type quit
grub> quit
GRUB is now in the MBR.
10) Finally, you'll have to edit your /boot/grub/grub.conf, for example whith nano:
> nano /boot/grub/grub.conf
(/etc/grub.conf or /boot/grub/grub.conf or /boot/grub/menu.lst, they are the same file) This file has the boot partitions of the disk/s.
11) Restart your PC without the Fedora Core CD 1 Installation.
My grub.conf
default=0
timeout=30
splashimage=(hd0,2)/grub/splash.xpm.gz
title GNU/Linux Fedora Core 1 (2.4.22-1.2188.nptl)
root (hd0,2)
kernel /vmlinuz-2.4.22-1.2188.nptl ro root=LABEL=/ hdc=ide-scsi hdd=ide-scsi apm=off acpi=on vga=788
initrd /initrd-2.4.22-1.2188.nptl.img
#title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
#root (hd0,2)
#kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
#initrd /initrd-2.4.22-1.2174.nptl.img
title GNU/Linux Mandrake 9.2
kernel (hd0,6)/vmlinuz root=/dev/hda8 devfs=mount hdc=ide-scsi resume=/dev/hda9
initrd (hd0,6)/initrd.img
title Microsoft Windows 98 SE & XP Pro
rootnoverify (hd0,0)
chainloader +1
List of commands,
default=0
My default boot system is, of course, Fedora. :)
timeout=30
Fedora will boot in 30 seconds if you don't touch anything.
splashimage=(hd0,2)/grub/splash.xpm.gz
Generally the splash image is in your /boot partition. In my case, hd0,2 is where I have the image.
title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
The name of your OS that will appear in your menu at starup, you can write anything you want.
root (hd0,2)
This is your /boot partition specifies which partition contains your Linux kernel image. So "root (hd0,2) tells GRUB that the kernel is on the 3rd primary partition of my first hard disk (I have two), in my case (hd0,2).
kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
Tells GRUB where to find your kernel, my kernel version is 2.4.22-1.2174, you have to type your kernel version.
rhgb
Red Hat Graphical Boot
apm=off acpi=on
I had to add 'apm=off acpi=on' to my kernel parameters to get power-off to work properly.
initrd /initrd-2.4.22-1.2174.nptl.img
Tells where your init ramdisk image is located.
title Microsoft Windows 98 SE & XP Pro
As I said, I have Windows 98 in hd0,0 and Windows XP in (hd0,1).
rootnoverify (hd0,0)
rootnoverify tells GRUB to boot from the Windows partition, but not to attempt to mount it.
(hd0,0) is where Windows XP puts the boot.ini to boot into Windows 98 and XP.
chainloader +1
chain-load is the mechanism for loading unsupported operating systems by loading another boot loader. It is typically used for loading DOS or Windows.
chainloader tells GRUB to chain to Windows' boot loader which will start Windows.
Other options you can use:
map
If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one.
Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. Here is an example:
grub> map (hd0) (hd1)
grub> map (hd1) (hd0)
This performs a virtual swap between your first and second hard drive.
Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won't work.
makeactive
Set the active partition on the root disk to GRUB's root device. This command is limited to primary PC partitions on a hard disk.
title Windows 98 SE
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
rootnoverify (hd1,0)
chainloader +1
hide
Hide the partition partition by setting the hidden bit in its partition type code. This is useful only when booting DOS or Windows and multiple primary FAT partitions exist in one disk.
unhide
Unhide the partition partition by clearing the hidden bit in its partition type code. This is useful only when booting DOS or Windows and multiple primary partitions exist in one disk.
Explanation and examples of the hide and unhide commands
If you installed more than one set of DOS/Windows onto one disk, they could be confused if there are more than one primary partitions for DOS/Windows. There is a solution if you do want to do so. Use the partition hiding/unhiding technique.
If GRUB hides a DOS (or Windows) partition, DOS (or Windows) will ignore the partition. If GRUB unhides a DOS (or Windows) partition, DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition.
Here's how to create two installations of Windows, hda1 and hda2 or (hd0,0) and (hd0,1), using the commands hide and unhide.
For Windows 98 SE "My Entry":
title My Entry
unhide (hd0,0)
hide (hd0,1)
rootnoverify (hd0,0)
makeactive
chainloader +1
For Windows 98 SE "Family Entry"
title Family Entry
unhide (hd0,1)
hide (hd0,0)
rootnoverify (hd0,1)
makeactive
chainloader +1
I did not have to use the 'hide' or 'unhide' command 'cause Windows XP, 2000 or NT have a boot manager (boot.ini) included. So, I only had to point where this boot.ini is. In my case, Windows XP copies this boot.ini where Windows 98 is installed, (hd0,0)
You should definitely use the 'hide' or 'unhide' command if you have,for example, two installations of Windows 98 or ME.
If everything went just fine, voila, GRUB now becomes your main boot manager for your multi OS system. :)
GRUB and Linux Partitions
First of all, GRUB requires that the device name be enclosed with ( ). Please, note that the partition numbers are counted from zero, not from one.
(hd0) in GRUB = is hda in Linux
Here, 'hd' means it is a hard disk drive. The first integer '0' indicates the drive number, that is, the first hard disk.
(hd1) in GRUB = is hdb in Linux
The first integer '1' indicates the drive number, that is, the second hard disk.
(hd0,1) in GRUB = is hda2 in Linux
This expression means the second primary partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk.
(hd0,4) in GRUB = hda5 in Linux
This specifies the first extended partition of the first hard disk drive. Note that the partition numbers for extended partitions are counted from '4', regardless of the actual number of primary partitions on your hard disk.
(hd0,5) in GRUB = hda6 in Linux
This is the first logical unit of the extended partition of the the first hard disk.
(hd1,0) in GRUB = is hdb1 in Linux
This is the first primary partition of the second hard disk.
Related HOWTO
How to edit your grub.conf
http://www.fedoraforum.org/forum/showthread.php?s=&threadid=996
Good Luck !
:)
Ug
26th March 2004, 09:54 AM
Very comphrensive!
gonzalo76
1st April 2004, 05:08 PM
GRUB images files
GRUB consists of several images: two essential stages, optional stages called Stage 1.5, and two network boot images. Here is a short overwiew of them.
'stage1' This is an essential image used for booting up GRUB. Usually, this is embedded in an MBR or the boot sector of a partition. Because a PC boot sector is 512 bytes, the size of this image is exactly 512 bytes. All 'stage1' must do is to load Stage 2 of Stage 1.5 from a local disk. Because of the size restriction, 'stage1' encodes the location of Stage 2 (or Stage 1.5) in a block list format, so it never understand any filesystem structure.
'stage2' This is the core image of GRUB. It does everything but booting up itself. Usually, this is put in a filesystem, but that is not required.
'e2fs_stage1_5'
'fat_stage1_5'
'ffs_stage1_5'
'jfs_stage1_5'
'minix_stage1.5'
'reiserfs_stage1.5'
'vstafs_stage1.5'
'xfs_stage1_5'
These are called Stage 1.5 because they serve as a bridge between 'stage1' and 'stage2', that is to say, Stage 1.5 is loaded by Stage 1 and Stage 1.5 loads Stage 2. The difference between 'stage1' and '*_stage1_5' is that the former doesn't understand any filesystem while the latter understands one filesystem (e.g. 'e2fs_stage1_5' understands ext2fs). So you can move to Stage 2 image to another location safely, even after GRUB has been installed.
While Stage 2 cannot generally be embedded in a fixed area as the size is so large, Stage 1.5 can be installed into the area right after and MBR, or the boot loader area of a ReiserFS or a FFS.
'nbgrub' This is a network boot image for the Network Image Proposal used by some network boot loader, such as Etherboot. This is mostly the same as Stage2 but is also sets up a network and loads a configuration file from the netwrok.
'pxegrub' This is another network boot image for the Preboot Execution Environment used by several Netboot ROMs. This is identical to 'nbgrub', except fro the format.
Creating a GRUB boot floppy
To create a GRUB boot floppy, you need to take the files 'stage1' and 'stage2' from the image directory, and write them to the first and second block of the floppy disk, respectively:
Caution: This procedure will destroy any date currently stored on the floppy. On a UNIX-like operationg system, that is one with the following commands:
Open a Terminal, become root with 'su' command and type:
cd /usr/share/grub/i386-redhat
dd if=stage1 of=/dev/fd0 bs=512 count=1
dd if=stage2 of=/dev/fd0 bs=512 seek=1
Installing GRUB on a floppy disk
# /sbin/grub-install /dev/fd0
# /sbin/grub-install /dev/fd0
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
# this device map was generated by anaconda
(fd0) /dev/fd0
(hd0) /dev/hda
Everytime you install a new kernel you'll need to update your floppy disk running "/sbin/grub-install /dev/fd0" again.
gmac0518
29th July 2004, 06:06 PM
WOW. :cool: :cool: This how to is so clear! Way better then the Grub manual! Finally solved my problem. Not an easy task with all the misinformation and unclear directions (for a linux newbie) on the net.
Other instructions say to edit the grub.conf file. No problem, where the heck is it? And what do I use to edit it at a command line? Every other instruction and suggestion I found assumed I knew a good bit about linux. Pretty silly, since most people looking for such help probably don't know much about linux.
This how to answered all my questions and didn't produce 5 more for each answered questions.
I simply cannot praise this enough. :cool: And cuss the writers of the other how-tos! :mad: :mad:
gonzalo76
30th July 2004, 03:57 AM
Hi gmac0518, thank you for your reply.
I´m glad that my mini howto helped you !!!
kondor
3rd August 2004, 03:34 PM
Great info Gonzalo. I haven't needed it yet but have saved both posts for future "snarls." If you aren't already employed as a tech writer, you should give consideration to taking on the task of writing a HowTo book, etc.
I also am envious since you are located in a city where you can follow Orquesta Contratiempo in person!
Bandoneon forever!
ghaefb
3rd August 2004, 03:37 PM
Really good how-to. I'm impressed.
gonzalo76
11th August 2004, 03:04 AM
Thank you kondor and ghaefb for your nice comments. :)
imdeemvp
11th August 2004, 03:06 AM
nice to see you back gonzalo....hey are also helping moderate in chile linux page?
sythiel
25th September 2004, 02:26 PM
I had a similar problem but even if I followed all the steps you were suggesting I wasn't able to solve it. My problem is that in the eight stage it doesn't say me
Checking if "/boot/grub/stage1" exists....... no
Checking if "/grub/stage1" exists....... yes
Checking if "/grub/stage2" exists....... yes
Checking if "/grub/e2fs_stage1_5" exists....... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"....... 15 sectors are embedded
succeded
Running "install /grub/stage1 (hd0) (hd0) 1+15 p (hd0,2)/grub/stage2 /grub/grub.conf....... succeded
Done
but
Checking if "/boot/grub/stage1" exists....... yes
Checking if "/boot/grub/stage2" exists....... yes
Checking if "/boot/grub/e2fs_stage1_5" exists....... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"....... 15 sectors are embedded
succeded
Running "install /boot/grub/stage1 (hd0) (hd0) 1+15 p (hd0,6)/boot/grub/stage2 /boot/grub/grub.conf....... failed
Error 12: Invalid device requested
Done
How can I solve it? Find /boot/grub/stage1 returns to me the value (hd0,6)
Thanks in advance for the help
I'm a newbie and help will be really appreciated
j0e
7th October 2004, 05:49 AM
This did not help me. All of the commands that you told me to do in grub did not work. It kept giving me unrecognized string errors; I don't think I have a /boot partition, though I thought I made one when I set up FC3. How can I do this now?
imdeemvp
7th October 2004, 07:30 AM
This did not help me. All of the commands that you told me to do in grub did not work. It kept giving me unrecognized string errors; I don't think I have a /boot partition, though I thought I made one when I set up FC3. How can I do this now?
what are you trying to do? can you be more specific?
elgreco
10th October 2004, 02:34 PM
Hey Gonzalo,
Very good Tutorial!! :D
But if you want to find the Partition containing the Boot Directory under FC2
you have to type:
grub>find /grub/stage1
NOT
grub>find /boot/grub/stage1
All the other steps worked exactly the way you wrote in your Tutorial
Greetings
El Greco
Mad Cow
12th December 2004, 11:56 PM
Excellent! Very good help in many aspects of GRUB.
However, I'm having one small problem. My setup isn't addressed here (I didn't really expect it to be). It's an odd one, but I hope I can get it working. My Windows partition is /dev/sda1. How do I get GRUB to see that? Right now it's set up to load from (hd0,0), and I get a 'NTLDR not found' problem. But if I try to boot from anywhere else, GRUB'll tell me that the command was wrong or the partition wasn't there or something like that...
So GRUB is on the MBR of /dev/hda, where Linux also resides. Windows is on /dev/sda. How do I make it all work?
marcos
18th December 2004, 10:59 PM
Great job, gonzalo76!!!
As gmac0518 has said, your tip is even better than the official grub manual. I've lost so much time searching for help around this issue that I will keep your text in a safe place. It's the better help I've found. Thanks!!!
chriss
2nd June 2005, 11:45 PM
Hi there Gonzalo!
If a Nobel Prize for writing quality Linux documentation existed, I'm quite sure you would be a serious candidate! You got me on the road again, after upgrading FC1 to FC3 completely messed up the boot process of both my linux + windows machines!
Thanks very, very much!
LLS
18th June 2005, 01:07 AM
This post should be a sticky. It has saved my rear over and over.
pravvish
28th June 2005, 10:42 AM
hi gonzalo can you help me to remove the grub master boot record from the harddisk ,please .
tuxdaemon
28th June 2005, 10:44 AM
I'm accustomed to the installation proceedure of Grub and Lilo, but for those who arn't, you've done a good job eliminating most of the endtrails most Grub installation documentation howtos provide. Thanks for your post.
sgtbob
3rd July 2005, 12:53 AM
gonzalo76 - I've got a problem that when I restart FC4, all I see is 'grub' on the screen and I can only insert Disc 1, ctrl-alt-del and start over. I am unable to type anything at this point and I can not get the system to boot. I want to install FC4 on my 2nd slave 30 GB HDD with Win XP remaining on the primary 120 GB HDD. I've been able to follow you in your suggested fix and can get all the way to step 10. However, when I type 'quit' at step 9, the system goes to 'SH....# or something similar and then I'm stumped - how do you '...edit /boot/gtrub.grub.conf ....with nano...??? I have reinstalled FC4 10+times, and FC3 about 6 but can not get beyond the grub screen. I hate to do a complete WINDOWS format for both HDD...... and start all over.... At present, I have no access to either system and the PC is a dead duck.... I'm working out of a 2nd older PC with FC4 as the only OS on it. Any suggestion on this '...nano...' problem I can't seem to decipher.
Bob
LLS
3rd July 2005, 04:23 PM
Can you boot from cd and boot winxp into the repair console?
Type help and look for the cmd fixboot, and repair the boot partition on the xp drive if the os is still there.
Remove cd and reboot and if you are successfull and back into xp, look at disk management and see if the machine is seeing both drives in the correct config ie master-boot.
Right click my computer/advanced/startup and recovery/settings/edit and copy the contents to a txt file and post back here. If I see a post with the result I will try and comment further and you also might want to look at this post
http://forums.fedoraforum.org/showthread.php?t=62102
Whatts
17th July 2005, 06:04 PM
I'm new to Linux, I recently installed FC4 on a seperate HD (I disconnected the Windows XP HD before installing FC4 on the new HD).
Because I had just replaced the CPU fan and didn't get any temperature sensors working under FC4 yet, I wanted to install a dual boot so I could boot into Windows to check the temps without having to swap HDs all the time.
After a few attempts still no success until I found this thread and more specifically this part:
GRUB (GRand Unified Bootloader)
map
If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one.
Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. Here is an example:
grub> map (hd0) (hd1)
grub> map (hd1) (hd0)
This performs a virtual swap between your first and second hard drive.
I added the mapping lines to my grub.conf and it worked like a charm!
Thanks gonzalo76, glad I joined the FedoraForum!
- Whatts -
kqyym
25th July 2005, 07:38 AM
This is really helpful. I solved my problem with this.
Thanks a lot!
Clunixchit
8th September 2005, 07:20 PM
hai there,
i follow your guide.
but nevertheless it didnt help me recover my FC4
here is my post, if anyone cld pop a solution: http://forums.fedoraforum.org/showthread.php?t=76735
Peter_J_Holm
11th September 2005, 07:55 AM
System: IBM Thinkpad T41p
OS: WinXP/FC4 (just upgraded from FC3 thus causing the problem)
Problem: Upon boot the GRUB scrren comes up but is black and white instead of Blue.
WinXP boots fine but when choosing FC4 the following dialog appears:
Booting 'Fedora Core 4 (2.6.11-1.1369_FC4)'
root (hd0,0)
Filesystem type unknown, partition type 0x7
kernel /vmlinuz-2.6.11-1.1369_FC4 root=/dev/VolGroup00/LogVol00 vga=788 selinux=0
Error 17: Cannot mount selected partition
Press any key to continue...
OK, so I ran my rescue disc, , answered the questions about keyboard etc and let it start /mnt/sysimage then typed grub followed by
grub> root (hd0,0)
However here it no longer works according to gonzalo76's howto.
Any other suggestions?
Many thanks in advance for rapid replies!
Cheers
Peter
LLS
11th September 2005, 08:37 PM
First of all vga=788 is the same as bgcolor=#070808 which is black. Also the line
"kernel /vmlinuz-2.6.11-1.1369_FC4 root=/dev/VolGroup00/LogVol00 vga=788" should look more like"kernel /boot/vmlinuz-2.6.12-1.1447_FC4 ro root=LABEL=/ "
Can you post the entire contents of grub.conf?
Clunixchit
11th September 2005, 08:40 PM
hai there,
i follow your guide.
but nevertheless it didnt help me recover my FC4
here is my post, if anyone cld pop a solution: http://forums.fedoraforum.org/showthread.php?t=76735
Problem solved !!
Its only bad partitioning on my part
bae
19th September 2005, 06:17 AM
i do until
grub> find /boot/grub/stage1
and it say hd(0,3)
after that i run
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists....... no
Checking if "/grub/stage1" exists....... no
Error 15
what i try to do is, i try to overwrite the mbr. bcoz i install fc3 then install xp, so the mbr been overwrite.. i cannot load to fc3.. load direct to winXp.. i try to use osloader, it works to load Xp but hav blank when i choose to load the linux help me pls
LLS
19th September 2005, 03:05 PM
Look here--
http://www.linuxquestions.org/questions/answers.php?action=viewarticle&artid=428
bae
20th September 2005, 01:51 AM
Look here--
http://www.linuxquestions.org/questions/answers.php?action=viewarticle&artid=428
thank you :)
alarinn
20th September 2005, 06:23 AM
Hello all,
I was able to install Fedora 4 64 bit on my AMD64 machine, but when I reboot it goes directly into XP Pro. I have 2 HD - XP on HD0 and Linux on HD1. The conf file looked fine, but GRUB is not even loading when I reboot, so I'm thinking the loader is not being seen on the MBR at all. Anyone help this noob out please??
alarinn
20th September 2005, 01:26 PM
I set the root to (hd1,0) like I should, but I setup (hd0). After that I got the menu and everything likes fine.
bblouis
4th June 2006, 11:39 AM
I've done the following but the Fedora5 still can't be booted and windows booted instead, anyone can kindly help?
I've my WindowsXP on hd2 and installed Fedora on another harddisk, but i dont know where my Fedora is located (hd?) ?
which command i can retrieve this info?
----
grub> root (hd2,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd2)
Checking if "/boot/grub/stage1" exists....... no
Checking if "/grub/stage1" exists....... yes
Checking if "/grub/stage2" exists....... yes
Checking if "/grub/e2fs_stage1_5" exists....... yes
Running "embed /grub/e2fs_stage1_5 (hd2)"....... 15 sectors are embedded
succeded
Running "install /grub/stage1 (hd2) (hd2) 1+15 p (hd2,0)/grub/stage2 /grub/grub.conf....... succeded
Done
note that the bold "hd1" maybe wrong
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
#hiddenmenu
title Fedora Core (2.6.15-1.2054_FC5)
root (hd1,0)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb
quiet
initrd /initrd-2.6.15-1.2054_FC5.img
title Windows XP
rootnoverify (hd2,0)
chainloader +1
bblouis
4th June 2006, 11:59 AM
Referring to the above problem, my system configuration is like that:
Primary IDE Master HL-DT-ST DVDRAM GS
Primary IDE Slave SONY CD-RW CRX
Third IDE Master WDC WD3200KS-00 PFB - WindowsXP
Third IDE Slave Not Detected
Forth IDE Maste WDC WD2000JS-00 MHB - Fedora
Forth IDE Slave Not Detected
Boot Device Priorty
1st Boot Device HL-DT-ST DVDRAM
2nd Boot Device FLOPPY DRIVE
3rd Boot Device WDC WD3200KS-00
chAotic blAck
7th July 2006, 11:16 AM
well, i have this kind of problem, but your explanation is a bit not clear for me.
i have two hdd with winxp and linux installed on my hda, and win98 on by hdb.
the grub is installed at hda.
my first partition on my hda is winxp, and the second is linux.
my first partition on my hdb is win98.
the first bios boot sequence is IDE-0, means my hda, and it correctly loads. i also inserted the win98 partition to the grub so that i want to load win98 directly from the grub on my hda, but it cannot loads. it says something wrong with the chainloader.
could you please write down a step-to-step solution for me? thanks.
rajat_ghosh
14th July 2006, 07:37 AM
Dear Everybody
I have registered just now and would like to say Hello!!! to everybody of this forum.
I have a critical problem with my desktop PC which I could not resolve myself in last couple of days and my computer have become unusable.
I would give my hardware configuration first.
Gigabyte Intel 845GL chipset motherboard
2.4 GHZ Intel pentium 4 processor
2 x 40 GB seagate HDD
AWARD BIOS
I was , prior to Fedora CORE 5 release, using only windows xp installed on my first partition of hdd0(Primary master drive) . My second hard drive is located on secondary master and bootable. To reduce IO contention issues , I have kept all my application softwares on the first partition of secondary master drive. It was like this and worked always without any trouble. Problem began when I did intend to try my downloaded (DVD version) Fedora Core 5 on my machine and the FC5 intaller informed that it needs the primary partition of the first disc . So I did take a full backup of my winXP system with XP backup utility, removed the first partition with xp insatllation cd , formated the second partition of the first drive with NTFS file system,drive letter automatically changed to C: , installed winxp afresh, recovered the backup system with xp bacpup utility, rebooted the system. it worked fine. I was able to work on xp with all previous setting.
Now I did start to install my FC5 on partition 1 and installer moved well and after a while my display freezed. After several reboots and iterating the same process yielded nothing. Then I did try "linux text" mode install and it went all through and the grub bootloader loaded ( on MBR) with automatically detected windows installation where I kept the default boot to WinXP. Installer prompted me a reboot. Post reboot , my system booted directly to winxp and it seemed fedora core is not installed at all . It did not do anything new as many times I have installed FC5 afresh.
So , I did take a complete bootable backup of win xp using nero7 premium backup utility, removed all partition of first drive , recreated partitions afersh, tried fc5 afresh but my system failed to boot. I did use my bootable restore disc , it went well and even restored MBR, but my hard drive could not boot any of the OS and now constantly giving messege
" failed to boot operating system" . I did try to install Win XP afersh with new partitions, it could not be completed after winXP installer intermediate reboot. So I have removed the first Hard drive, moved the second hard drive to the location of the first one, made appropriate bios configuration, formated the first partion of the second drive(now first and only one) , tried to install winxp on it . It also failed the same way. I thought the my bios might be keeping the old values and cleared the CMOS, reconfigured and then tried to install winxp again but it also did not work.
Now both the hard disc is in the same state , even I have tried to install win98 after recreating dos partition with fdisk utility.
It seems that grub is still present in the hard drives and it could not be overwritten by any other OS installation, not even FC5.
I shall be immensely thankful to all of you if you can give me some suggestion to resolve these problem and reuse my hard drives. I have a nero7 bootbale backup of win xp which displays grub booting and restores entire os (sector by sector) of old xp partition image.
Thanks to everybody.
Regards
Rajat Ghosh
LLS
14th July 2006, 04:55 PM
If you have a windows 98 boot disk then you can fix your drives like this.
Do one disk at a time set as master on the cable and on the jumpers on the back of the disk.
1st. boot with 98 boot disk choose no cdrom support necessary first and then at dos prompt type
fdisk / mbr do this several times. Reboot!
2nd reboot with 98boot disk type fdisk choose yes to everything untill you get to fdisk options and then at the bottom there is an option for delete non dos partitions and choose this and follow through the routine untill your satisfied you did it right then reboot!
3rd. reboot with 98boot disk type fdisk and yes till you reach fdisk options then choose create primary dos partition and choose the size you wish for your xp partition, it must be at least as big as the partition you made the backup image of if you plan on restoring from that image. You do not need to reformat. Reboot!
4th. do the restore and then if you have a problem booting, ie if you have left over grub stuff messing stuff up, boot to your xp installation cdrom disk and choose the repair console option and once in the console typefixmbr say yes and that should repair your original boot options on mbr for xp. This should give you your xp back.
Then set the jumper on the other disk to slave and install back on the cable and carefully follow one of the many dual boot how tos on this and other forums and procede with the fedora core install.
This is where you will need to make an important dedecision on where and how you want fedora to boot. See if you can get this far and then there will be plenty of help for you on the dual boot options. If any of this confuses you than by all means ignore and re-ask again as there are plenty of good tech help here and if I have made errors, I hope they will correct me to help you.
merlinv12
3rd August 2006, 12:12 AM
Great Job goes to gonzals for the great how-to.
I thought I would add my two cents in as well.
I have had some instances where when I boot using linux rescue (install CD) and ask the system to try to mount my sysimage partition automatically, it only mounts /boot and nothing else and everything else gets put into /mnt/sysimage. So if I then run chroot /mnt/sysimage, then I loose the /boot that was mounted and then when I try to run any of the commands in grub, then I get the errors like error 15 17 21. If you run in that problem, try skipping the chroot /mnt/sysimage step and go straight into the grub command line and try the "root (hdX,X)". Hopefully it works for you as well.
Elv13
22nd August 2006, 02:26 AM
if windows reboot in loop what is the best solution (NO FORMAT)? It is not on my computer and it look stange for me, how can the instalation of linux breake a windows partition (all file still there) and cause problem like that. It is not a partition error aparently, windows just wont boot at all but grub seem to work and link corectly to windows. Any idea
*It is not FC but i dont reallty know where to post, it is the same on all distro (suse, ubuntu, mepis).
Here is the grub.conf (old one, i dont have the actual one, but it is the same problem)
timeout 15
color cyan/blue white/blue
foreground ffffff
background 0639a1
gfxmenu /boot/grub/message
title MEPIS at sda2, kernel 2.6.15-26-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/sda2 nomce quiet vga=791
boot
title Windows at sda1
rootnoverify (hd0,0)
chainloader +1
title MEMTEST
kernel /boot/memtest86+.bin
*It is a sata drive
merlinv12
22nd August 2006, 05:53 AM
Elv13, can you please provide more information about your problem. If you actually are seeing the windows logo or anything which indicated windows is booting then grub is fine and you have a problem with your windows partition.
I am not sure what you mean by windows boots in a loop? Can you please expand on the explanation? Do you actually get into your windows partition?
If you give a more detailed step by step, that would be helpful. If grub is working and its your windows partition then you might be better off posting to a windows forum.
RJP
22nd August 2006, 03:53 PM
> map
> If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk
> swapping technique, because that OS cannot boot from any disks but the first one.
[...]
> This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS
> uses a special driver for the disks, this probably won't work.
Is there an easy way to find this out? I think XP uses BIOS on my system, but before I try this I want to be certain.
It has become necessary for me to shove XP into the sidelines, and put W98 back as my main Windows platform! (Long story.) But if I can keep XP as a backup using this map sequence, great.
Fedora 4 is my primary OS, but for certain tasks I still need Windows. And, for those, I can use the older yet more reliable (IMO) Windows 98.
Thank in advance,
RJP
Elv13
26th August 2006, 01:47 AM
oops, sorry, i forgot about this post.
Grub seem to be fine, but windows reboot when it try to load, a kp aparently. How can the instaltion of grub and resising a partition can scrap it?
bimaljr
29th October 2006, 06:27 PM
Hi,
First of all, I am a newbie, and familiar with Windows...
I have allready windowsXP on my first hdd (hd0) (size-80GB). I have install Fedora 5 on my second HDD (hd1)(size-10GB)
But after installing Fedora, when the system restarted, the system boots directly in WindowsXP, no OS selection menu.
After that, I see this thread and reinstall the grub, and changed BIOS first boot to my 10GB HDD.
Now, when I start my pc, GRUB dispalys three OS - 1)Fedora 2)Fedora 3)Other
The "3)others" loads windows perfectly
Now the problem is :
When I enter on first or second Fedora, os don't load and message displays :
Error 17: Cannot mount selected partition
What do I do...? Please help me
roodi2005
29th October 2006, 09:54 PM
hi everybody,
i have this grub error since a while now and i am not able to solve it till now.
(little description )
i have a 250 G hdd and i have win xp on one of the four partitions of my hdd.
when i tried to install fedora 5 everything with installation went perfect no errors or nothing, but when i reboot my machine all what i see after checking he memory and the devices connected to my machine is a black screen and the word GRUB on it and i cannot do anything after that . either my win xp or fedora will boot. the only way to boot my win xp is by inserting the windows cd and formating the fedora partition after that i can boot my windows.
i tried to do the steps mentionned by Gonzalo76 everything went as he mentionned but when i rebooted i got error 18 instead of GRUB and nothing else. i cannot boot any OS till i format the F5 partition.
i am new to linux and any help is appreciated. thx
bimaljr
31st October 2006, 05:27 PM
Hi,
First of all, I am a newbie, and familiar with Windows...
I have allready windowsXP on my first hdd (hd0) (size-80GB). I have install Fedora 5 on my second HDD (hd1)(size-10GB)
But after installing Fedora, when the system restarted, the system boots directly in WindowsXP, no OS selection menu.
After that, I see this thread and reinstall the grub, and changed BIOS first boot to my 10GB HDD.
Now, when I start my pc, GRUB dispalys three OS - 1)Fedora 2)Fedora 3)Other
The "3)others" loads windows perfectly
Now the problem is :
When I enter on first or second Fedora, os don't load and message displays :
Error 17: Cannot mount selected partition
What do I do...? Please help me
Thanks... problem solved
Detonate
28th January 2007, 05:22 AM
I've been working on a borked up grub since about noon today. Found this thread about 10 minutes ago, and my problem is solved. Thanks. Next time I screw something up, I'll do a better search.
hosammy
29th January 2007, 04:50 AM
GRUB (GRand Unified Bootloader)
title My Entry
unhide (hd0,0)
hide (hd0,1)
rootnoverify (hd0,0)
makeactive
chainloader +1
:)
In my case, I install the FC6 in hda and the MBR on hda1. The Windows XP on sdb1 which is a SATA hard drive. May I know how to define it in /boot/grub/grub.conf ? Is it (sd0,0) in rootnoverify is a correct description?
title Windows XP
rootnoverify (sd0,0) ???
chainloader +1
hosammy
30th January 2007, 05:06 PM
In my case, I install the FC6 in hda and the MBR on hda1. The Windows XP on sdb1 which is a SATA hard drive. May I know how to define it in /boot/grub/grub.conf ? Is it (sd0,0) in rootnoverify is a correct description?
title Windows XP
rootnoverify (sd0,0) ???
chainloader +1
I think I have soloved my problem myself. Here is my set up:
1) IDE 80 gB installed with FC6; SATA 160gB installed the Windows XP in NYFS, SATA 120gB w/o OS in NTFS
[root@localhost ~]# fdisk -lu
Disk /dev/hda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders, total 160836480 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 63 208844 104391 83 Linux
/dev/hda2 208845 160826714 80308935 8e Linux LVM
Disk /dev/sda: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders, total 321672960 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 63 321653429 160826683+ 7 HPFS/NTFS
Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 16065 234436544 117210240 5 Extended
/dev/sdb5 16128 234436544 117210208+ 7 HPFS/NTFS
[root@localhost ~]#
2) Here is my content in /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=30
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title Fedora Core (2.6.19-1.2895.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.19-1.2895.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.19-1.2895.fc6.img
title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive
boot
Hope my information can assist some successers who use SATA to install the Windows XP.
GaryPod
28th February 2007, 11:59 AM
Thats just the info i was after thanks a lot!!!
TheOlster
8th March 2007, 06:42 PM
I'm having major problems with FC5. My hda disk has died, and a new one's been installed. I've manged to install grub to the mbr of this disk (/ is mounted on a different disk) and when I reboot I end up with:grub>I think this is because the file /boot/grub/grub.conf file doesn't exist.
How do I get grub to rebuild this file? Do I really have to create it manually? If so how do I detect the settings required?
techmind48
24th March 2007, 06:50 AM
GRUB images files
GRUB consists of several images: two essential stages, optional stages called Stage 1.5, and two network boot images. Here is a short overwiew of them.
'stage1' This is an essential image used for booting up GRUB. Usually, this is embedded in an MBR or the boot sector of a partition. Because a PC boot sector is 512 bytes, the size of this image is exactly 512 bytes. All 'stage1' must do is to load Stage 2 of Stage 1.5 from a local disk. Because of the size restriction, 'stage1' encodes the location of Stage 2 (or Stage 1.5) in a block list format, so it never understand any filesystem structure.
'stage2' This is the core image of GRUB. It does everything but booting up itself. Usually, this is put in a filesystem, but that is not required.
'e2fs_stage1_5'
'fat_stage1_5'
'ffs_stage1_5'
'jfs_stage1_5'
'minix_stage1.5'
'reiserfs_stage1.5'
'vstafs_stage1.5'
'xfs_stage1_5'
These are called Stage 1.5 because they serve as a bridge between 'stage1' and 'stage2', that is to say, Stage 1.5 is loaded by Stage 1 and Stage 1.5 loads Stage 2. The difference between 'stage1' and '*_stage1_5' is that the former doesn't understand any filesystem while the latter understands one filesystem (e.g. 'e2fs_stage1_5' understands ext2fs). So you can move to Stage 2 image to another location safely, even after GRUB has been installed.
While Stage 2 cannot generally be embedded in a fixed area as the size is so large, Stage 1.5 can be installed into the area right after and MBR, or the boot loader area of a ReiserFS or a FFS.
'nbgrub' This is a network boot image for the Network Image Proposal used by some network boot loader, such as Etherboot. This is mostly the same as Stage2 but is also sets up a network and loads a configuration file from the netwrok.
'pxegrub' This is another network boot image for the Preboot Execution Environment used by several Netboot ROMs. This is identical to 'nbgrub', except fro the format.
Creating a GRUB boot floppy
To create a GRUB boot floppy, you need to take the files 'stage1' and 'stage2' from the image directory, and write them to the first and second block of the floppy disk, respectively:
Caution: This procedure will destroy any date currently stored on the floppy. On a UNIX-like operationg system, that is one with the following commands:
Open a Terminal, become root with 'su' command and type:
cd /usr/share/grub/i386-redhat
dd if=stage1 of=/dev/fd0 bs=512 count=1
dd if=stage2 of=/dev/fd0 bs=512 seek=1
Installing GRUB on a floppy disk
# /sbin/grub-install /dev/fd0
Everytime you install a new kernel you'll need to update your floppy disk running "/sbin/grub-install /dev/fd0" again.
Mr. Gonzalo,
Creating a GRUB boot floppy was interesting.
I do no have floppy drive in my system.
How to create GRUB boot CD?
Bhasker Raj
India
stevea
27th April 2007, 08:36 AM
The following section is in error.
GRUB and Linux Partitions
First of all, GRUB requires that the device name be enclosed with ( ). Please, note that the partition numbers are counted from zero, not from one.
(hd0) in GRUB = is hda in Linux
Here, 'hd' means it is a hard disk drive. The first integer '0' indicates the drive number, that is, the first hard disk.
(hd1) in GRUB = is hdb in Linux
The first integer '1' indicates the drive number, that is, the second hard disk.
(hd0,1) in GRUB = is hda2 in Linux
This expression means the second primary partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk.
(hd0,4) in GRUB = hda5 in Linux
This specifies the first extended partition of the first hard disk drive. Note that the partition numbers for extended partitions are counted from '4', regardless of the actual number of primary partitions on your hard disk.
(hd0,5) in GRUB = hda6 in Linux
This is the first logical unit of the extended partition of the the first hard disk.
(hd1,0) in GRUB = is hdb1 in Linux
This is the first primary partition of the second hard disk.
Related HOWTO
How to edit your grub.conf
http://www.fedoraforum.org/forum/showthread.php?s=&threadid=996
Good Luck !
:)
The file ".../grub/device.map" associates the grub device names with the linux device names.
An example is:
# this device map was generated by anaconda
(hd0) /dev/sdb
(hd1) /dev/hda
(hd2) /dev/sda
So (hd0) may be any drive. It depends on the device.map file.
NowN4Ever
26th July 2007, 05:21 AM
Gonzalez and all, I tried to follow the steps you outlined but I still do not get FC6. I only see Win2KP so I have copied as much as I could from the installation for you to see if there is anything (or a step) missing.
On Win2KP: \mbrfix /drive 0 listpartions
#Boot Size(MB)Type
1Yes 19085 7 NTFS or HPFS
2 0 0 NOne
3 0 0 None
4 0 0 None
generated by fdisk -l
Disk /dev/hda: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 2488 19543041 7 HPFS/NTFS
Disk /dev/hdd: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdd1 * 1 13 104391 83 LInux
/dev/hdd2 14 4865 38973690 8e Linux LVM
/boot/grub/device.map
#this device map was generated by anaconda
(hd0) /dev/hda
I do not know why (hd1) was not generated.
/root/anaconda-ks.cfg
#Kickstart file automatically generated by anaconda.
install
cdrom
land en_US.UTF-8
keyboard us
xconfig --drver "r128" --resolution 800x600 -- depth 24 -- startxonboot
network --device eth0 --bootproto dhcp
rootpw --iscrypted $1$9jj8SyDB$5./h7qbYGdMd1.CjIshlg1
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --enforcing
time America/New_York
bootloader --location=mbr --driveorder=hda,hdd --append="rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
#clearpot --linux --drives=hdd
#part /boot --fstype ext3 --size=100 --ondisk=hdd
#part pv.20 --size=0 --grow --ondisk=hdd
#volgroup VolGroup00 --pesize=32768 pv.20
#logvol swap --fstype swap --name=LogVol01 --vgname=VolGroup00 --size=512 --grow
--maxsize=1024
#logvol / --fstype ext3 --name=LogVol00 --vgname=VolGroup00 --size=1024 --grow
%packages
@eclipse
@kde-desktop
The contents of my grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd1,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.18-1.2798.fc6)
root (hd1,0)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb
quiet
initrd /initrd-2.6.18-1.2798.fc6.img
title Windows 2000 Professional
rootnoverify (hd0,0)
chainloader +1
Any suggestions as to why I can't get dual mode to work?
SlowJet
26th July 2007, 05:54 AM
splashimage=(hd1,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.18-1.2798.fc6)
root (hd1,0
the hd1 in those lines s/b
hd3
to represent the hdd1 which is where the fedora /boot partition located.
But I have never been able to get grub to install in a /boot partition, it always ends up in the / .
I have had all my /boot partitions on the first drive.
Let me know if your boots ok.
SJ
EDIT: N/M I didn't see the hda1 for root.
All you need to do is hit ESC key when grub is loading and you will see the fedora title.
SlowJet
26th July 2007, 06:14 AM
Let me look again.
I was right the first time. :)
hdd1 is NOT the first drive so you will find
no kernel in /boot and
grub and kernel will be in / (which is in an LVM so you can NOT boot it.)
Put the /boot on hda2 after reducing your ntfs partition by 200 MB
SJ
NowN4Ever
27th July 2007, 07:01 AM
SlowJet, can you tell me (or point me to) how to reduce the my ntfs partition? I am a newbie. Thanks.
NowN4Ever
27th July 2007, 09:43 PM
SlowJet, Thanks for your help. It is working now. I created another partition on hda for /boot by reinstalling w2kp - that was the easiest way for a newbie like me. I get fc6 now. An error message flashes on the screen before the menu screen appears. I will see if I can catch that message. Thanks.
BardiaN
24th August 2008, 07:47 AM
Hi,
Thanks for your help,I have 2 HDD and I have Windows Vista on my First HDD,I Installed Fedore Core 6 on my Second HDD and same problem occurred.
with your guide I fixed it,now I Changed your article for myself:
GRUB (GRand Unified Bootloader)
Vista uses grub too. But a customized grub. so you need to replace its grub with Fedora Core Grub to make a dual boot Vista and Fedora Core 6
Problem
"There is not a boot manager screen at all, it just boots right into windows vista but GRUB boot window does not appear. I cannot figure out to access fedora, I do not have a boot disk and need to know if there is someway to boot into fedora"
Solution
You have to install GRUB on the MBR (Master Boot Record). To do this just follow this steps:
(First of all, enter your BIOS setup and in BOOT Sequence window choose to boot with CDROM first.)
1) Boot with your Fedora Core Installation CD 1.
2) Type "linux rescue" at the prompt.
3) Answer the questions about keyboard and language.
4) Tell the rescue mode to use your proper partition to mount (choose Continue,Fedora will automatically find it)
5) When you come to the console prompt type: chroot /mnt/sysimage
6) Type grub
7) Set the GRUB's root device to the partition containing the boot directory like this:
grub> root (hd1,0)
Filesystem type is ext2fs, partition type 0x83
I have 2 SATA hard disks (HDD0 = MAXTOR500GB , HDD1 = MAXTOR160GB)
I have Windows Vista in (hd0,0) ; Fedora Core /boot partition in hd(1,0) So in my case the command should be: > root (hd1,0)
If you are not sure which partition actually holds this directory, use the command 'find' like this:
grub> find /boot/grub/stage1
This will search for the file name '/boot/grub/stage1' and show the devices which contain the file.
Once you've set the root device correctly, run the command 'setup'.
8) Then, run the command setup (this command in my case is like this too, because my Fedora is on HD1,0 but My MBR is in HD0 so I need to run setup for HD0)(the result of Command depends on your hard disk partitioning,the only important thing is “Succeeded & Done” that you have to see)
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists....... no
Checking if "/grub/stage1" exists....... yes
Checking if "/grub/stage2" exists....... yes
Checking if "/grub/e2fs_stage1_5" exists....... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"....... 15 sectors are embedded
succeeded
Running "install /grub/stage1 (hd0) (hd0) 1+15 p (hd0,2)/grub/stage2 /grub/grub.conf....... succeeded
Done
This command will install GRUB boot loader on the Master Boot Record (MBR) of the first drive.
9) Type quit
grub> quit
GRUB is now in the MBR.
10) Finally, you'll have to edit(Or if you installed GRUB before,you’ll have to check) your /boot/grub/grub.conf, for example whith nano:
> nano /boot/grub/grub.conf
(/etc/grub.conf or /boot/grub/grub.conf or /boot/grub/menu.lst, they are the same file) This file has the boot partitions of the disk/s.
You’ll have to check your Boot OS that has written into grub.conf to be proper
11) Restart your PC without the Fedora Core CD 1 Installation.
My grub.conf
default=0
timeout=30
splashimage=(hd1,0)/grub/splash.xpm.gz
title GNU/Linux Fedora Core 6
root (hd1,0)
kernel /vmlinuz-2.4.22-1.2188.nptl ro root=LABEL=/ hdc=ide-scsi hdd=ide-scsi apm=off acpi=on vga=788
initrd /initrd-2.4.22-1.2188.nptl.img
title Microsoft Windows Vista
rootnoverify (hd0,1)
chainloader +1
Gathering and developing by “Bardia Navvabian”
The main source: http://forums.fedoraforum.org/showpost.php?p=5538&postcount=1
Special thanks to Mr gonzalo
LeFou
10th November 2008, 05:54 PM
Oof, I tried an install of that Other Distro (rhymes with you soont goo) and forgot that it likes to clobber your grub without asking. So now I've got error 21 on account of (I assume) it not recognizing the LVMs as hard disks.
So I trimmed to
name Fedora 9
root=(hd0,4)
chainloader +1
Which, I thought, would mean "go to /dev/sda5 and use the grub that lives there"
This is the partition that was formerly /boot for my F9
still error 21 on me.
I suspect I could get this sorted out if only I could get the grub CLI going. But error 21 makes this impossible? I get it at stage 1.5 .. menu/CLI isn't loaded yet?
BobLfoot
15th October 2009, 02:19 PM
I love this topic but posted a question about it also over in general support.
khrombaa
27th October 2009, 08:11 PM
very nice howto thank you buddy
Linux Archive (http://www.linux-archive.org/)
winglessbuzzard
24th November 2009, 12:38 AM
A little help anyone:
Currently I can load Grub (and pick Fedora) if I change my primary hard disk to my 160GB HDD in BIOS. I can load Windows 7 if I change my primary hard disk to my 400GB HDD in BIOS. But I don't seem to be able to use Grub to properly boot into Windows 7, leaving my Primary HDD at my 160GB in BIOS. I think I've followed instructions well...but obviously I'm missing something. Here's my device.map file:
---------------------------------------------------------------------------
# this device map was generated by anaconda
(hd0) /dev/sda
(hd1) /dev/sdb
---------------------------------------------------------------------------
hd0 is my 160GB HDD with Fedora installed
hd1 is my 400GB HDD with Windows 7 installed
Here is my grub.conf file:
---------------------------------------------------------------------------
GNU nano 2.0.9 File: grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/vg_wes-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.31.5-127.fc12.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.31.5-127.fc12.x86_64 ro root=/dev/mapper/vg_wes-lv_root LA$
initrd /initramfs-2.6.31.5-127.fc12.x86_64.img
title Windows 7
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive
boot
--------------------------------------------------------------------------
I've also tried this for my Windows 7 section in the grub.conf:
title Windows 98 SE
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
rootnoverify (hd1,0)
chainloader +1
Each time Grub loads up, if I select Fedora (F12), it loads properly. If I select Windows 7, the computer reboots.
FYI... I am a N00B (installed my first Linux distro less than a week ago).
stoat
24th November 2009, 01:12 AM
title Windows 7
map (hd0) (hd1)
map (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1
makeactive
bootHello winglessbuzzard,
Try it without the makeactive and boot commands. They usually don't matter, but I've seen the makeactive command cause trouble before. The makeactive command is not needed for modern Windows systems, and the boot command is always implied in grub.conf or menu.lst.
If it still doesn't boot Windows, then look carefully at your fdisk report. The grub.conf maybe configured to boot the wrong partition for Windows. It happens all the time. Anaconda is a sucker to fall for the first partition as the Windows partition if it is a Windows compatible partition, but it's often not the partition with the Windows boot loader files. If you see the problem after you study the fdisk report, then edit the grub.conf for the correct partition. It does no harm even to guess at the Windows partition in grub.conf. If you aren't sure about the fdisk report vis-a-vis the grub.conf file, then post it.su
fdisk -lP.S.: The device.map file is irrelevant to booting. It's only used by GRUB when the boot loader is re-installed. You can even boot without a device.map file.
P.P.S.: I recommend that next time you start a new thread instead of burying your issue at the end of a HOWTO which aren't for questions anyway. I'm leaving it here anyway because a lot of people are viewing it at the moment, and someone may be typing a post about this matter.
winglessbuzzard
24th November 2009, 03:30 AM
My fdisk report... looks like I don't have a valid partition table on either hdd??
[root@Wes grub]# fdisk -l
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0005624a
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 19457 156083521 8e Linux LVM
Disk /dev/sdb: 400.1 GB, 400088457216 bytes
240 heads, 63 sectors/track, 51681 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0x00000001
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 51680 390700768+ 7 HPFS/NTFS
Disk /dev/dm-0: 155.6 GB, 155600289792 bytes
255 heads, 63 sectors/track, 18917 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-0 doesn't contain a valid partition table
Disk /dev/dm-1: 4227 MB, 4227858432 bytes
255 heads, 63 sectors/track, 514 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/dm-1 doesn't contain a valid partition table
I installed windows 7 on hdb, cleaned hda with partition magic then created a ex4 partition for the whole disk of hda. After this, I installed F12 x64 from the DVD, I think it partitioned hdb between sda1 and sda2? Eh... not sure what I'm talking about here. If the solution includes the possibility of wiping data off either drive, I'll just stick with flipping the switch in BIOS. Thanks for the help!
stoat
24th November 2009, 11:59 AM
I installed windows 7 on hdb, cleaned hda with partition magic then created a ex4 partition for the whole disk of hda.Actually, you installed Fedora in an LVM physical volume (which is okay). And it has the usual ext3 boot partition. Since there is only one partition on /dev/sdb, then there is no doubt about the partition with the Windows boot loader files. It's /dev/sdb1. So when the BIOS is configured to boot Fedora, this should boot Windows...title Windows 7
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
winglessbuzzard
24th November 2009, 04:08 PM
Actually, you installed Fedora in an LVM physical volume (which is okay). And it has the usual ext3 boot partition. Since there is only one partition on /dev/sdb, then there is no doubt about the partition with the Windows boot loader files. It's /dev/sdb1. So when the BIOS is configured to boot Fedora, this should boot Windows...title Windows 7
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
Stoat - I tried it and it didn't work. My computer just reboots when I select windows. Any other ideas?
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.