#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set 4aa7b275-7608-40a3-86cd-1938f75100ca
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set 4aa7b275-7608-40a3-86cd-1938f75100ca
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4aa7b275-7608-40a3-86cd-1938f75100ca ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set 4aa7b275-7608-40a3-86cd-1938f75100ca
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4aa7b275-7608-40a3-86cd-1938f75100ca ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod fat
set root=(hd0,1)
search --no-floppy --fs-uuid --set bcae-d488
drivemap -s (hd0) ${root}
chainloader +1
}
### 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 ###
以上这个是我的ubuntu9.10grub.cfg的内容,我在### END /etc/grub.d/30_os-prober ###后面加了
### BEGIN /etc/grub.d/50_linux ###
menuentry "fedora12 (on /dev/sda5)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,2)
search --no-floppy --fs-uuid --set 4aa7b275-7608-40a3-86cd-1938f75100ca
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4aa7b275-7608-40a3-86cd-1938f75100ca ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/50_linux ###
还是没有成功,
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4aa7b275-7608-40a3-86cd-1938f75100ca ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
这两句不知该怎么改是照抄ubuntu9.10的,结果开机选fedora就又进入ubuntu9.10了
弄得头都大了,重启了n次啊,从网上看了两遍grub.cfg详解,人家是这么说的:
set default=0
#默认为0
insmod jpeg
#添加jpg支持,如要使用png或tga文件做背景,加上 insmod png或insmod tga
insmod ext2
#除了用作启动的分区外,其他分区格式可在menu底下再添加
set root=(hd0,7)
#设定root分区
search -no-floppy -fs-uuid -set f255285a-5ad4-4eb8-93f5-4f767190d3b3
#设定uuid=****的分区为root,和上句重复,可删除
# 以下为终端配置
if loadfont /usr/share/grub/unicode.pf2 ; then
#设置终端字体,unicode.pf2支持中文显示
set gfxmode=640×480
#设置分辨率,默认为 640×480,可用800×600,1024×768,建议跟你想设定的图片大小一致
insmod gfxterm
#插入模块 gfxterm,支持中文显 示,它还支持 24 位图像
insmod vbe
#插入 vbe 模块,GRUB 2 引入很多模块的东西,要使用它,需要在这里加入
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don’t
# understand terminal_output
terminal gfxterm
#设置 GRUB 2 终端为 gfxterm
fi
fi
set timeout=10
background_image (hd0,7)/boot/images/1.jpg
#设置背景图片
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=cyan/black
#这两行为 Debian 下的菜单颜色设置,如果默认的话,你会发现背景完全被蓝色挡住了,你需要修改 blue 为 black,这样背景就会出现
### END /etc/grub.d/05_debian_theme ###
# 10_linux 为自动添加的当前root分区linux引导项
### BEGIN /etc/grub.d/10_linux ###
#菜单项,要包括 menuentry 双引号” ” 和大括号 { }才完整,否则不显示菜单
menuentry “Ubuntu, Linux 2.6.31-9-386″ {
insmod ext2
set root=(hd0,7)
search -no-floppy -fs-uuid -set f255285a-5ad4-4eb8-93f5-4f767190d3b3
#这句与set root=(hd0,7)重复,可删除
linux /boot/vmlinuz-2.6.31-9-386 root=UUID=f255285a-5ad4-4eb8-93f5-4f767190d3b3 ro quite splash
#不喜欢看到一长串的, roo=UUID=***可用root=/dev/sda7代替
initrd /boot/initrd.img-2.6.31-9-386
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry “Memory test (memtest86+)” {
linux16 /boot/memtest86+.bin
}
### END /etc/grub.d/20_memtest86+ ###
# 自动添加存在于其他分区的系统引导项
### BEGIN /etc/grub.d/30_os-prober ###
#windows 启动菜单
menuentry “Windows Vista (loader) (on /dev/sda1)” {
insmod ntfs
#windows格式为ntfs,或为fat32改为 insmod fat
set root=(hd0,1)
search -no-floppy -fs-uuid -set ece067d2e067a196
#可删除
#grub2比较先进的地方就是如果发现windows启动是通过ntldr 引导的,定为2000/xp/2003,会在这加上 drivemap -s (hd0) ${root} ,作用相当于grub的map,可正常启动非第一硬盘的xp/2003系统。
chainloader +1
}
# 查找到其他分区上的linux系统并自动添加
menuentry “Ubuntu karmic (development branch) (9.10) (on /dev/sda3)” {
insmod ext2
set root=(hd0,3)
search -no-floppy -fs-uuid -set 4d893970-0685-44ed-86b3-1de45b2db84a
linux /boot/vmlinuz-2.6.31-9-generic root=/dev/sda3
initrd /boot/initrd.img-2.6.31-9-generic
}
#若存在macos会自动在这里添加。
### END /etc/grub.d/30_os-prober ###
# 以下为手动添加的菜单项
### BEGIN /etc/grub.d/40_custom ###
menuentry “CDLinux”{
set root=(hd0,8)
linux /CDlinux/bzImage root=/dev/ram0 vga=791 CDL_LANG=zh_CN.UTF-8
initrd /CDlinux/initrd
}
### END /etc/grub.d/40_custom ###
dchwlinux 于 2010-01-29 09:06:04发表:
sudo update-grub ##9.10的release note(发行注记)都有好不好##
duo2752 于 2010-01-28 20:15:05发表:
赞
alick 于 2010-01-28 18:58:08发表:
这两句不能照抄ubuntu的。
应该是fedora对应的内核文件和initrd文件,想查看具体文件名是多少,可以在ubuntu里挂载上fedora的/boot分区,查看里面的kernel-*********和initram-***************(****为具体版本号)文件名
alick 于 2010-01-28 18:54:17发表:
你给加到10_linux那一段里瞧瞧
紫龙 于 2010-01-28 16:42:09发表:
?????????
紫龙 于 2010-01-28 15:15:08发表:
5# alick
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
saved_entry=${prev_saved_entry}
save_env saved_entry
prev_saved_entry=
save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set 4aa7b275-7608-40a3-86cd-1938f75100ca
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
insmod gfxterm
insmod vbe
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don't
# understand terminal_output
terminal gfxterm
fi
fi
if [ ${recordfail} = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/white
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set 4aa7b275-7608-40a3-86cd-1938f75100ca
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4aa7b275-7608-40a3-86cd-1938f75100ca ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
insmod ext2
set root=(hd0,8)
search --no-floppy --fs-uuid --set 4aa7b275-7608-40a3-86cd-1938f75100ca
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4aa7b275-7608-40a3-86cd-1938f75100ca ro single
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
insmod fat
set root=(hd0,1)
search --no-floppy --fs-uuid --set bcae-d488
drivemap -s (hd0) ${root}
chainloader +1
}
### 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 ###
以上这个是我的ubuntu9.10grub.cfg的内容,我在### END /etc/grub.d/30_os-prober ###后面加了
### BEGIN /etc/grub.d/50_linux ###
menuentry "fedora12 (on /dev/sda5)" {
recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
set quiet=1
insmod ext2
set root=(hd0,2)
search --no-floppy --fs-uuid --set 4aa7b275-7608-40a3-86cd-1938f75100ca
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4aa7b275-7608-40a3-86cd-1938f75100ca ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/50_linux ###
还是没有成功,
linux /boot/vmlinuz-2.6.31-14-generic root=UUID=4aa7b275-7608-40a3-86cd-1938f75100ca ro quiet splash
initrd /boot/initrd.img-2.6.31-14-generic
这两句不知该怎么改是照抄ubuntu9.10的,结果开机选fedora就又进入ubuntu9.10了
弄得头都大了,重启了n次啊,从网上看了两遍grub.cfg详解,人家是这么说的:
set default=0
#默认为0
insmod jpeg
#添加jpg支持,如要使用png或tga文件做背景,加上 insmod png或insmod tga
insmod ext2
#除了用作启动的分区外,其他分区格式可在menu底下再添加
set root=(hd0,7)
#设定root分区
search -no-floppy -fs-uuid -set f255285a-5ad4-4eb8-93f5-4f767190d3b3
#设定uuid=****的分区为root,和上句重复,可删除
# 以下为终端配置
if loadfont /usr/share/grub/unicode.pf2 ; then
#设置终端字体,unicode.pf2支持中文显示
set gfxmode=640×480
#设置分辨率,默认为 640×480,可用800×600,1024×768,建议跟你想设定的图片大小一致
insmod gfxterm
#插入模块 gfxterm,支持中文显 示,它还支持 24 位图像
insmod vbe
#插入 vbe 模块,GRUB 2 引入很多模块的东西,要使用它,需要在这里加入
if terminal_output gfxterm ; then true ; else
# For backward compatibility with versions of terminal.mod that don’t
# understand terminal_output
terminal gfxterm
#设置 GRUB 2 终端为 gfxterm
fi
fi
set timeout=10
background_image (hd0,7)/boot/images/1.jpg
#设置背景图片
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=cyan/black
#这两行为 Debian 下的菜单颜色设置,如果默认的话,你会发现背景完全被蓝色挡住了,你需要修改 blue 为 black,这样背景就会出现
### END /etc/grub.d/05_debian_theme ###
# 10_linux 为自动添加的当前root分区linux引导项
### BEGIN /etc/grub.d/10_linux ###
#菜单项,要包括 menuentry 双引号” ” 和大括号 { }才完整,否则不显示菜单
menuentry “Ubuntu, Linux 2.6.31-9-386″ {
insmod ext2
set root=(hd0,7)
search -no-floppy -fs-uuid -set f255285a-5ad4-4eb8-93f5-4f767190d3b3
#这句与set root=(hd0,7)重复,可删除
linux /boot/vmlinuz-2.6.31-9-386 root=UUID=f255285a-5ad4-4eb8-93f5-4f767190d3b3 ro quite splash
#不喜欢看到一长串的, roo=UUID=***可用root=/dev/sda7代替
initrd /boot/initrd.img-2.6.31-9-386
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry “Memory test (memtest86+)” {
linux16 /boot/memtest86+.bin
}
### END /etc/grub.d/20_memtest86+ ###
# 自动添加存在于其他分区的系统引导项
### BEGIN /etc/grub.d/30_os-prober ###
#windows 启动菜单
menuentry “Windows Vista (loader) (on /dev/sda1)” {
insmod ntfs
#windows格式为ntfs,或为fat32改为 insmod fat
set root=(hd0,1)
search -no-floppy -fs-uuid -set ece067d2e067a196
#可删除
#grub2比较先进的地方就是如果发现windows启动是通过ntldr 引导的,定为2000/xp/2003,会在这加上 drivemap -s (hd0) ${root} ,作用相当于grub的map,可正常启动非第一硬盘的xp/2003系统。
chainloader +1
}
# 查找到其他分区上的linux系统并自动添加
menuentry “Ubuntu karmic (development branch) (9.10) (on /dev/sda3)” {
insmod ext2
set root=(hd0,3)
search -no-floppy -fs-uuid -set 4d893970-0685-44ed-86b3-1de45b2db84a
linux /boot/vmlinuz-2.6.31-9-generic root=/dev/sda3
initrd /boot/initrd.img-2.6.31-9-generic
}
#若存在macos会自动在这里添加。
### END /etc/grub.d/30_os-prober ###
# 以下为手动添加的菜单项
### BEGIN /etc/grub.d/40_custom ###
menuentry “CDLinux”{
set root=(hd0,8)
linux /CDlinux/bzImage root=/dev/ram0 vga=791 CDL_LANG=zh_CN.UTF-8
initrd /CDlinux/initrd
}
### END /etc/grub.d/40_custom ###
# 手动添加时,硬盘编号从0开始(hd0),主分区编号从1开始(hd0,1),逻辑分区从5开始(hd0,5)
我怎么感觉还是不详细呀,我也知道很大原因并不是linunx太难而是自己基础太差了,没办法从小到大没学过英语,就最近学的外语还是晚上跟来我们酒店酒吧里的老外学习的,大家帮帮忙吧!
王中云 于 2010-01-28 13:15:40发表:
还可在XP里装上EasyBCD,然后通过EasyBCD增加XP里的启动菜单,但Ubuntu9.10版本及其以后版本不能成功
alick 于 2010-01-28 11:11:02发表:
首先要知道fedora12的 /boot在硬盘哪个分区上,可以
fdisk -l
看一下,结果应该是/dev/sdaX (其中X为数字)。比如是/dev/sda5,它对应grub2的记法是(hd0,5)
模仿ubuntu的menuentry的写法,添加上fedora的菜单条目。
附上我用fedora10的grub2引导fedora12的grub.cfg文件的引导linux的部分,
可以看到菜单上有两个条目,一个fedora10一个fedora12
[code]### BEGIN /etc/grub.d/10_linux ###
menuentry "Fedora, linux 2.6.31.9-174.fc12.x86_64" {
set root=(hd0,7)
search --fs-uuid --set 5af00bf1-8e0d-41db-9c0f-ed91648a7095
linux /vmlinuz-2.6.31.9-174.fc12.x86_64 root=/dev/mapper/VolGroup-LV_root ro quiet rhgb nomodeset vga=0x323
initrd /initramfs-2.6.31.9-174.fc12.x86_64.img
}
menuentry "Fedora, linux 2.6.31.12-174.2.3.fc12.x86_64" {
set root=(hd0,7)
search --fs-uuid --set 5af00bf1-8e0d-41db-9c0f-ed91648a7095
linux /vmlinuz-2.6.31.12-174.2.3.fc12.x86_64 root=/dev/mapper/VolGroup-LV_root ro quiet rhgb nomodeset vga=0x323
initrd /initramfs-2.6.31.12-174.2.3.fc12.x86_64.img
}
### END /etc/grub.d/10_linux ###
[/code]
紫龙 于 2010-01-28 10:58:06发表:
2# alick
原来如此,不过要怎么在grub.cfg中修改内容呢(不好意思我是个菜鸟,我只是一家夜店的服务员,不过我真的非常喜欢玩电脑)
紫龙 于 2010-01-28 10:57:17发表:
原来如此,不过要怎么在grub.cfg中修改内容呢(不好意思我是个菜鸟,我只是一家夜店的服务员,不过我真的非常喜欢玩电脑)
alick 于 2010-01-28 10:53:21发表:
请问安装Ubuntu时是否安装了grub?
是的话ubuntu 9.10采用了grub2新版本,配置文件在/boot/grub/grub.cfg