ImageVerifierCode 换一换
格式:DOCX , 页数:21 ,大小:4.73MB ,
资源ID:4295922      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4295922.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(Linux 引导过程及服务.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

Linux 引导过程及服务.docx

1、Linux 引导过程及服务 Linux 引导过程及服务Boot Sequence Overview1. BIOS 电脑打开电源时就会进入BIOS,主要监测CPU,Memory,风扇等2. MBR Boot loader在磁盘的第1个磁区共512bytes,其中前446bytes用于选择启动的bootPartition载入开机的程式码3. Kernel 载入作业系统的Kernel主要载入驱动程式并以Read only的方式来挂载flash FileSystem 也就是一开始只能读到flash根目录的哪个parition 如: 如: Device Mount Point/RAID/Volume T

2、ype Format /dev/sda1 /boot ext3 /dev/sda2 / ext3 只认识这个parition /dev/sda3 /home ext3 所以/,/etc,/bin,/sbin,/dev,/lib必须在同一个paraition4. init 是linux第1个执行的程式 ps -xo pid,cmd rootcluster2 # ps -xo pid,cmd PID CMD 1 init 3 2 migration/0 init会根据Run level执行下边这些程序 /etc/rc.d/rc.sysinit /etc/rc.d/rc and /etc/rc.d/

3、rc?.d /etc/rc.d/rc.local X display Manager if approperiate一、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上,

4、如下面 Boot Loader: 多重系统引导 1.stage - small,resides in MBR or boot sector 只446bytes可存储在MBR或boot sector 2.stage - loaded from boot partition 启动码是存储在哪个partition的boot里面 实例1: 通过MBR引导A. 载入MBR前446个bytesB. 进入GRUB,进入引导选择菜单 c. 载入选择系统的Kernel实例2:通过Boot Loader引导A. 首先会进入MBR,但MBR被SPFDisk占用了 B. 会找到boot partition通过Boot

5、 Loader载入C. 进入GRUB的选择菜单D. 载入所选择系统的Kernel1. GRUB and grub.confA. 从MBR到Kernel最后到init都是由GRUB所负责的 在最上面可以看到GRUB的version numberB. GRUB有以下几个特性:a. Command-line interface available at boot prompt按下C键就能进入以grub开头的提示符来输入命令b. Boot from ext2/ext3,ReiserFS,JFS,FAT,minix,or FFS filesystemsc. Supports MDB5 password

6、protection C. Grub.conf/boot/grub/grub.conf 文档路径Changes on grub.conf will go into defect immediately 对grub.conf修改会立即生效If MBR on /dev/had is corrupted,reinstall the first stage bootloader with: /sbing/grub-install/dev/had如果GRUB被删除掉,可以通过上面的路径通过reinstall进行安装D. Grub.conf 文档内容进行文档备份: rootcluster2 # vim /

7、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/hda2# init

8、rd /initrd-version.img#boot=/dev/hdadefault=0 如果defualt=1就会使用第2组系统来引导timeout=5 菜单停留时间 splashimage=(hd0,0)/grub/splash.xpm.gz hd0为第1块磁盘,后面0表示第1个partition Hiddenmenu 隐藏开机菜单,要按下任意键才会有显示上面是基本设定title Red Hat Enterprise Linux Server (2.6.18-164.el5) 系统菜单所显示的标题 root (hd0,0) 同样是指/boot这个目录 kernel /vmlinuz-2.

9、6.18-164.el5 ro root=LABEL=/ rhgb quiet kernel的位置在上面目录中以read only来挂载flash的/目录 rhgb 会有图形界面来取代传统的画面 initrd /initrd-2.6.18-164.el5.img上面用于区分多个操作系统的启动设置上面增加了一个系统启动选项E. 现在修改grup.conf2. Starting the Boot Process:GRUB重新开机后会看到有两组系统选择:A. 如果选择Windows 会出现以下提示信息:B. 如果此时按下a键会传递1个参数给kernel 此时输入下面中的”空格1”可以进入单用户模式,

10、不用输入root用户的密码就能进入系统进入系统的界面此时可以修改root用户的密码哦此时任何人都可能通过single user mode来修改root用户密码,这是十分不安全我们可以通过给GRUB设定密码,只允许密码拥有者才能给Kernel传递参数通过编辑grub.conf来实现密码设置重新启动只有按P键输入密码后才能进入接下来的功能输入密码验证之后按a键才能传递参数给Kernel可以通过MD5算法对grub密码进行加密也可直接在grub.conf文件中直接对密码进行加密3. 编辑Kernel,选择刚刚有问题的windows系统进行修复由于第1行设置错误出现无法引导,按e键进行编辑按下ente

11、r键后出现修改完成的提示再次按下enter键后回退菜单,按b键进行引导,这样就能修复grub错误的故障三、 Kernel Initialization 1. Kernel boot time functions Kernel开机时所做的工作 A. Device detection 会侦测有些什么设备 B. Device driver initialization 会将这些设备初始化并载入到Kernel C.Mounts root filesystem as read only 会把/根目录挂载进来 D.Loads initial process(init) 会加载init这个程式,是第1个被系

12、统执行的程式四、 Init Initialization 执行了以下操作 1. init reads its config:/etc/inittab init实际是读取/etc/inittab来决定实际做些什么操作 具体操作如下: A Initial run level 决定使用哪个run level B System initialization scripts 初始化脚本 C Run level specific script directories 根据runlevel来决定执行那个runlevel特有的程式 就会把参数3传进入成为rc3.d例如以下目录:如果runlevel为3就会使用

13、rc3.d目录里面的服务 D Trap certain key sequences设定组合键的功能 E Define UPS power fail/restore scripts 定义电源断或恢复应执行什么程式 F Generate gettys on virtual consoles 会产生6个virtual consoles(tty) G Initialize X in run level 5 如果run level为5就会启动X window的环境 2. init initialization 流程图 五、 详解流程图 一.id:5:initdefault 1. Run levels功能

14、介绍 A. Level 0不能设置在initdefault,否则一开机就会关机.B. 1,S,emergency 都是root单用户模式用于系统维护时使用,有如下不同之处:a. b. c. C. Level 6 不能设置在initdefault,否则开机后就会重启2. Run level的设定,可以通过以下三种方式 Run level是通过init来定义的A. 通过/etc/inittab文件里面 initdefalt来设置B. Passing an argument from the boot loader通过GRUB传递参数给KernelC. Running init x after bo

15、ot(where x is the desired run level)进入系统后通过init 指令输入要进入的run level3. 查看当前所处的Run level 二 /etc/rc.d/rc.sysint 1. 启动热插拨(USB)和selinux2. 会把kernel的参数设定到/etc/sysctl.conf3. 会设定系统的时间4. 启用键盘5. 启用swap partitions6. 设定主机名 /etc/sysconfig/network7. 检测根目录有没有问题且重新挂载为可读可写的状态8. 启用磁带阵列如RAID和LVM设备9. 启用disk quotas的功能,quot

16、as能限制最大可使用的空间10. 检查其他的file system并进行挂载11. 清除一些被修改过的locks以及PID三 /etc/rc*.d/ 实际连接到如/etc/rc.d/rc.3d/ /etc/rc.d/rc.3d/ 实际就是调用/etc/init.d/ 和/etc/xinetd.d/ 通过init的initdefault来决定所要执行的服务 每个run level都有其自身的服务每个服务都是一个链接,并且都是链接到./init.d/这个目录的文件rc.d和rc5.d的d都是Daemon(守护进程)的意思1. Daemon Processes# A daemon process i

17、s a program that is run in the background,Providing some system sevice 提供系统服务# Two types of daemons: 分为两个类型,提供服务的方式不同A.Standalone 直接调用服务的程式又分为以下两种:a. Enabled from init 系统引导时由init直接调用的 Ex. Virtual Consoleb. System V Daemon 如/etc/rc3.d/调用/etc/rc.d/init.d/ Ex. Httpd # System V Script启动和停止都是用同一个程式 如: #

18、/etc/rc3.d目录下: K表示kill, S表示start 执行顺序:先K再S,先小数再大数 B. Transient-controlled by the “super-daemon” xinetd 首先呼叫xinetd要求服务然后xinetd再呼叫Transient的程式 Xinetd类型的服务必须由Xinetd提供,不能由服务自身提供 实例1: 说明这个port对应的service是由xinetd调用.实例2: 说明是由telnetd这个服务在使用这个port Transient类型的服务都归Xinetd所管理,故Xinetd叫做Super Demon四 /etc/rc.local1

19、. Run after the run level specific scripts 执行完/etc/rc.*d/后就会执行/etc/rc.d/rc.local 2. Common place form custom modification可以将run level2-5要执行的程式可以设定到rc.local中五 /sbin/mingetty 启动六个Virtual Consoles1. virtual Consoles有以下特性:A. Defined in /etc/inittab Virtual Console定义在/etc/inittabB. Accessed with ctrl+alt

20、+F*要切换到不同的tty按下ctrl+alt+F*C. /dev/tty*: Virtual console nVirtual console的档案是在/dev/tty* 这个目录 D/dev/tty0: the current virtual console tty 0为当前的virtual console E. Default Red Hat Enterprise Linux configuration: 12 consoles defined Consoles 1-6 accept logins X server starts on first available console,us

21、ually 7 如果使用图形界面登陆从console 7开始 可以按ctrl+alt+F7 可以到图形界面五、 Controlling Services 1. Utilities to control default service startup 自动启动的服务 A. ntsysv: a console-base interactive utility 默认只设定当前run level 可以设定其他run level如3和5 B. chkconfig: a fast,versatile command line utility 例如鼠标服务:在run level1-5是start的 可以配置

22、鼠标服务在run level 1-3为off 可以查看某个服务预设启动的情况 C. system-config-service: graphical utility that requires an X interface 2. Utilities to control services manually 手动启动的服务 A. service: immediately start or stop a standalone service B. chkconfig: immediately starts and stops xinetd-managed services C. system-co

23、nfig-service: graphical utility what requires an X interface六、 System Shutdown 1. shutdown h now 指定时间关机 shutdown h 22:00 2. halt 3. poweroff 4. init 0 这4个指令在关机前会自动执行sync,将memory内容快速写入disk 七、System Reboot 1. shutdown r now 指定时间重启 shutdown r 22:00 2. reboot 3. init 6 4 ctrl+alt+del (Virtual Console) 说明:由于本人专业并非操作系统,如有错误请见谅 作者: main.reload.(Refresh) 于2013.3.5 16:00

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1