文档介绍:Linux 引导过程及服务
Boot Sequence Overview
BIOS 电脑打开电源时就会进入BIOS,主要监测CPU,Memory,风扇等
MBR Boot loader
在磁盘的第1个磁区共512bytes,其中前446bytes用于选择启动的bootPartition载入开机的程式码
Kernel 载入作业系统的Kernel
主要载入驱动程式并以Read only的方式来挂载flash FileSystem
也就是一开始只能读到flash根目录的哪个parition 如:
如: Device Mount Point/RAID/Volume Type Format
/dev/sda1 /boot ext3
/dev/sda2 / ext3 只认识这个parition
/dev/sda3 /home ext3
所以/,/etc,/bin,/sbin,/dev,/lib必须在同一个paraition
init 是linux第1个执行的程式 ps -xo pid,cmd
[******@cluster2 ~]# ps -xo pid,cmd
PID CMD
1 init [3]
2 [migration/0]
init会根据Run level执行下边这些程序
/etc/ 实际第1个执行程序
/etc/ and /etc/*.d 实际第2个执行程序
/etc/ 实际第3个执行程序
X display Manager if appropriate
一、BIOS initalization
Peripherals detected 自我监测Power on self test(POST)
Boot device selected BIOS选择由什么设备来引导,可以选择硬盘,光盘等
First sector of boot device read and executed 读取指定引导设备的第1个磁区(MBR)
二、MBR Boot loader
可以安装在2个地方,MBR或第1个partition的Boot Sector上,如下面
Boot Loader: 多重系统引导
- small,resides in MBR or boot sector 只446bytes可存储在MBR或boot sector
- loaded from boot partition 启动码是存储在哪个partition的boot里面
实例1: 通过MBR引导
载入MBR前446个bytes
进入GRUB,进入引导选择菜单
c. 载入选择系统的Kernel
实例2:通过Boot Loader引导
首先会进入MBR,但MBR被SPFDisk占用了
会找到boot partition通过Boot Loader载入
进入GRUB的选择菜单
载入所选择系统的Kernel
GRUB and
从MBR到Kernel最后到init都是由GRUB所负责的
在最上面可以看到GRUB的version number
GRUB有以下几个特性:
Command-line interface available at boot prompt
按下C键就能进入以grub开头的提示符来输入命令
Boot from ext2/ext3,ReiserFS,JFS,FAT,minix,or FFS filesystems
Supports MDB5 password protection
/boot/grub/ 文档路径
Changes on will go into defect immediately
If MBR on /dev/had is corrupted,reinstall the first stage bootloader with:
/sbing/grub-install/dev/had
如果GRUB被删除掉,可以通过上面的路径通过reinstall进行安装
文档内容
进行文档备份:
[******@cluster2 ~]# vim /boot/grub/
# generated by anaconda
#
# Note that you do not have to r