LinuxQuestions.org
Visit Jeremy's Blog.
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, 08: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, 08:08 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
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, 10: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-26-2013, 12:06 AM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
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-26-2013 at 12:09 AM.
 
Old 09-26-2013, 01: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, 09:15 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
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


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
chicken-Egg problem in booting sequence ashishravande Linux - Newbie 11 03-16-2013 12:43 PM
ppp, dnsmasq, dhcp: a triple chicken-and-egg problem hujuice Linux - Networking 1 04-14-2009 02:37 PM
compiler chicken and egg problem novasoy Linux - Newbie 4 06-24-2004 02:18 PM
I'm having a chicken (motherboard) and egg (video card) problem. mrwritestuff Linux - Hardware 3 10-06-2003 06:33 PM
Which came first...the chicken of the egg? ugenn Linux - Newbie 3 04-13-2002 10:17 AM


All times are GMT -5. The time now is 04:43 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