1.启动过程:
The bootprocess involves several files and errors in these files is the usual cause of
bootproblems.
启动进程调用几个文件并在这几个文件中发生的错误通常是启动问题的原因。
系统启动后执行的操作:
1. Thecomputer‘s BIOS performs a power-on self-test (POST), and then locates andinitializes any
peripheraldevices including the hard disk.
电脑 BIOS执行上电自检(POST), 然后,定位和初始化周边设备包括硬盘。
2. TheBIOS reads the Master Boot Record (MBR) into memory from the boot device. (ForGUID Partition
Table(GPT) disks, this MBR is the protective MBR on the first sector of the disk.)The MBR stores
informationabout the organization of partitions on that device. On a computer with x86architecture,
the MBRoccupies the first 512 bytes of the boot device. The first 446 bytes containboot code that
points tothe bootloader program, which can be on the same device or on another device.The next
64 bytescontain the partition table. The final two bytes are the boot signature, whichis used for error
detection.The default bootloader program used on Oracle Linux is GRUB, which stands forGRand
UnifiedBootloader.
BIOS从启动设备读取主启动记录(MBR master boot record)到内存。(对于GUID 分区表磁盘(GPT磁盘),MBR是在第一磁盘扇区的保护MBR)MBR存储关于设备分区组织信息。在一个 x86构架的电脑上,MBR占用启动设备的第一个512字节。前面446个字节包含指向bootloader程序的启动码,它可以在相同的设备或者不同设备。下面64字节包含分区表。最后2个字节是启动签名,用于错误检测。默认用在oracle linux上的bootloader程序是GRUB, 代表GrandUnified Bootloader.
什么是GUID?
全局唯一标识符(GUID,GloballyUnique Identifier)
是一种由算法生成的二进制长度为128位的数字标识符。
GUID 的格式为“xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”,其中每个 x 是 0-9 或 a-f范围内的一个4位16进制数。
3. TheGRUB bootloader loads the Oracle Linux kernel into memory.
GRUB加载kernel到内存
4. Thekernel initializes and configures the system hardware.
kernel初始化并配置系统硬件
5. Thekernel reads the initramfs file, extracts its contents into a temporary,memory-based file system
(tmpfs),and loads the modules that the file system contains.
kernel读取 initramfs文件,提取其内容到临时,基于内存的文件系统(tmpfs),并加载文件系统包含的模块。
6. Thekernel starts the /sbin/init process with a process ID of 1 (PID 1). init isthe ancestor of all
processeson a system. init reads its job configuration from the /etc/init directory. The/etc/
init/rcS.conffile controls how init handles system initialization.
kernel使用进程号1开始/sbin/init进程。 init是所有系统进程的祖先。init会从/etc/init目录读取它的job配置文件。/etc/init/rcS.conf文件控制init怎么样处理系统初始化。
7. initreads /etc/inittab to determine the default run level. The entry in/etc/inittab should
take theform id:N:initdefault:, where N is the default run level. If the file does notdefine a
defaultboot level, the default run level is 3.
init读取/etc/inittab决定默认的运行级别。/etc/inittab应该按照这种格式:id:N:initdefault:
8. initruns /etc/rc.sysinit to initialize thesystem, including:
settingthe host name
initializing the network
mounting the /proc file system
initializing SELinux based on its configuration
printing a welcome banner
initializing the system hardware based on kernel boot arguments
mounting the file systems
cleaning up directories in /var
starting swapping
init运行/etc/rc.sysinit来初始化系统,包括:
设置主机名
初始化网络
挂载/proc文件系统
初始化selinux
打印欢迎标语(/etc/motd)
初始化基于kernel启动参数的系统硬件
挂载文件系统
清理/var目录
启动swaping
9. initexecutes scripts in the /etc/rcX.ddirectory to bring the system to the default run level, X. The
/etc/init/rc.conffile controls how init starts individual run levels. See Section 4.3, “AboutRun
Levels”and Section 4.3.4, “About Service Scripts”.
init执行/etc/rcX.d目录中的脚本来把系统带到默认的运行级别。
/etc/init/rc.conf文件控制init怎么样启动单独的运行级别。
10. initruns any actions that you have defined in /etc/rc.local.
init运行执行/etc/rc.local的语句
本文出自 “小V运维之路” 博客,请务必保留此出处http://victor2016.blog.51cto.com/6768693/1897356
原文:http://victor2016.blog.51cto.com/6768693/1897356