Answer the question
In order to leave comments, you need to log in
Why do Linux boot options from initrd use the root option?
I don’t understand why the kernel is loaded with the initrd and root parameters in any bootloader. As it is written everywhere, initrd is a virtual file system that is loaded by the kernel into memory and mounted to the root at the initial boot stage. Then a script is executed there, which mounts the real root partition. As I understand it, all information about the "real" root should be in this script, then for what purpose is the root section specified in the boot parameters? This information is needed by the kernel, in fact, only when initrd is not used and the root is mounted using modules.
Answer the question
In order to leave comments, you need to log in
for what purpose in any bootloader the kernel is loaded with the initrd and root parameters.
To be honest, I don't understand why you have to make it so difficult at all. For mounting an initrd is no easier than mounting a disk root system, because in any case you need to mount it. And it is also unclear why the script is so - and, accordingly, its interpreter.
The command "mount read-only root partition" - can be issued from the bootloader, it will also pass all the parameters, i.e. will do the work that the mount program normally does.
Keeping two instances of the root system on disk (one for loading into RAM, one for normal operation) is not a good idea.
It is possible not to use initrd, this is quite normal when you work on the same hardware. But, if you need to run on any hardware, then you will have to put all the modules of all possible variants of the hardware from which you need to boot into the kernel, it makes no sense to keep such a large kernel in memory, which is why an intermediate stage was created when loading, when all these modules are placed in initrd. .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question