LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 02-15-2006, 11:54 AM   #1
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Rep: Reputation: 15
GRUB on MBR ...


hii
i presently have grub on MBR .. and from wot i have read on internet , it says if u wish to have a dual boot with winxp u shudnt have GRub on MBR but on first sector of /boot , i wish to know why ?
also if i wanna change the grub from MBR to /boot wot to do ?
i always thot BIOS give control to MBR at a fixed offset ... if i want grub to be primary boot loader to link me to linux and winxp .. why wudnt i want it on MBR ? and also i read that my /boot should be within 1024 cylinder's of hard disk if i have old BIOS .. how to check if my BIOS support more than 1024 ???
I also wanna know how to enable a partition to boot ? as the asterix sign ...my winxp partition has the * but not linux partitions ..
wot does it really signify ? tht it is boot enable ?
thanks
 
Old 02-15-2006, 12:12 PM   #2
itz2000
Member
 
Registered: Jul 2005
Distribution: Fedora fc4, fc7, Mandrake 10.1, mandriva06, suse 9.1, Slackware 10.2, 11.0, 12.0,1,2 (Current)]
Posts: 732

Rep: Reputation: 30
if grub is on mbr, i think dual boot will work!
there's no reason it wouldn't!
 
Old 02-15-2006, 12:20 PM   #3
Toozy
LQ Newbie
 
Registered: Sep 2005
Location: Nottingham UK
Distribution: Mandriva 2006, SUSE 10.0 and that other OS from Redmond
Posts: 12

Rep: Reputation: 0
The asterisk just signifies that is the default boot partition, ie, that is the partition that will be booted unless you tell it otherwise.
 
Old 02-15-2006, 12:21 PM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
1024 cylinder limit is history. So forget it. It was already irrelevant to either Grub or Lilo at least two years ago.

Grub should always be in MBR if you want it to multi boot others.

/boot is not where Grub resides. It is always /boot/grub which holds the Grub files. The operational part of Grub is either in MBR or the boot sector of the root partition of the Linux.

The * mean the partition has been marked bootable. It is only used by MS system. Linux never uses it.

Should have a look at "Just booting tips" in my signature. The information is good enough for you to boot any number of OS.
-------------------
Toozy

Suggest you run fdisk, make a primary partition active or bootable and check the movement of the *.

You are nearly correct if we talk only MS systems because MS's MBR has no target to boot. It searches the first one that has its booting flag switched on (the *). So in that sense it can be your interpretation of the "default" system to boot. However I have said it. Linux never uses it.

The answer is very simple.

In Grub it always has a root statement which specifies the partition to boot. like
Code:
root (hd0,0)
Grub counts from 0 so the above is the 1st partition of the 1st disk.

In Lilo there is always a "root=" statement or "other=" statement which also defines the partition to be booted.

Having a * or no * makes no difference to Linux.

Hope this is clear. I can be wrong so any further information is welcome.

Last edited by saikee; 02-16-2006 at 11:35 AM.
 
Old 02-15-2006, 07:54 PM   #5
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Original Poster
Rep: Reputation: 15
if that is the case , then why do Fedora core 3 installation always give u a option to choose between installing Grub on MBR or on boot sector
when i wish to boot other systems too .. why isnt installed on MBR by default
my question basially boils down to ..
can grub boot more than 1 OS when its on boot sector and not in MBR and how ? suppose MBr have winxp NTLDR and grub is on boot sector .. wudnt the system directly go windows xp then why does FC3 give a option to choose where to install grub even if it has detected other systems .. and i guess other distros also give u this option ..
also please clear to me .. is it /boot or boot sector of root partition coz both r clearly different ..
thanks saikeee and others ..
please explain me i m bit slow
-----------
saikeee ur links dont work .. i dearly wanted to read them ..all said time out
 
Old 02-15-2006, 09:31 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Choice is good.
The Windoze loader (in the MBR) can also be made to chainload to a Linux loader installed into the boot sector of a partition.
It isn't as easy to setup, but is do-able. So grub/lilo aren't the only choice for the MBR.
And likewise Linux loaders can chainload onwards to others.

When grub is installed to a partition, the startup code is written to the boot sector record - the first sector on the partition (this is equivalent to the code that would be written to the MBR). Like the MBR code it's primary task is to point (and transfer control) to the location of the stage files and conf file - typically located in /boot/grub for grub.
 
Old 02-16-2006, 02:42 AM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
dipenchaudhary,

Please indicate which of my links don't work.

There are a maximum of 4 choices for the boot loader installation

(1) do not install
(2) In a floppy
(3) In MBR
(4) in root partition

To put it in MBR means a user selects the Linux to multi boot others if he/she has more than one system.

To put it in the root partition means the Linux will not be booted directly on power up but may be booted indirectly by another boot loader occupying the MBR. When Grub boots another Linux it chaniloads its boot loader from the root partition. Both Lilo and Windows's NTlrd do exactly the same.

If you are still not clear then read the last 3 of my links.

In the 100+ systems links I stated that I chainloaded over 80 of them. That was done by making the over 80+ system to place their boot loader in their root partions.

I never used /boot in a devoted partition as suggested by old documentation. I believe that is to do with older version of boot loader unable to cross the 1024 cylinders limit. Nowaday both Grub and Lilo can run at the end of a 300Gb disk!!!

All my distros still have /boot but it is a directory inside every root partition.
 
Old 02-16-2006, 08:54 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Saikee is "Doctor Boot", so anything he says prevails....

First, **something** must be in the MBR (defined as the first 512-byte block(typically the first sector) on the drive). This is where the BIOS goes during startup.

Second, don't confuse directories (eg "/boot") with partitions and sectors.

Third, boot loading can and does happen in stages. EG Windows goes first to the MBR and then to the first sector of the Windows partition--that is where NTLDR is.
GRUB typically has stage 1 in the mbr (or a floppy), and stage 2 in the /boot/grub directory.
 
Old 02-16-2006, 10:03 AM   #9
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Original Poster
Rep: Reputation: 15
thanks a lot BOOT DOCTOR ur such a relief ...and pixellany thanks a lot
actually mine was a silly doubt in which i wanted to ask if grub installed in boot sector of root directory can chainload another OS .. and although i knew the answer tht its not possible because bios switch control to MBR still i asked .. coz on many forums they alert u not to install grub on MBR with windows xp as 2nd OS .. and i just wanted to know why?
thanks a lot guys .. if there was no LQ and u people .. i wud have died in ignorance ... 3 cheers to Linux and LQ
and by the way tommorow i see my chancellor of university to seek approval for starting LINUX USER GROUP .. wish me luck !!!
and yehh any suggestions with this LUG ? i wish i cud call u all to be guest lectures hehe ..
thanks a ton~~
and yehh saikeee links r working now .. that day it didnt .. maybe problem in my connection ...
thanks guys ..
p.s. if u got any link explaining all work arounds related to SATA and linux .. please give me
thnks again
 
Old 02-16-2006, 11:11 AM   #10
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Original Poster
Rep: Reputation: 15
hi ..
i wish to know one more thing .. once in past i had to install grub on floppy and i used this command ( i was root)

grub-install /dev/fd0

this installed it on floppy .. but wot happened was .. it removed grub from my MBR .. because when i tried to boot through hard disk .. it showed me GRUB some million times ... all i cud see on screen was grub

but i was able to boot through floppy .. i asked this question on LQ before too .. does this command above transfer grub from MBR to floppy or install a fresh copy ..

because it clearly did transfer and not fresh install in my case .. coz my hard disk was not able to boot me

can u please elaborate on that command wot did it do ..
why am i not able to boot through hard disk after rebooting .. and only through floppy ...

and also think to be noted is .. when i issued command after bootin through floppy in my linux

grub-install /dev/hda

my floppy drive was active .. which again showed some transfer ..
and then i was not able to boot through floppy but only through hard disk ..

thnks ..
 
Old 02-16-2006, 11:33 AM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Grub-install is one of the two ways to install Grub into the MBR. A more robust way is Task B4 (using "root" + "setup" commands in a Grub shell or Grub prompt) as described in "Just Booting tips" in my signature.

Grub-install can get into trouble if the Linux is installed at the high end of a large disk and the Linux has not put together with a kernel anticipate such a position.

The age of Grub may possibly has something to do with it especially if it is older than the 0.95 version. Current Grub is 0.97.
----------------------------------------------------------------

Guys,

Thanks for the nice words. I am just learning Linux same as everybody. The real experts have answered the same booting problems hundreds of times and may not be motivated to answer every new one. It is up to us newbies to help each other.

I did my share helping newer newbies and have to put together things I have been repeating into my signature to save typing them again.

I can be wrong and hopefully others could step in to tell my mistakes. We all learn so there is no loser here.

Last edited by saikee; 02-16-2006 at 11:41 AM.
 
Old 02-16-2006, 11:37 AM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
It installs a new copy.
You misinterpreted what you saw - the (hard disk) MBR wasn't affected. The stage file(s) it needed to link to had been moved.
When you created the floppy you re-wrote the files in /boot/grub on the hard disk. The MBR code finds them by specific sector. The boot code written to the floppy knew where the new files were, but not the hard disk MBR code.
When you re-reran the install for the hard disk, you reversed the problem.

To create a floppy try "grub-install --root-directory=/mnt/floppy /dev/fd0" (adjust mountpoint as needed). This will write all the needed files to the floppy and leave the hard disk version unaffected.

Last edited by syg00; 02-16-2006 at 11:39 AM.
 
Old 02-16-2006, 11:52 AM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I "chicken" and wanted a bomb-proof job so I did all three at the early stage

grub-install /dev/fd0
grub-install /dev/hda (if I want the Linux to take over the MBR)
grub-install /dev/hda7 (if the root of the Linux is in hda7)

Now I have a Grub bootable floppy (unattached to any OS) so I only to do the last one.
 
  


Reply



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 and MBR tavienu Fedora 2 01-12-2006 08:22 PM
grub to mbr rekaye1005 Linux - General 1 10-18-2005 07:20 PM
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
Grub and MBR, need some help entm Linux - General 3 05-13-2002 03:49 AM

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

All times are GMT -5. The time now is 10:35 PM.

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