Boot Sequence
1. Bios決定開機的device(cdrom, hdd, usb hdd...,etc)
. bootloader
2. MBR : /boot/grub/grub.conf
. 開機分割區, 載入Kernel
3. Kernel
. 偵測H.W(電子訊號)
. 驅動
4. init
. /sbin/init
. /etc/inittab (以 id:X:initdefault: 決定mode)
. rc.sysinit
. rcX.d/*
. rc.local(S99)
5. 登入畫面
Grub
1. /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/xvda
password --md5 xxxxxxxx
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-92.el5xen)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.el5xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-92.el5xen.img
%password --md5 xxxx : 進入single user mode的passwd保護, 若passwd忘記了只能用救援光碟去救
設定md5的密碼, 以#grub-md5-crypt建立密碼, 插入在default上一列
%(hd0,0)指的是 kernel /的根 = /boot, 並以ro(readonly)進入
Lab1: 練習進入single user mode: '1' or 's'
Init initialization
[root@server118 ~]# cat /etc/inittab
#
# inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Author: Miquel van Smoorenburg,
# Modified for RHS Linux by Marc Ewing and Donnie Barnes
#
# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
----------------------------------------------
決定開機要進入何種模式,現為3, Multiuser mode
id:3:initdefault:
----------------------------------------------
# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
---------------------------------------------
在本機端是否使用ctrl+alt+delete重新開機, 如果不使用加上#, 註解
使用Kvm的情況, 有$M系列的Server, 建議註解掉, 以免不小心重開機
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
---------------------------------------------
# When our UPS tells us power has failed, assume we have a few minutes
# of power left. Schedule a shutdown for 2 minutes from now.
# This does, of course, assume you have powerd installed and your
# UPS connected and working correctly.
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
# If power was restored before the shutdown kicked in, cancel it.
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"
------------------------------------------------
# Run gettys in standard runlevels
co:2345:respawn:/sbin/agetty xvc0 9600 vt100-nav
1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
指定本機端的tty數量, 預設是6個tty
可自行新增, Ctrl+Alt+F8
8:2345:respawn:/sbin/mingetty tty8
------------------------------------------------
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
Previous post in this category: [雜記]RHCE筆記整理-RH133-Unit1(3)
Next post in this category: [雜記]RHCE筆記整理-RH133-Unit2(2)
[雜記]RHCE筆記整理-RH133-Unit2(3) - 2009
[雜記]RHCE筆記整理-RH133-Unit2(2) - 2009
【轉貼】駭客都是被逼出來的 - 2007
學習(2)
[雜記]RHCE筆記整理-考試綱要(2)












Recommend to Front page
Comment Permissions: Only members may comment. If you are not a PIXNET member, click here to sign up.