In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to master the Linux initrd system". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to master the Linux initrd system.
Define the path to the home directory (root)
The mkrootdev instruction is a function provided by nash, a shell. The main function is to define the home directory clearly before the conversion, and the xxx path in the root=xxx set by kernel command line in GRUB will be established by default.
Mount the root path to / sysroot and mount the newly found root path to / sysroot in Linux initrd, but note that / sysroot is like the / mnt/sysimage directory of rescue mode, meaning the same thing, only to mount the entity path that exists in the entity operating system to a temporary directory of the virtual operating system (in this case, initrd), and then switch to the home directory of the entity. The difference is that chroot; is used in rescue mode but switchroot instructions are used in Linux initrd. The reason for this difference is that rescue mode uses instructions from the operating system directly, while initrd does not have instructions from the operating system when it is loaded, so it is through the instructions built in nash. Some people may ask, isn't rescue mode also loaded in the way Linux initrd? Yes, but I would like to add here that although they are all Linux initrd, the initrd in rescue mode is provided directly by CD-ROM, while the Linux initrd here is directly generated by the operating system after the operating system is installed. There are many differences between the two. If you are interested, you might as well open the initrd file of the CD (figure 4-45), and you will find that the init file in the Linux initrd is not a script file, but a program that can really be executed under the operating system.
Of course, the Linux initrd files stored in CD or DVD are used for users to install the operating system, and will encounter many different software and hardware requirements, so the initrd files need to store much more data (like module) than the Linux initrd files that the operating system needs to load. The initrd files on the Fedora Core 6 installation CD in figure 4-46 are almost four times as many as the initrd files on the operating system.
Set up other file systems
After the construction of the home directory (/ sysroot in the initrd phase), the setuproot instruction starts to run and transfer all the information in the / proc, / sys, / de directories established by Linux initrd through init to / sysroot, in order to facilitate the conversion to the new physical operating system, which is also a built-in feature of nash, but the author in the nash user manual can not find any description of setuproot, I do not know why only missed this one.
Change to the new root directory and start executing the init file on the physical system
Switchroot is a new feature that can only be used by nash after version 2.6. just after setuproot has established all the directories related to the operating system in / sysroot, setuproot will change / sysroot to the home directory under the physical operating system (/). After completion, it will empty all the data stored in the memory of the previous Linux initrd, just like all the data in the virtual file system (including / sys, / proc or / dev, etc.), so When the switchroot execution is complete, there will be no directories and files created by Linux initrd in memory and will be run entirely by the physical operating system.
At this point, I believe that you have a deeper understanding of "how to master the Linux initrd system", you might as well come to the actual operation! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.