|
Linux boot process:
power on ----> BIOS POST, according to the boot sequence ----> MBR ----> grub (stage2) ---> / boot / grub / grub.conf -----> ramfs load the kernel and file system ---> init ----> read / etc / inittab, etc. /etc/rc.sysinit execute a script file ------> according to / etc / inittab in the run level to enter /etc/rc*.d directory, start inside the service (s beginning is to start) -------> start the login program
BIOS is the basic input output system (Basic Input Output System) for short, is the computer the most basic, the most important program stored in the Flash ROM on the motherboard.
BIOS power-on self test will check whether there are memory, CPU, motherboard and other hardware error, after the error will be handled in two situations: For severe failure (fatal fault) is shut down, this time due to various initialization operations yet complete, and then not give hints or signals; non-critical fault is given tips or audible alarm signal, waiting for users to handle. Booting the Operating System: BIOS floppy or hard disk will start to read the boot sector of the start of the recording, if not found, will be displayed on the display device does not boot, if you find the right took control of the computer to guide the recording process.
----------------- Boot into the BIOS, the boot screen will first be prompted -------------------
Desktop --- "del
Notebook - "is not the same brand in different keys, F1, F2, F8, F12, etc.
Server --- "F1
Start BIOS: curing the chip on the motherboard
POST (power on self test) System Check: Check the core hardware is working correctly
Device Initialization: initialize the driver, allocate resources
The boot device selection: optical drive, hard disk or PXE boot
The transfer of the execution area: loading the boot device first sector (512 bytes)
Introduction -------------------- ----------------- BIOS
Acronym Input / Output System
Store basic computer hardware information
Not arbitrarily swap
-------- ------------- -------------- BIOS Role
POST
initialization
Booting the Operating System
------------------------ BIOS and CMOS relationship? -----------------------------------------
bios is a program, CMOS is a chip stored data, bios will start to read the CMOS data. Usually we bios configuration parameters, when there is the CMOS.
CMOS often refers to the computer to save the basic startup information (such as date, time, startup settings, etc.) chips. Sometimes people will say mixing CMOS and BIOS, CMOS is a fact on the motherboard
Block read-write RAM chip is used to store the BIOS hardware configuration and user settings of certain parameters.
------------------ Computer where you can set which password? What role? ------------------------
BIOS password -> prevent others from setting into the system boot from the U disk or network
grub password ---> break the password to prevent
System password -> prevent others into the system
------------------ The display information Troubleshooting --------------------------- ---------------------
POST information, including detection and error process
Displayed when the computer starts "CMOS battery failed"
Motherboard battery power is low, the battery needs to be replaced
Display "Floppy disk s fail Press F1 to Continue, Del to setup when the computer starts
Unable floppy drive, press the F1 key to continue
Troubleshooting according to an alarm tone
According to the alert voice recognition hardware failure
Buzzer sounding
Memory errors, clean up the dust, or replace a slot
PXE (preboot execute environment) is the latest technology developed by Intel Corporation, working in network mode on Client / Server,
Support workstation through the network to download images from a remote server, and thus support the operating system boot process from the network, the launch process,
Terminal requires server to assign IP addresses, and then TFTP (trivial file transfer protocol) or MTFTP (multicast trivial file
transfer protocol) protocol to download a software package to start the machine's memory and executed by the terminal to complete the basic software package startup settings,
Thereby guiding terminal operating system pre-installed in the server.
MBR (Master Boot Record Boot Record), also known as the master boot sector
Bootstrap
LILO (eliminated)
GRUB is the GNU project sponsor
Two sessions boot program
stage1: it is bootloader (MBR 446 bytes in the program). The first stage is only used to locate the second stage boot loader program, stage1 stage2 of the address
stage2: The second stage refers to the boot program itself will run some applications and read the corresponding configuration information, a lot of drive
stage1.5: a bridge between stage1 and stage2 because stage1 does not recognize the file system format, you need to guide Stage1.5 located in a file system among stage2
/ Boot directory stage1, stage1.5, stage2 are backed up, to prevent the destruction of grub, the program can be used to repair grub
Normal order from stage1 ---> stage2
If the grub had been destroyed, the boot sequence stage1 -> stage1.5 ---> stage2
------------- Extracting image image file to view the contents inside. ------------------------------------
[Root @ station initramfs] # mkdir / initramfs
[Root @ station initramfs] # cp /boot/initramfs-2.6.32-279.el6.i686.img / initramfs /
[Root @ station initramfs] # file initramfs-2.6.32-279.el6.i686.img
initramfs-2.6.32-279.el6.i686.img: gzip compressed data, from Unix, last modified: Fri Mar 1 09:27:07 2013, max compression
[Root @ station initramfs] # gunzip < initramfs-2.6.32-279.el6.i686.img> inittramfs.img
[Root @ station initramfs] # cpio -iv < inittramfs.img
[Root @ station initramfs] # ls
bin dracut-004-283.el6 init initqueue-settled inittramfs.img pre-pivot proc sysroot var
cmdline emergency initqueue initqueue-timeout lib pre-trigger sbin tmp
dev etc initqueue-finished initramfs-2.6.32-279.el6.i686.img mount pre-udev sys usr
[Root @ station fs] # pwd
/initramfs/lib/modules/2.6.32-279.el6.i686/kernel/fs
Kernel likened the emperor, img file is equivalent to the emperor provide a place to live, ministers, military and other components a court
Kernel drivers too much, img file is loaded into memory when a temporary root file system, there are a lot of drivers that can drive the other important equipment.
initrd (initial ramdisk)
ramdisk - "virtual memory disk via the software portion of memory (RAM) to simulate a technique used for the hard disk.
Kernel drivers too much, img file is loaded into memory when a temporary root file system, there are a lot of drivers that can drive the other important equipment.
--------- Bootstrap function ---------------------
Write kernel command line
Loading virtual disk initialization
The control to the Linux kernel
GRUB configuration menu item
title Red Hat Enterprise Linux Server (2.6.18-164.el5)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-164.el5 ro root = LABEL = / rhgb quiet
initrd /boot/initrd-2.6.18-164.el5.img......
title: menu name
Location and kernel boot parameters kernel file: kernel
initrd: The initial position of the virtual disk
[Root @ station initramfs] # vim / etc / inittab
# System initialization is started by /etc/init/rcS.conf
Use system initialization
# Individual runlevels are started by /etc/init/rc.conf
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
Is the system boot process by pressing Ctrl-Alt-Delete to reboot the system
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
Open tty virtual console (tty1-tty6)
# With configuration in / etc / sysconfig / init.
. # Default runlevel The runlevels used are:
# 0 - halt (Do NOT set initdefault to this) Shutdown
# 1 - Single user mode single-user mode, break the password when entering this mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking) multi-user mode, but you can not use the NFS function
# 3 - Full multiuser mode character interface
# 4 - unused
# 5 - X11 graphical interface
# 6 - reboot (Do NOT set initdefault to this) Restart
id: 5: initdefault:
[Root @ station initramfs] # runlevel Checking runlevels
N 5 to N represents the front directly into the graphical interface
35 means that the incoming character interface 3
------- Vim /etc/rc.d/rc.sysinit (system initialization file) ------------------
Called for execution by the init process
Initialise network settings, hostname, load the file system, etc.
Get network environment and host type
Set the system time (clock)
......
In FSCK test disk file system
Re-write mode to read and loaded into the system disk
......
Clear temporary files during startup
Will start the relevant information is loaded into the / var / log / dmesg file
Either run level at boot executes /etc/rc.local
System startup hardware information
dmesg | more
/ Var / log / dmesg file
Both places you can see the last system startup hardware information
dmesg --- "/ var / log / dmesg record boot open information
[Root @ teacher vnc] # dmesg | grep Eth View card information
[Root @ teacher vnc] # dmesg | grep eth eth view related information, boot boot time
/etc/rc.d/rc.sysinit
Called for execution by the init process
Initialise network settings, hostname, load the file system, etc.
/etc/rc.d/rc script file
Called for execution by the init process
Depending on the operating level specified load or termination of the respective system service
Red Hat Enterprise Linux service scripts located in /etc/rc.d/init.d
/etc/rc.d/rcn.d directory
Symbol contains runlevel n Implementation Service configuration state connection
===========
/etc/rc.d/rcn.d directory
Symbol contains runlevel n Implementation Service configuration state connection
The control system will automatically start or stop in the appropriate run-level service
Symbolic link name: Lddservice_name
L: K or S; means to stop or start the service
dd: two digits; indicates start or stop the service order
[Root @ station rc3.d] # ls | grep httpd
K15httpd
[Root @ station rc3.d] # chkconfig --list httpd
httpd 0: off 1: off 2: off 3: off 4: off 5: off 6: off
[Root @ station rc3.d] # chkconfig --level 3 httpd on
[Root @ station rc3.d] # ls | grep httpd
S85httpd |
|
|
|