LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2005, 01:59 PM   #16
mohit_garg
Member
 
Registered: Jul 2005
Location: india
Distribution: redhat, bsd
Posts: 34

Original Poster
Rep: Reputation: 15

is it true that when mbr is re-written it scans the first 8.2 gb of hard drive?
 
Old 07-11-2005, 02:01 PM   #17
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
Grub doesn't know about any os. It must be configured via grub.conf. Many distros do this automatically for you, and they probably just see if there is a windows partition in the beginning of the disk and guess that it needs to be booted.
 
Old 07-11-2005, 02:06 PM   #18
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
Boot Process:
Windows: MBR (points first sector of 1st windows partition) -> 1st sector loads ntldr -> boot.ini of 1st partition -> selects os
The 8 gb thing is a limitation of old bios's. In such a situation the os files have to be in the first 8 gb of the hd. Bootloaders rely on the bios to do stuff so they are limited by it, but once you boot it is irrelevant.
 
Old 07-11-2005, 02:13 PM   #19
mohit_garg
Member
 
Registered: Jul 2005
Location: india
Distribution: redhat, bsd
Posts: 34

Original Poster
Rep: Reputation: 15
hey , i found a better answer for all these ques, i did google and found the link

http://www.nondot.org/sabre/os/files/Booting/mbr.txt
thanx guru for reminding me
 
Old 07-11-2005, 02:17 PM   #20
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
nice article, good find!
 
Old 07-12-2005, 06:27 PM   #21
Psibur
LQ Newbie
 
Registered: Jul 2004
Location: . <-- You Are Here
Distribution: Slackware 2.4.30
Posts: 20

Rep: Reputation: 0
http://www.gnu.org/software/grub/

THis is probably *THE* best place to look if you're curious how grub works. I personally suggest you get *REALLY* curious download and take a look at the source. It'll help you dive into the open source fun.
 
Old 07-12-2005, 07:11 PM   #22
mohit_garg
Member
 
Registered: Jul 2005
Location: india
Distribution: redhat, bsd
Posts: 34

Original Poster
Rep: Reputation: 15
could u guess OS installed by looking at MBR?

hi all , i m just reframing my last question in this new thread,

Is there any way of guessing the Operating sys intalled on ur hard disk by reading MBR?

i read somewhere that MBR table contains the info about the file sys of those partitions and other info like size. start and end, etc and not the OS !
 
Old 07-12-2005, 09:13 PM   #23
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Yeah, you more or less have it right. Even more, the MBR doesn't even contain the filesystem type, just the partition type. You can guess which OS(es) are installed by looking at partition types, but it would probably not be totally accurate (e.g.. a FAT32 partition doesn;t necessarily imply a Windows install),
 
Old 07-13-2005, 09:24 AM   #24
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
you could take a look at the hexdump :

----------
egag@slack21:~/pam/Linux-PAM-0.77$ dd if=/dev/hda bs=512 count=1 |xxd
1+0 records in
1+0 records out
0000000: faeb 2101 b401 4c49 4c4f 1605 8646 c442 ..!...LILO...F.B
0000010: 0000 0000 0650 fe41 cc53 6736 8100 8160 .....P.A.Sg6...`
0000020: d8f3 0000 b8c0 078e d0bc 0008 fb52 5306 .............RS.
0000030: 56fc 8ed8 31ed 60b8 0012 b336 cd10 61b0 V...1.`....6..a.

<etc........512 bytes>
----------

as you see, i use lilo.
i guess grub & windos use an other signature.

egag
 
Old 07-13-2005, 09:43 AM   #25
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,964

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally posted by egag
as you see, i use lilo.
i guess grub & windos use an other signature.
Not strictly.
For grub, you could look for the text "grub" - that famous prompt when you screw up.
Also has some message text embedded - as do the M$oft loaders.

Not trivial - one would have to think there would be a better way to achieve whatever is wanted to achieve.
 
Old 07-13-2005, 05:10 PM   #26
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,575

Rep: Reputation: 181Reputation: 181
mohit_garg, one of the copies of 'could u guess OS installed by looking at MBR?' with many replies has been merged with this one because the subject is the same.
 
Old 07-13-2005, 05:28 PM   #27
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
this is also a good link about mbr & partition tables.

http://www.geocities.com/thestarman3..._in_detail.htm

egag
 
Old 07-13-2005, 05:52 PM   #28
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,629
Blog Entries: 4

Rep: Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001Reputation: 3001
Think of GRUB as being a fairly sophisticated program in its own right ... a tiny, stand-alone complete single-user operating system whose main purpose in life is to locate and load another operating-system, or that operating system's own "boot loader" as the case may be, and to pass control to it.

Because GRUB is, of itself, such a complete and sophisticated program, it has the ability to do quite a few things before the system is actually booted. (Needless to say, these commands are especially useful for dealing with cases when the desired system cannot be booted, and you are late for dinner, and your boss is breathing down your neck and turning an ominous shade of bright cherry red... and you are trying to figure out why!)

The "MBR," or "master boot record," is the very-simple piece of code that your computer's very-simple built-in BIOS uses, basically, "to find GRUB and load it." As long as your BIOS can find GRUB, that's all that your BIOS has to do. Everything else from that point on is handled by GRUB. The GRUB "miniature operating-system" is, for a brief time, actually in complete control of the machine.

GRUB uses "ordinary" configuration-files located in "ordinary" directories, simply because it knows how to read "ordinary files and directories" for several different types of operating-systems. This makes the system very easy to manage. The boot-sequence is highly customizable. This is what leaves simpler systems like LILO completely "in the dust," imho.

When a boot-failure occurs in a Linux environment, it is (in my experience) usually caused by a missing file in the /boot partition. And the problem is usually easily-corrected by loading a different kernel. (Even if you failed to provide for that in the grub.conf menu, you can use interactive commands from within grub to get yourself out of this pickle... you can "do what the menu does, by hand.") The Linux bootup-sequence is fairly nice because the system very quickly puts itself into "a Linux environment" and plays by its own rules.

When a boot-failure occurs in a Windows environment, assuming that the grub.conf entries are specified properly, I find that the single most common cause of the problem is a failure to specify the LBA attribute for the target partition in the partition-table. The Windows boot-loader, which must carry out the "actual" Windows boot-process, is and always has been a remarkably stupid program that does not enter a "'real' Windows environment" until almost the very last minute. But these are not the fault of Grub.
 
Old 07-13-2005, 08:11 PM   #29
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,964

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
O.K., let's wrap this up.
Grub neither knows, nor cares, what operating system is on the disk. If you care, you tell it via the config.
The install doesn't go looking - remember it doesn't care.

If you want a pre-packaged boot loader config, go get one of the bigger distros. It's their installer (Anaconda, whatever) that does that for you.

Re the links above - the homepage is always the place to start. The starmans link is good, there is lots of good info there. The other is *very*specific to Windows - be very careful extrapolating this to the *nix loaders.
 
Old 07-13-2005, 08:24 PM   #30
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
well...this thread has become a mess .
<sigh>

egag
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script that checks for existence of files Rotwang Linux - General 3 12-02-2005 03:11 PM
Device existence problem..... roshu Mandriva 2 02-07-2005 07:01 AM
Scanner's temporal existence phantompgr Fedora 0 10-14-2004 07:51 PM
Why grub prompt after installing Grub inder Debian woody 3.0r2? velan Debian 1 04-20-2004 05:55 AM
check for existence of file j-me Linux - Newbie 5 07-29-2003 08:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration