一、centos6启动管理
1.1、运行级别意义
1.2、查看运行级别
[root@localhost log]# runlevel
3 5 //表示目前是5,之前是3,如果是N表示直接开机进入5
1.3、设置默认开机运行级别
[root@localhost log]# vim /etc/inittab
二、启动引导程序grub
grub是开机后的系统引导程序,提供开机时选择进入具体哪个系统的菜单。
2.1、grub配置文件
[root@localhost /]# vi /boot/grub/grub.conf
# grub.conf generated by anaconda
#
扫描二维码关注公众号,回复: 2736875 查看本文章# 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/sda2
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0 //默认启动第一个title
timeout=5 //等待五秒
splashimage=(hd0,0)/grub/splash.xpm.gz //背景图像文件
hiddenmenu //隐藏启动选择界面类似win必须按f12才能选择启动项
title CentOS 6 (2.6.32-642.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-642.el6.x86_64 //加载内核
ro root=UUID=d918b26f-fa87-4403-91c3-b27ae7c36640 rd_NO_LUKS
KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-642.el6.x86_64.img //加载模拟内核
2.2、grub加密
2.2.1、linux启动时按 e 进入grub编辑模式,不安全
2.2.2、如需给编辑模式设置密码
[root@localhost ~]# grub-md5-crypt
Password: 123456
Retype password: 123456
$1$JnGVz/$bYexR/Ba/zYzg8IxDBhzX0.
[root@localhost ~]# vi /boot/grub/grub.conf
default=0
timeout=5
password --md5 $1$JnGVz/$bYexR/Ba/zYzg8IxDBhzX0
2.2.3、linux再次启动时必须先按p,输入密码才能进入e编辑模式