CentOS run level and boot process

Source: Internet
Author: User

One, the Linux operating level

1) 0: Shutdown

2) 1: Single User

3) 2: Multi-user status No NETWORK service

4) 3: Network Service with multi-user status

5) 4: The system is not used reserved to the user

6) 5: Graphical interface

7) 6: System restart

Note: The common runlevel is 3 and 5, to modify the number in the Id:5:initdefault that the run level can be changed to file/etc/inittab.

Second, forget the root password solution

when the machine starts, enterGrubWhen you boot the program, presse, and then select alabel=(usually the second line), and then click on ae, enter a1, s or single can be, (change the run level to1then enter the stand-alone mode, you can directly modify the root password, after the completion of the system restart, you can modify the original configuration file.

Third, Linux boot process detailed

1) load The BIOS, when you turn on the computer power, the computer will first load the BIOS information,the BIOS contains the CPU and other hardware -related information, the device boot sequence is hard disk information, memory information, PnP features, and so on. So the computer knows which hardware device to read.

2)ReadMbr, it is well known that the disk section0The first sector of the track is calledMbr(Master Boot Record), which is the master boot record, the size of which is512bytes, which contains pre-boot information, partition table information. System foundBiosThe specified hard diskMbr, it will be copied to the0x7c00the physical memory in which the address resides. The content of memory isBoot Loader, and specifically to your computer, that isLiloorGrubup.

3) Boot Loader: This is a small program that runs before the operating system kernel. Usually this small program, we can initialize the hardware device, set up a map of the memory space, so as to bring the system's hardware and software environment to a suitable state, in order to finally call the operating system kernel ready to do everything. Boot LoaderThere are several kinds, the most commonly used areGrub,Liloand theSpfdisk. LikeGrub, the system reads the memoryGrubconfiguration information (typicallyMenu.lst, orGrub.lst), and follow this configuration information to start a different operating system.

4) load kernel: Based onGrubset the path of the kernel image, the system reads the memory image and does the decompression operation. At this point, the screen will generally output "Uncompressing Linux"prompt. When the decompression core is complete, the screen output "Ok,Booting the kernel". The system places the extracted kernel in memory and calls theStar_kernel() function to start a series of initialization functions and initialize various devices to completeLinuxthe establishment of the core environment. At this point,LinuxThe kernel has been set up, based onLinuxprogram should work correctly.

5) User LayerInitbased onInittabfile to set the RunLevel: After the kernel is loaded, the first running program is/sbin/init, the file reads/etc/inittabfile and initialize it according to this file. Actually/init/inittabThe main function of a file is to setLinuxThe operating level, which is set in the form ":Id:5:initdefault:", this showsLinuxneed to run on a level5on. Operating level See 1.

6) InitProcess ExecutionRc.sysinit: After setting the operating level,Linuxthe first user-level file that the system executes is/etc/rc.d/rc.sysinitScripting It does a lot of work, including settingPath, set the network configuration (/etc/sysconfig/network), startSwapPartitioning, setting/procand so on.

Boot kernel module: The specific is based on the /etc/modules.conf File or /etc/modules.d Files in the directory to load the kernel modules.

&NBSP, Scripts that perform different runlevel: Depending on the runtime, the system runs RC0.D to rc6.d

9) execute /etc/rc.d/rc.local:rc.local is the place where Linux is left to the user to personalize after all initialization work . You can put the things you want to set up and start up here.

Execute /bin/login program, enter login status: At this time, the system has entered into waiting for user input username and password , you can already log into the system with your own account.


This article is from the Linux Technical Exchange blog, so be sure to keep this source http://9678130.blog.51cto.com/9668130/1769717

CentOS runlevel and boot process

Related Article

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.