In linux boot process what is the role of stage1, stage1.5's file and stage 2
i have a doubt in linux boot process
in my PC RHEL5 has installed,
in bootig GRUB will load in 3 steps
stage 1--> stage1.5 --->stage2
1st stage1 of grub is located in the 412 bytes of MBR)
also there is a file
/boot/grub/stage1 ( then what is this???)
=========( where does stage1.5 file located ? i found certain files in /boot/grub/)
( i think these all are needed for accessing appropriate filesystems in stage 2 )
i found there is a file
but my qusetn is
is GRUB loads from among these files??
if it is so, i removed the above mentioned files from /boot/grub still system is booting!!!!!!!!!!!!!!!!!!
how it is???
then how stage1.5 and stage2 take place??
pls give reply
i really wish to know the detailed linux boot process
pls help me
Read man grub and then info grub. Move the cursor down to * Images and hit return. You may have to page up a bit to read it all.
Grub1 only needs stage1 and stage2 in normal operations.
Stage1 is exactly 512 bytes large to be placed in the MBR to be read by the Bios. Once set up the stage1 will be modified to include the hard disk address of stage2 which can be place in any partition that Grub1 supports, like Fat16, Fat32, Ext2/3/4.
Any user wanting to install Grub1 on its own can select any partition Grub1 recognises, make a directory /boot/grub and place stage1 and stage2 there. Grub1 can be set up then by "root" pointing to the partition and "setup" command pointing to the booting destination. Both root and setup command can be issued from either a Grub shell (inside Linux) or Grub prompt (before an OS is booted). Grub1 can be set up inside Linux by command "grub-install" too.
If Grub1 is set up with only stage1 and stage2 it boots to a Grub prompt. If a menu.lst is available inside /boot/grub directory it will be automatically executed in lieu of offering the Grub prompt.
All boot loaders have two stages but Grub1 actaully calls them stage1 and stage2. The stage1.5 is only used for special situations with certain filing systems. MS Windows have similar using "fixmbr and "fixboot", either on their own or as parameters with a separate command like "bootrec.exe" depending on whether it is a win2k/Xp or Vista/Win7.
In place of stage1 and stage2 Grub2 has boot.img and core.img respectively. Grub2 can only be set up inside a Linux with "grub-install".
The actual working of Grub1 is Bios reads stage1 and places it in the memory. Stage1 is then in control and loads stage2 which is the actual intelliegence of Grub1. menu.lst will then be sought from /grub, /boot/grub. If none is found Grub1 defaults to a Grub prompt.
Technically there is no installed operating system in a PC that cannot be booted up in a Grub prompt "manually"! This is because Grub can load another boot loader using the "chianloader" command and hands the control to it.
The booting process in a pc is in fact laughingly simple. Most users simply are not interested in knowing it. That is all.
thanks for your advice
but i am still confused.
ie my system is still booting without any related image files of
stage1 , stage1.5 and stage2 in /boot/grub directory,(i deleted those files from here).
how grub load without this image files??
As I said the stage2 has been hard-coded into stage1. So stage1 simply go the hard disk and load whatever there. Grub will continue to work until you overwrite the area currently occupied by stage2. Stage2 can be stored in a removed partition or deleted. When you delete a file you only remove its entry in the filing index. The actual file is never deleted but its area will be make empty and ready to be overwritten by other data.
Take a look at this thread when I reported the same thing.
http://www.ibm.com/developerworks/li...-bootload.html has information about LILO and GRUB.
Hi you can read this article i think it can help u :-)
Recently I have gone thru Linux boot process blog may be it helps.
|All times are GMT -5. The time now is 05:19 AM.|