Linux system startup (1) and linux system startup

Source: Internet
Author: User

Linux system startup (1) and linux system startup
This article uses Centos as an example to describe the entire Linux system startup process, including grub boot, initramfs process, and the general process of executing rc. sysinit and rc in/sbin/init.

In addition, this article provides an example to illustrate how to run the entire operating system in the memory (the system uses a physical disk storage operating system by default ).

1 Overview

From the software perspective, the process of starting a Linux system is as follows:

1) hardware and BIOS loading. Find the MBR through the startup Item and read the boot loader in the MBR, which is our commonly used grub tool.

2) boot loader, load kernel (vmlinux) and initramfs through the root device specified (such as grub. conf), and run init in initramfs.

3) switch to the real root fs, execute/sbin/init, and execute rc. sysinit.

4) run the service script under/etc/rc3.d.

For more information about what rootfs is, see [1.

[1]: What is the root file system (rootfs) http://www.crifan.com/what_is_root_filesystem/

2 grub

Grub startup parameters, such as title and timeout, are not described here when google searches for them.

Grub also plays a role in transferring parameters to the kernel when the kernel is started, for example, our common root = ..., It is the device that transmits the real root fs to the kernel, that is, the root device.

Other parameters that can be passed to the kernel, specific reference in the kernel source code directory has a document to describe its role: Documentation/kernel-parameters.txt (internal core src. rpm, after installing the source package, its kernel source code in/root/rpmbuild/BUILD/kernel-2.6.32-71.el6/linux-2.6.32-71.el6.x86_64 /).

The function is equivalent to modifying the corresponding parameter values under/proc/sys/kernel/. Take/proc/sys/kernel/panic as an example.

[Root @ localhost ~] # Cat/proc/sys/kernel/panic

0

[Root @ localhost ~] # Vim/boot/grub. conf

......

Root (hd0, 0)

Kernel/boot/vmlinuz-2.6.32-71.el6.5.vsds.x86_64 ro root = UUID = export rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG = en_US.UTF-8 SYSFONT = latarcyrheb-sun16 KEYBOARDTYPE = pc KEYTABLE = us panic = 2

Initrd/boot/initramfs-2.6.32-71.el6.5.vsds.x86_64.img

......

[Root @ localhost ~] # Reboot

[Root @ localhost ~] # Cat/proc/sys/kernel/panic

2

For more information, see [2].

[2]: acceptable parameters in the linux Kernel | pass parameters to the kernel through grub

Next we will talk to our friends about initramfs, and modify the system from running on disk to running on ramdisk by modifying initramfs.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.