教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 文库大全 > 高等教育 >

linux入门篇--系统启动流程

来源:网络收集 时间:2026-07-16
导读: linux入门篇,讲诉系统启动流程,学习linux系统核心 系统启动流程 2011年10月31日 21:13 系统启动流程:系统 故障 排除 重点: grub程序 分区表的备份 系统初始化文件 服务启动方式 难点: kernel参数 映像文件 驱动加载/卸载 rhel5: bios( 主板芯片 ) 小程

linux入门篇,讲诉系统启动流程,学习linux系统核心

系统启动流程

2011年10月31日

21:13

系统启动流程:系统 故障 排除

重点: grub程序 分区表的备份 系统初始化文件 服务启动方式

难点: kernel参数 映像文件 驱动加载/卸载

rhel5:

bios( 主板芯片 ) 小程序

机器加电 -----硬件状态

------------------------------------

|

|

分区表放在硬盘最前面的512B

----------------------------------------------------------

|446B启动引导程序|64B分区表(16*4)|55AA|

----------------------------------------------------------

|

|

--------------------------------------

grub---启动管理器

引导操作系统

加载kernel+initrd映像文件

挂载root系统

----------------------------------------------------------

启动linux第一进程 init pid=1

------------------------------------------------------------------------

初始化配置文件=/etc/inittab

-----------------------------------------------------------

login user password

---------------------------------------------------bash-----shell----startxinittab:

运行级别

id:3:initdefault:

用户自定义

[root@station79 etc]#chkconfig httpd on

[root@station79 etc]# chkconfig --list | grep httpd

httpd 0:关闭1:关闭2:启用3:启用4:启用5:启用6:关闭

[root@station79 etc]# chkconfig httpd off

[root@station79 etc]# chkconfig --list | grep httpd

httpd 0:关闭1:关闭2:关闭3:关闭4:关闭5:关闭6:关闭

[root@station79 etc]# chkconfig --level 3 httpd on

[root@station79 etc]# chkconfig --list | grep httpd

httpd 0:关闭1:关闭2:关闭3:启用4:关闭5:关闭6:关闭

[root@station79 rc5.d]# ls *httpd

K15httpd

[root@station79 rc3.d]#ls *httpd

S85httpd

S 55 sshd

start 序号 服务名

K 15 httpd

kill 序号 服务名

------------------------------------------------------

grub--------->第一个可执行程序()

linux入门篇,讲诉系统启动流程,学习linux系统核心

grub配置文件:/boot/grub/grub.conf

rhel5.5:/boot/grub/grub.confroot (hd0,0)

root:表示kernel+initrd分区名

hd 0 , 0

硬盘 编号 分区号hd ide(特例 grub不做区分 不分sd和hd)sd scsi

里面的sd0,0指的是sda,1

kernel文件名 readonly 文件系统根 图形显示启动过程kernel /vmlinuz-2.6.18-194.el5roroot=/dev/vg79/lv79rhgb

quiet不显示kernel加载详细信息

不是指系统根,是由root (hd0,0) 定义来的

initrd /initrd-2.6.18-194.el5.img

10 default=0 title的序号

11 timeout=5

12 splashimage=(hd0,0)/grub/splash.xpm.gz 背景图 .xpm格式

13 hiddenmenu 隐藏菜单

14 title Red Hat Enterprise Linux Server (2.6.18-194.el5)

grub有选择运行级别方式(grub 管理界面 kernel参数 设 本次)

1.手动引导kernel

2.破解linux root密码

单用户模式 single或者1

按b启动

可以修改密码或一些其他操作

[root@station79 ~]#cd /boot/grub/

[root@station79 grub]#grub-md5-crypt md5的形式生成grub密码 密文方式

Password:

Retype password:

linux入门篇,讲诉系统启动流程,学习linux系统核心

Retype password:

$1$ptBdF0$m/NZndotAxURC2NSaA9kH0

[root@station79 grub]# vim grub.conf

password --md5 $1$ptBdF0$m/NZndotAxURC2NSaA9kH0

如果写在title下面就是进入系统的时候也需要密码可以另外生成也可以使用此密码 写在如图的位置就是进入grub时需要密码

此时想进入grub修改例如单用户等信息的时候

需要按P输入刚才的密码才可以进入e的修改模式来进入单用户或者使用grub引导等!

[root@station79 boot]# file vmlinuz-2.6.18-194.el5

vmlinuz-2.6.18-194.el5: ELF 32-bit LSB shared object, Intel 80386, version 1, stripped

[root@station79 boot]# file initrd-2.6.18-194.el5.img

initrd-2.6.18-194.el5.img: gzip compressed data, from Unix, last modified: Mon Aug 15 14:51:23 2011, max compression 为kernel启动提供必要的驱动

initrd在自己编译内核时可以不用

[root@station79 share]# cp /boot/initrd-2.6.18-194.el5.img /share/

[root@station79 share]# ls

initrd-2.6.18-194.el5.img

[root@station79 share]#mv initrd-2.6.18-194.el5.img initrd-2.6.18-194.el5.img.gz

[root@station79 share]# ls

initrd-2.6.18-194.el5.img.gz

[root@station79 share]# file initrd-2.6.18-194.el5.img.gz

initrd-2.6.18-194.el5.img.gz: gzip compressed data, from Unix, last modified: Mon Aug 15 14:51:23 2011, max compression

[root@station79 share]# gunzip initrd-2.6.18-194.el5.img.gz

[root@station79 share]# ls

initrd-2.6.18-194.el5.img

[root@station79 share]# file initrd-2.6.18-194.el5.img

linux入门篇,讲诉系统启动流程,学习linux系统核心

[root@station79 share]# file initrd-2.6.18-194.el5.img

initrd-2.6.18-194.el5.img: ASCII cpio archive (SVR4 with no CRC)

initrd文件被压缩了两次 gz cpio

[root@station79 share]# cpio -idv < initrd-2.6.18-194.el5.img

[root@station79 share]# ls

bin dev etc init initrd-2.6.18-194.el5.img lib proc sbin sys sysroot

[root@station79 share]# rm -rf initrd-2.6.18-194.el5.img

[root@station79 share]#ls

bin dev etc init lib proc sbin sys sysroot

[root@station79 share]# tree

.

|--bin

| |--dmraid

| |--insmod

| |--kpartx

| |--lvm

| |--modprobe -> /sbin/nash

| `--nash

|--dev

| |--console

| |--mapper

| |--null

| |--ptmx

| |--ram -> ram1

| |--ram0

| |--ram1

| |--rtc

| |--systty

| |--tty

| |--tty0

| |--tty1

| |--tty10

| |--tty11

| |--tty12

| |--tty2

| |--tty3

| |--tty4

| |--tty5

| |--tty6

| |--tty7

| |--tty8…… 此处隐藏:4264字,全部文档内容请下载后查看。喜欢就下载吧 ……

linux入门篇--系统启动流程.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wenku/1705430.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)