您的位置:首页 > 运维架构 > Linux

Linux启动管理:grub

2015-07-01 01:19 661 查看
1.grub中分区表示

Linux 中 /dev/sda1 在grub中为 hd0,0 代表第一个硬盘的第一个分区

Linux中 /dev/sdb3是扩展分区 在grub中为 hd1,2 表示在第二块硬盘的第3个分区

Linux中 /dev/sdb5是扩展分区中的逻辑分区  在grub中为 hd1,3 因为上述逻辑分区是第3个分区 那么后面的Linux序号/dev/sdb4就不会存在 逻辑分区不可能小于5 所以这里是第四个分区

2.grub配置文件:

[root@localhostA1 lib]# vim /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/sda5
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0     @选择进入的那个系统
timeout=5     @超时时间,开机时启动进入那种系统的默认等待时间
splashimage=(hd0,0)/grub/splash.xpm.gz   @指定grub启动时的背景图像文件的保存位置:这里说明了在第一个硬盘的第一个分区中调用grub 其实第一个硬盘的第一个分区就是boot
hiddenmenu    @启动界面隐藏
title CentOS (2.6.32-358.el6.x86_64)  @启动界面显示的文字 可以修改的
root (hd0,0)   @启动的主目录的位置
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=32af0552-c200-46ac-b1   @加载内核  还有一些设置 例如语言设置LANG为中文简体等等
be-07101977d777 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=aut
o LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-358.el6.x86_64.img   @加载模拟内核镜像的
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: