Linux ~ 启动管理 ~ Grub。

Linux- 启动管理。



CentOS 6.x 启动管理。



系统运行级别。

运行级别含义
0关机
1单用户模式,可以想象为 Windows 的安全模式,主要用于系统修复。
2不完全的命令行模式,为含 NFS 服务。
3完全的命令行模式,就是标准字符界面。
4系统保留。
5图形模式。
6重启动。


运行级别命令。
  • 查看运行级别。

init 0 ——> 关机。
init 6 ——> 重启。

[root@localhost ~]# runlevel
N 3
# 上次 现在。
  • 改变运行级别。
[root@localhost ~]# init 级别
  • 系统默认运行级别。
[root@localhost ~]# cat /etc/inittab 
# inittab is only used by upstart for the default runlevel.
#
# ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
#
# System initialization is started by /etc/init/rcS.conf
#
# Individual runlevels are started by /etc/init/rc.conf
#
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
#
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
# with configuration in /etc/sysconfig/init.
#
# For information on how to write upstart event handlers, or how
# upstart works, see init(5), init(8), and initctl(8).
#
# Default runlevel. The runlevels used 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)
# 
id:3:initdefault:



系统启动过程。

CentOS 6.x 启动管理。

在这里插入图片描述



启动引导程序- grub。

Grub 配置文件。
Grub 中分区表示方式。
硬盘分区Linux 中设备文件名Grub 中设备文件名
第一块 SCSI 硬盘第一个主分区/dev/sda1hd(0,0)
第二个主分区/dev/sda2hd(0,1)
扩展分区/dev/sda3hd(0,2)
第一个逻辑分区/dev/sda5hd(0,4)
第二块 SCSI 硬盘第一个主分区/dev/sdb1hd(1,0)
第二个主分区/dev/sdb2hd(1,1)
扩展分区/dev/sdb3hd(1,2)
第一个逻辑分区/dev/sdb5hd(1,4)
geek@geek-PC:~$ vim /boot/grub/grub.cfg 

[root@localhost ~]# vim /boot/grub/grub.conf 

[root@localhost ~]# ll /etc/grub.conf 
lrwxrwxrwx. 1 root root 22 Feb 18 07:46 /etc/grub.conf -> ../boot/grub/grub.conf

可以配置启动哪一个系统,以及等待几秒。

splashimage=(hd0,0)/grub/splash.xpm.gz
// 背景图像文件保存位置。

以下案例为 2 个内核版本。

# 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/mapper/VolGroup-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-754.27.1.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-754.27.1.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root nomodeset rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-754.27.1.el6.x86_64.img
title CentOS 6 (2.6.32-754.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root nomodeset rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=VolGroup/lv_swap SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=VolGroup/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-754.el6.x86_64.img
~                                                 


系统修改模式。
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lyfGeek

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值