Linux system study notes: running the system boot guide is to start the computer. The operating system cannot be used when the computer is started. it must be started by the boot program. During the boot process, the kernel is loaded into the memory and started to execute various initialization operations. then the system will be ready for use .... Info & Linux system study notes: running system boot guide means starting a computer. The operating system cannot be used when the computer is started. it must be started by the boot program. During the boot process, the kernel is loaded into the memory and started to execute various initialization operations. then the system can use it. Boot includes automatic boot and manual boot. During automatic boot, the system executes all the boot processes on its own. Manual guidance gives control to the user at a certain time. the computer is in single-user mode, and other users cannot log on to the system. The boot process can be divided into: loading and initializing the kernel. Detect and configure devices. Create a kernel process. Operator intervention (during manual guidance ). Run the system startup script. Run in multi-user mode. The Linux kernel is usually/vmlinuz, which is linked to/boot/vmlinuz-2.6.32-5-686 on Debian [1. The system first loads it into the memory during boot. The kernel executes memory detection to determine available RAM, and then allocates the memory volume in static mode. Next, the kernel searches for and initializes the devices in the kernel. After the basic initialization is complete, the kernel will create some spontaneous processes in the user space, because they are not created through the fork mechanism. You can use the ps-Af command to view the information, which is enclosed in brackets. After the spontaneous process is created, the kernel is finished, and the next task is completed by the init process. If guided in single-user mode, the system enters a special logon mode. Enter the root password to enter a root shell. you can also press ^ D to skip the single-user mode and continue the boot. Next, execute the system startup script in a certain order. if a graphical interface is installed and a graphical logon system is set, it will enter and wait for the user to log on. When a computer starts, it first loads the MBR starting with the disk. it is a 512-byte segment, which tells the computer where to boot and loads the boot loader. then, the boot loader is responsible for loading the kernel. Currently, GRUB is the most commonly used boot loader in Linux, and LILO was used in the past, but it is not as powerful as GRUB and is rarely used now. Startup scripts are shell scripts. different Linux systems have different ways of organizing them. Generally, the startup script sets the computer name. Set the time zone. Use fsck to check disks. Install the system disk. Delete old files from/tmp. Configure the network. Start the daemon process and network service. If the file system is uninstalled normally, the fsck check is automatically skipped. Init defines 7 running levels: 0 to the system shutdown level. Level 1 is the single-user mode level. Level 2-5 is the multi-user mode level. Level 6 is the reboot level. Level 0 and level 6 are special. the system cannot stay in these two levels. most systems run at level 2 or level 3. The/etc/inittab defines what init should do at each running level, that is, the command to be run at each level. The default running level of Debian is 2, which can be modified. Id: 2: initdefault: you can use the telinit command to enter a specific running level. The startup script is placed under/etc/init. d/. these scripts can be run using the start and stop parameters, and some support restart. When the system starts the script, it does not directly find it in this path, but searches for/etc/rcN. d/(the level of N is 0-6 ). /Etc/rcN. d/contains the symbolic links to the startup script. they all start with S or K. When init is transitioned from low to high by running level, run the script with the start parameter at each level starting with S. during the transition from high to low, run the script with the stop parameter at each level starting with K. Debian configuration information is scattered. The host name of the system is in/etc/hostname, and the network interface and default gateway are in/etc/network/interfaces. Debian has a launch script hypervisor update-rc.d. Shutdown is the most perfect way to stop or reboot the system. You can specify a time and an optional message notification for shutdown. Use-h and-r to specify whether to stop or reboot, and use-F or-f to force or skip the fsck check. Shutdown-h calls the halt command, which can also be used independently to execute the basic task of shutting down the system. Halt will execute the sync system call. you can use the-n option to not execute sync, which is mainly used after fsck repair. Shutdown-r calls the reboot command, which is similar to halt. The difference is that it restarts the machine and supports the-n option. The poweroff command is equivalent to halt, but it also requests to turn off the main power (on a system with this function ).
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.