In linux boot process what is the role of stage1, stage1.5's file and stage 2
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
hi
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.