LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-18-2005, 04:51 PM   #1
rekaye1005
LQ Newbie
 
Registered: Jan 2005
Posts: 17

Rep: Reputation: 0
grub to mbr


missed a check box during RH9 install.
booting from floppy.

how do i transfer grub to mbr on hard drive, so i dont need the floppy.

ron
 
Old 10-18-2005, 07:20 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Installing GRUB on your system.

Installation of GRUB on your system is also simple and straight-forward. Once at the GRUB prompt, enter the following to install GRUB.
grub>root (hd0,0)
This is the location of the root for GRUB, NOT the root of your filesystem. This is the drive and partition that have your stage1, 1.5 and stage 2 files (located in /boot/grub). With GRUB treating all hard drives, IDE SCSI and others all the same, it can become confusing which drive actually contains the grub root. Luckily, there is a very simple way to find where these files are located. From the GRUB command prompt, type the following command:

grub>find /boot/grub/stage1
This will return a response similar to the following:
grub> find /boot/grub/stage1
(hd0,0)
grub>
If you have multiple drives that contain this file, it will list all locations that it was found at.
Once this is set, type the following:
grub>setup (hd0)

This is the location that you want the stage1 image to load to. (hd0) would load stage1 to the MBR of the first hard drive. This is the desired option for booting multiple OS's, using GRUB as the primary bootloader/menu. If for example you want to load GRUB to the first partition of the first drive, you would issue the command:
grub>setup (hd0,0)
This would be the preferred option if you either do not want to use the MBR for GRUB, or you are using another bootloader such as Boot Magic to boot the system, and want to chainload GRUB from that other
bootloader.
Typing this command will return something similar to the following:
grub> setup (hd0)
Run "embed /boot/grub/e2fs_stage1_5 (hd0)"
16 sectors are embedded.
Run "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2"

grub>
This will have successfully loaded grub, although it does have a problem. It will not have installed GRUB to use your menu.lst file. The solution to this is simple. Since GRUB has now provided you with all the necessary options for the stage1, 1.5 and 2 installation, simply duplicate the following portion of the last line:
install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2
and add (hd0,0)/boot/grub/menu.lst to the end so that the line would read:

install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 (hd0,0)/boot/grub/menu.lst

This will install GRUB so that it uses the /boot/grub/menu.lst file for your boot options. Note that the install lines shown above are all on one line, although they may wrap due to length as they did in the formatting of this document.
Once this is completed, type quit to exit the GRUB menu, and restart your system. You should now boot using GRUB, with the options specified in your menu.lst file presented to you on boot.

Source of these instructions: Zen and the Art of Using Grub.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub on MBR vivekian SUSE / openSUSE 13 02-20-2005 09:49 PM
GRUB MBR overwritten by WIN98 MBR TOuseef Linux - General 7 11-14-2004 04:25 PM
Win XP + mbr + grub = >:O jclark00001 Linux - Newbie 1 02-15-2003 08:36 AM
Grub and MBR, need some help entm Linux - General 3 05-13-2002 03:49 AM
Cant clear GRUB from MBR cgb_78 Linux - Newbie 8 12-06-2001 06:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:01 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