[SOLVED] Linux bootup chicken-egg problem understanding
Linux - NewbieThis 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
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.
I've been reading the linux booting process and found an interesting area (traditional chicken-egg problem)
While sending signal from MBR to Grub, if I understood correctly this is what is happening.
1. After reading MBR, Grub takes over and boots the defaul kernel setup in grub.conf (Here No file system is mounted yet)
2. The default kernel's InitRD image will be used to mount / partition in RO mode to locate default kernel modules as per Grub.conf (No file system mounted yet)
3. Once after mounting / on RO mode, it locates kernel modules/libraries and then starts booting up in kernel.
Now, can someone tell me
1. where will this grub.conf contents be in? Is this stored in the MBR's first 446 bytes (not sure of though)?
2. Where will be the initrd image stored in?
Or let me know if I understood this totally wrong. Thanks.
Grub by itself is able to read several filesystems. It can read the kernel, initrd and the configuration file from supported filesystems.
Usually you will find those in the /boot directory of your /-partition (or in your /boot partition itself, if you have one).
Does that mean, the ultimate purpose of initrd image is now being covered by Grub.
Sorry for being so noob, but as per the boot up process it is explained that, the grub will have to know how to mount a file system (basic) so that it can mount (/) and load the kernel and thats why initrd is being used.
So if grub knows how to read kernel by itself from /boot, is it overtakes the initrd image's real purpose by itself?
The initrd can have multiple purposes. For example, if the /-partition resides on a filesystem that Grub can not read or a RAID system you usually use a separate /boot-partition which contains kernel, initrd and configuration. The initrd will then load the modules that are needed to mount the /-partition or assemble and start the RAID array before doing that. In other cases the initrd is needed to mount other partitions, for example a network based /usr-partition, before switching to the system in the /-partition is possible.
Keep in mind that when Grub can read a filesystem that doesn't mean that the kernel can read it and vice versa.
Another thing to keep in mind is that kernels are generally built with most device drivers as loadable modules. This typically includes the driver for the device containing the root filesystem, leaving the initrd as the kernel's only source for loading that module.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.