View previous topic :: View next topic |
Author |
Message |
batistuta Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Monkey Island/Monkey_Island_-_Lechuck3.gif)
Joined: 29 Jul 2005 Posts: 1384 Location: Aachen
|
Posted: Thu Apr 13, 2006 8:17 am Post subject: what on earth is an initrd? |
|
|
I don't get this thing
I understand that it is something (an actual kernel of some sort) that gets loaded before the actual kernel into a RAM disk. But what I don't get is: the thing gets loaded into a RAM disk. It initializes stuff (God knows what, I dont' get that part). Then does it load the actual kernel? If so, do they have to be the same kernels? Does the initrd kernel kill himself after? I would say either no, or both kernels have to be the same. Because otherwise would could end up with a situation that the first kernel recognizes some hardware and the second doesn't.
Does anyone have a good link? Thanks |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bin-doph Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/19876762173f66421e4e903.gif)
Joined: 23 May 2003 Posts: 302
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
batistuta Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Monkey Island/Monkey_Island_-_Lechuck3.gif)
Joined: 29 Jul 2005 Posts: 1384 Location: Aachen
|
Posted: Thu Apr 13, 2006 9:47 am Post subject: |
|
|
I did see this in the past (I'm not allergic to google), but it confused me. Let's disect it
Quote: | initrd provides the capability to load a RAM disk by the boot loader. |
OK, great. But what is exactly in that initrd file? Does it include a kernel? Since we anyway need to have a kernel image next to it, then we either have two kernel images (one outside and one in the initrd), or the initrd has no kernel image. In short: don't understand what the initrd has.
Quote: | 1) the boot loader loads the kernel and the initial RAM disk |
Great. Which kernel? What is inside the initial RAM disk that it loads?
Quote: | 2) the kernel converts initrd into a "normal" RAM disk and frees the memory used by initrd |
I've thought this RAM disk was loaded before. Now something gets converted to it? Which memory was being used by initrd that now is freed? This is as clear as quantum physics.
Quote: | 3) initrd is mounted read-write as root |
Are you kidding me? I've thought the initrd (whatever that is) was freed. Dead. Gone. Now it gets mounted?
Quote: | 4) /linuxrc is executed (this can be any valid executable, including shell scripts; it is run with uid 0 and can do
basically everything init can do) |
Finally something that I understand
Quote: | 5) linuxrc mounts the "real" root file system |
understand something++
Quote: | 6) linuxrc places the root file system at the root directory using the pivot_root system call |
Is this a fancy name for a chroot?
Quote: | 7) the usual boot sequence (e.g. invocation of /sbin/init) is performed on the root file system |
cool
Quote: | 8 ) the initrd file system is removed |
This is hilarious. This initrd guy is like Freddie Krugger, the bustard just doesn't wanna die! He keeps unloading himself, converting himself to all sort of mutant objects, removed, but he keeps popping back. This guy is my new nightmare
Anyone out there understand this? ![Rolling Eyes :roll:](images/smiles/icon_rolleyes.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lordsteff n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 30 Jun 2004 Posts: 12
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
batistuta Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Monkey Island/Monkey_Island_-_Lechuck3.gif)
Joined: 29 Jul 2005 Posts: 1384 Location: Aachen
|
Posted: Thu Apr 13, 2006 11:07 am Post subject: |
|
|
So if I understand correctly, the idea is something like this
- Grub loads the kernel image
- Mounts the initrd as root (which has some executables)
- Executes them
- Mounts the real files system
- Boot process keeps going
If this is correct, then there is only one kernel image. Right? The initrd is just like a temparoary root folder, with some executables, with an entry point and nothing else.
Now my pending question is: does an initrd that for example initializes evms, lvm or displays a gensplash image work with any kernel, or is there a tight link between the initrd and the kernel image?
I would guess that if the initrd initializes some SCSI controller as a module for the kernel, then this is kernel dependent. But if the initrd just mounts / from LVM, then the initrd is generic. Am I right?
thanks a lot for the links. The things slowly starts to make sense ![Very Happy :D](images/smiles/icon_biggrin.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|