LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 09-25-2013, 07:06 PM   #1
jeffmonte
LQ Newbie
 
Registered: Jul 2010
Posts: 29

Rep: Reputation: 1
Linux bootup chicken-egg problem understanding


Hi Geeks,

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.
 
Old 09-25-2013, 07:08 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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).
 
Old 09-25-2013, 09:26 PM   #3
jeffmonte
LQ Newbie
 
Registered: Jul 2010
Posts: 29

Original Poster
Rep: Reputation: 1
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?

Please help.
 
Old 09-25-2013, 11:06 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.

Last edited by TobiSGD; 09-25-2013 at 11:09 PM.
 
Old 09-26-2013, 12:16 AM   #5
jeffmonte
LQ Newbie
 
Registered: Jul 2010
Posts: 29

Original Poster
Rep: Reputation: 1
Thanks TobiSGD for your detailed explanation. That clears out the purpose of initrd and grub's ability.

I presume this can be marked as resolved for now Cheers.
 
Old 09-26-2013, 08:15 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
chicken-Egg problem in booting sequence ashishravande Linux - Newbie 11 03-16-2013 11:43 AM
ppp, dnsmasq, dhcp: a triple chicken-and-egg problem hujuice Linux - Networking 1 04-14-2009 01:37 PM
compiler chicken and egg problem novasoy Linux - Newbie 4 06-24-2004 01:18 PM
I'm having a chicken (motherboard) and egg (video card) problem. mrwritestuff Linux - Hardware 3 10-06-2003 05:33 PM
Which came first...the chicken of the egg? ugenn Linux - Newbie 3 04-13-2002 09:17 AM

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

All times are GMT -5. The time now is 08:47 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
Open Source Consulting | Domain Registration