您尚未登录。

#1 2013-01-05 21:07:08

wolfishor
会员
注册时间: 2013-01-05
帖子: 5

linux无法启动,请教grub2的设置

今天安装了bridge-linux lxde版本,安装完成后,windows可以进入,但是linux进入不了了,要重新加载内核找不到/boot/vmlinuz-linux了。
我的笔记本本是双系统:
windows 第一个分区 主分区
swap 第二个分区
boot 第三个分区   主分区
/    第5逻辑分区
/home 第6逻辑分区
D盘   第7逻辑分区 

自己生成的grub.cfg显示如下:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"

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
}

if loadfont unicode ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###

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

### 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_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Microsoft Windows XP Professional (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-AAC8445EC8442B41' {
	insmod part_msdos
	insmod ntfs
	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  AAC8445EC8442B41
	else
	  search --no-floppy --fs-uuid --set=root AAC8445EC8442B41
	fi
	drivemap -s (hd0) ${root}
	chainloader +1
}
menuentry 'Bridge Linux (2012.11 LXDE)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-d2879574-d90d-4d29-905a-78df5b2d1ebc' {
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos5'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5  d2879574-d90d-4d29-905a-78df5b2d1ebc
	else
	  search --no-floppy --fs-uuid --set=root d2879574-d90d-4d29-905a-78df5b2d1ebc
	fi
	linux /boot/vmlinuz-linux root=/dev/sda5 ro quiet
	initrd /boot/initramfs-linux.img
}
submenu 'Advanced options for Bridge Linux (2012.11 LXDE)' $menuentry_id_option 'osprober-gnulinux-advanced-d2879574-d90d-4d29-905a-78df5b2d1ebc' {
	menuentry 'Arch GNU/Linux, with Linux core repo kernel (on /dev/sda5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--d2879574-d90d-4d29-905a-78df5b2d1ebc' {
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5  d2879574-d90d-4d29-905a-78df5b2d1ebc
		else
		  search --no-floppy --fs-uuid --set=root d2879574-d90d-4d29-905a-78df5b2d1ebc
		fi
		linux /boot/vmlinuz-linux root=/dev/sda5 ro quiet
		initrd /boot/initramfs-linux.img
	}
	menuentry 'Arch GNU/Linux, with Linux core repo kernel (Fallback initramfs) (on /dev/sda5)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--d2879574-d90d-4d29-905a-78df5b2d1ebc' {
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos5'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5  d2879574-d90d-4d29-905a-78df5b2d1ebc
		else
		  search --no-floppy --fs-uuid --set=root d2879574-d90d-4d29-905a-78df5b2d1ebc
		fi
		linux /boot/vmlinuz-linux root=/dev/sda5 ro quiet
		initrd /boot/initramfs-linux-fallback.img
	}
}

### 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 ###   

请问linux的启动选项中的设置应该怎么修改?谢谢了

离线

#2 2013-01-05 21:44:33

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,917
个人网站

Re: linux无法启动,请教grub2的设置

set root='hd0,msdos5' 这句不对。「boot 第三个分区   主分区」,如果分区表是按顺序的,那么应当是 (hd0,3)。msdos 可以不写。不知道括号是不是必要的。

离线

页脚