分页: 1 / 1

grubenv丢失

发表于 : 2009-10-18 20:01
pengdong17
启动的过程中碰到了"erro:invalid environment block"错误
然后 我就按照 下面的操作了下

由于我在某次启动的过程中碰到了"erro:invalid environment block"错误,在google上搜到了解决办法,我转述一下,希望对大家有帮助

1、在启动grub的界面按“e”,找到"save_env",删除整行
2、执行ctrl+x启动系统,此时你应该能进入x了
3、执行如下命令,貌似要用sudo

代码:
cd /boot/grub
rm grubenv // 成功了
grub-editenv grubenv create // 失败~!!好像说grub-editenv 没找到,下面几步也不行
grub-editenv grubenv set default=0
grub-editenv grubenv list
default=0


4、执行下面命令,修复grub菜单

代码:
sudo update-grub //这个倒是没问题....
所以我 删了/boot/grub/grubenv 文件........
然后 自然 启动时 提示 File not found. :em06

有什么办法么??
要是不行...我就等U910 正式版重装了........ :em20

Re: grubenv丢失

发表于 : 2009-10-19 18:30
pengdong17
各位 大哥,大姐~~
谁来帮帮我啊~~

Re: grubenv丢失

发表于 : 2009-10-19 18:40
smallapple
Livecd进去改grub.cfg。

Re: grubenv丢失

发表于 : 2009-10-19 18:48
pengdong17
smallapple 写了:Livecd进去改grub.cfg。
怎么改啊..~
:em06

Re: grubenv丢失

发表于 : 2009-10-19 18:52
smallapple
把grub.cfg与grubenv的内容删了。

代码: 全选

if [ -s /boot/grub/grubenv ]; then
  have_grubenv=true
  load_env
fi

可以先试试 出现File not found.后按回车能否出现菜单

Re: grubenv丢失

发表于 : 2009-10-19 19:03
pengdong17
#
# 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 ###
load_env
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,4)
search --no-floppy --fs-uuid --set 9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8
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-13-generic" {
recordfail=1
save_env recordfail
set quiet=1
insmod ext2
set root=(hd0,4)
search --no-floppy --fs-uuid --set 9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8
linux /boot/vmlinuz-2.6.31-13-generic root=UUID=9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8 ro quiet splash
initrd /boot/initrd.img-2.6.31-13-generic
}
menuentry "Ubuntu, Linux 2.6.31-13-generic (recovery mode)" {
recordfail=1
save_env recordfail
insmod ext2
set root=(hd0,4)
search --no-floppy --fs-uuid --set 9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8
linux /boot/vmlinuz-2.6.31-13-generic root=UUID=9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8 ro single
initrd /boot/initrd.img-2.6.31-13-generic
}
menuentry "Ubuntu, Linux 2.6.31-11-generic" {
recordfail=1
save_env recordfail
set quiet=1
insmod ext2
set root=(hd0,4)
search --no-floppy --fs-uuid --set 9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8
linux /boot/vmlinuz-2.6.31-11-generic root=UUID=9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8 ro quiet splash
initrd /boot/initrd.img-2.6.31-11-generic
}
menuentry "Ubuntu, Linux 2.6.31-11-generic (recovery mode)" {
recordfail=1
save_env recordfail
insmod ext2
set root=(hd0,4)
search --no-floppy --fs-uuid --set 9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8
linux /boot/vmlinuz-2.6.31-11-generic root=UUID=9ff3c0d2-d7c3-4d9d-8893-ffa369dae7c8 ro single
initrd /boot/initrd.img-2.6.31-11-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 8c68-6106
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 ###

Re: grubenv丢失

发表于 : 2009-10-19 19:07
smallapple
load_env 删除或加 # 注释掉

recordfail=1
save_env recordfail

这两个删掉

Re: grubenv丢失

发表于 : 2009-10-19 19:07
pengdong17
上面是GRUB.CFG

没有找到 if [ -s /boot/grub/grubenv ]; then
have_grubenv=true
load_env
fi


以及grubenv 相关大的东西。。。。。。。。。。。。

我能看到 grub 的,XP 也是能进的~~
Memory test (memtest86+) 也行,就是 不能进入UBUNTU

Re: grubenv丢失

发表于 : 2009-10-19 19:13
pengdong17
You are trying to save the file on a read-only disk. Please check that you typed the location correctly and try again
I can't edit it
i have been ROOT~

Re: grubenv丢失

发表于 : 2009-10-19 19:14
smallapple
sudo chmod +x ....
sudo gedit ....
sudo nano ....

Re: grubenv丢失

发表于 : 2009-10-19 19:14
pengdong17
read-only :em06

i am trying/........

Re: grubenv丢失

发表于 : 2009-10-19 19:25
pengdong17
:em06

i changed
but i failed ...
it says
File not found.
all the same

.............i am going to give up .

or i think
我就等U910 正式版重装了........ :em20
#
# 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 ###
#load_env
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,4)

Re: grubenv丢失

发表于 : 2009-10-19 19:30
smallapple
不知道是没了内核还是分区不对? :em06

在grub启动画面上按c进入命令行模式,
search -f /boot/vmlinuz-2.6.31-11-generic

search -f /boot/initrd.img-2.6.31-11-generic
看看内核在不在,还有回显是不是 (hd0,4), 不是的话重新改下。

Re: grubenv丢失

发表于 : 2009-10-31 21:43
pengdong17
今天 装U910 了,,,以后再也不随便不经过备份就 删东西了

Re: grubenv丢失

发表于 : 2012-04-22 0:12
uzasun
飘过