• Day 2 虚拟机安装,操作系统启动流程


    Day 2 虚拟机安装,操作系统启动流程

    Virtual machine installation

    一 硬件启动

    1.打开电源

    turn on the power

    2.POST自检

    POST(Power on Self Test)

    From the system firmware, which can be the modern Universal Extended Firmware Interface (UEFI) or the classical Basic Input Output System (BIOS), the Power-On Self-Test (POST) is executed, and the hardware that is required to start the system is initialized.

    初始化硬件设备,检查系 统硬件设备(CPU、内存条、硬盘、键盘、鼠标)

    3.检查设备启动顺序

    MBR

    MBR(Main Boot Record)是硬盘的0柱面,0磁道、 1扇区(第一个扇区),称为主引导扇区,也称为主引导记 录。它由三部分组成:主引导程序(BootLoader)、硬盘分区 表DPT(Disk Partition table)和硬盘有效标志 (55AA)

    Master Boot Record (MBR) is the first 512 bytes of the boot drive that is read into memory by the BIOS. The next 64 bytes contain the partition table for the disk. The last two bytes are the “Magic Number” which is used for error detection.

    4.执行MBR的BootLoader

    Loading the boot loader (GRUB2)

    GRUB stands for GRand Unified Bootloader.

    The GRUB 2 configuration file is located at /boot/grub2/grub.cfg

    加载两个镜像(boot.img, core.img),再加载MOD模块文件,把grub2程序加载执行,接着解析配置文件/boot/grub/grub.cfg,根据配置文件加载内核镜像到内存,构建临时根文件系统

    5.系统内核引导 Loading the kernel

    加载内核、驱动,切换到真正的根文件系统,执行初始化程序/usr/lib/systemd/systemd

    6.Starting systemd systemd初始化阶段

    执行默认运行级别并准许操作系统启动本机基础服务、执行/etc/rc.d/rc.local文件中用户自定义的脚本,最后出

    现系统登录的界面。

    二 系统启动级别 Comparision of SysV Run Levels and Target Units

    Runlevel0

    Shut down and power off 关机状态

    Runlevel1

    Set up a rescue shell 单用户,用于系统维护,禁止远程登陆

    Runlevel2,3,4

    Set up a nongraphical multi-user shell 多用户状态

    Runlevel5

    Set up a graphical multi-user shell 图形模式多用户状态

    Runlevel6

    Shut down and reboot the system 系统正常关闭并重启

     

    三 单用户模式 Single user mode

    First restart your CentOS 7 machine, once boot process starts, wait for the GRUB boot menu to appear as shown in the screen shot below.

    Next, select your Kernel version from the grub menu item and press e key to edit the first boot option. Now use the Down arrow key to find the kernel line (starts with “linux16“), then change the argument ro to rw init=/sysroot/bin/sh as shown in the screen shot below.

    Once you have finished the task in the previous step, press Ctrl-X or F10 to boot into single user mode (access an emergency shell).

     

  • 相关阅读:
    Flink之DataStreamAPI入门
    Spark底层原理简化版
    Spark调优
    Flink架构及其工作原理
    Kafka总结
    leetcode数学相关
    程序员的修炼之道5
    数据库连库建表
    完成了web系统
    即将完成大型web系统
  • 原文地址:https://www.cnblogs.com/fengshili666/p/14118842.html
Copyright © 2020-2023  润新知