免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1696 | 回复: 2
打印 上一主题 下一主题

[系统安装] /boot/gurb2/grub.conf怎么看呢,有说明文档吗? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-10-12 12:26 |只看该作者 |倒序浏览
《鸟哥的Linux》书上的配置文件还是menu.lst,貌似已经不用了啊,哪里有grub.conf的说明文档?
(写法都和以前不一样的,和以前
"root  (hd2,)
kernel /vmlinuz-
initrd  /initrd-"
不太一样啊,
可以用旧的写法写到/boot/grub2/grub.conf里面去吗?grub2能识别吗?

=======================附上/boot/grub2/grub.conf文件
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

terminal_output console
set timeout=5 ,5秒内没有操作就启动默认选项。0就代表直接按默认项启动。
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Fedora, with Linux 3.11.10-301.fc20.i686' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.11.10-301.fc20.i686-advanced-8097ca4f-f609-45cc-be3e-1061e1300eb2' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'    //这里,root代表了内核文件放置的分区
if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 5ec8dd27-fee4-4a3c-8d1d-ed0112c6c275
else
   search --no-floppy --fs-uuid --set=root 5ec8dd27-fee4-4a3c-8d1d-ed0112c6c275
fi
linux        /vmlinuz-3.11.10-301.fc20.i686 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet LANG=zh_CN.UTF-8   //内核文件名 以及 内核参数
initrd /initramfs-3.11.10-301.fc20.i686.img
}
menuentry 'Fedora, with Linux 0-rescue-7c4d06bde16d49688ab1853feee269d1' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-0-rescue-7c4d06bde16d49688ab1853feee269d1-advanced-8097ca4f-f609-45cc-be3e-1061e1300eb2' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 5ec8dd27-fee4-4a3c-8d1d-ed0112c6c275
else
   search --no-floppy --fs-uuid --set=root 5ec8dd27-fee4-4a3c-8d1d-ed0112c6c275
fi
linux        /vmlinuz-0-rescue-7c4d06bde16d49688ab1853feee269d1 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet
initrd        /initramfs-0-rescue-7c4d06bde16d49688ab1853feee269d1.img
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

论坛徽章:
0
2 [报告]
发表于 2014-10-12 12:49 |只看该作者
比如说,我已经有了一个内核文件 和 initrd文件,是不是只要把下面加黑的部分修改成我自己的路径就可以正常使用了呢?还需要修改其他什么地方吗?
menuentry 'Fedora, with Linux 0-rescue-7c4d06bde16d49688ab1853feee269d1' --class fedora --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-0-rescue-7c4d06bde16d49688ab1853feee269d1-advanced-8097ca4f-f609-45cc-be3e-1061e1300eb2' {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1' 5ec8dd27-fee4-4a3c-8d1d-ed0112c6c275
else
   search --no-floppy --fs-uuid --set=root 5ec8dd27-fee4-4a3c-8d1d-ed0112c6c275
fi
linux       /vmlinuz-0-rescue-7c4d06bde16d49688ab1853feee269d1 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap vconsole.font=latarcyrheb-sun16 rd.lvm.lv=fedora/root rhgb quiet
initrd        /initramfs-0-rescue-7c4d06bde16d49688ab1853feee269d1.img
}

论坛徽章:
10
金牛座
日期:2014-09-16 19:02:48技术图书徽章
日期:2015-11-24 01:37:29操作系统版块每日发帖之星
日期:2015-11-18 06:20:002015年亚洲杯之沙特阿拉伯
日期:2015-04-13 17:33:462015年迎新春徽章
日期:2015-03-04 09:51:162015年辞旧岁徽章
日期:2015-03-03 16:54:15午马
日期:2014-12-04 19:33:55白羊座
日期:2014-09-17 19:34:42巨蟹座
日期:2014-09-16 21:09:4815-16赛季CBA联赛之同曦
日期:2016-06-27 23:23:07
3 [报告]
发表于 2014-10-12 19:45 |只看该作者
把内核跟initrd放到/boot目录里.


然后管理员身份执行grub2-mkconfig -o /boot/grub2/grub.cfg

系统会自己去那里找有可用的内核,然后帮你加到grub2菜单里去的,也许生成的菜单你还需要增加参数,就再自己去追加参数了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP