LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub installation/config (https://www.linuxquestions.org/questions/linux-newbie-8/grub-installation-config-188193/)

Flak Pyro 05-31-2004 07:32 PM

Grub installation/config
 
When installing a distro you are given a choice to install the boot loader to the default position or to the mbr of the first hard drive. I have windows on my first drive and and to install linux on my second drive, do i want to install grub to the mbr of the primary hard drive? I notice on my other pc that my grub config is in /boot/grub, where will it be if i put it on the mrb of the first hard drive? I tried to find this in my linux book i bought but they dont seem to cover boot loaders much.

Thanks

adamwenner 05-31-2004 08:21 PM

almost all the time, your best bet is to put it in the mbr

kevinalm 05-31-2004 08:23 PM

When we speak of installing to the mbr, we aren't speaking of where menu.lst, the stage files, etc. reside. Those are always in /boot/grub. We're talking about where you want grub's pimary bootloader to be installed. If you install to the mbr of the first bootable drive (win c: drive) then it will be primary boot program, executing immediately after the bios. This is my preference. Anywhere else and you have to configure some other bootloader to hand off to grub.

Installing grub (to an mbr) involves replacing the existing mbr with a first stage grub boot sector to which info regarding which partition menu.lst,etc. are to be found has been added.

See

info grub

for more details.

Flak Pyro 05-31-2004 08:40 PM

I have grub .92 installed there now (last time i let redhats installer do it by itself and that was before i got this second drive) When i hookup this other drive and install Fedora to it do i have to erase the MBR of the first hard drive using fdisk mbr or will the FC2 installer be smart enough to overwrite it when im installing to the second hard drive? (Of cource i will have to tell it to install it to the right place but will it be smart enough to overwright it)

kevinalm 05-31-2004 11:07 PM

Because of the way grub handles booting windows, it would probably be safer to restore the mbr with fdisk /mbr and then do the linux install. Likely, it wouldn't matter but I prefer to play safe. Plus if something goes wrong windows should still boot, giving you internet access for help.

Flak Pyro 06-01-2004 12:32 AM

sounds good. Also this isnt my primary pc im doing this on so if something does go wrong my main box is still intact :).

adamwenner 06-01-2004 07:37 AM

if you can, get linux disk 1, and at the boot: prompt, type

linux rescue

when you get a shell, type in
chroot /mnt/sysimage

then run
grub-install

this will reinstall grub


or reinstall linux, either one

Flak Pyro 06-06-2004 09:30 PM

yeah so right now my grub files are loacated on hda and grub is installed on the mbr of hda, if i install fc2 on hdc (my second hard drive) and then install its grub to the mbr of HDA what will happen there? Will the config files that are on HDA's boot dir be magically deleated? I am going to assume that my config files for the new grub will be stored on HDC but will these old config files on HDA cause problems?

kevinalm 06-06-2004 10:02 PM

Only one set of menu.lst, etc. files will be used at a time. The old set won't be deleted. You could use either one you want. This is encoded into the mbr as a pointer to the partion containing the fileset you want when installing. This can be done manually with the grub prompt. For a full explanation see:

info grub

and read the section on installing natively, but as an example suppose you wanted to setup to use your current fileset. As root:

grub
root (hd0,0) ...your menu.lst is on the first partition of first hd.

setup (hd0) ...installs to the mbr of hd0

Root in grub's context refers not to / or /root but to the partition containing menu.lst and company.

I should probably point out that hd0 is not necessarily hda. Grub scans for hd's only on hd(a-f) and assigns a number for each drive it finds. My hde=hd0 and hdf=hd1.

Flak Pyro 06-06-2004 10:04 PM

very interesting, so it will by default use the new config , but i could set it to use the old one if i wanted to.

kevinalm 06-06-2004 10:08 PM

You got it! :D


All times are GMT -5. The time now is 12:13 AM.