Error: Invalid environment block
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Confirmed
|
High
|
Unassigned |
Bug Description
Binary package hint: grub2
grub gave this error invalid: environment block when after an unclean shutdown.
I ended up deleting grubenv and that worked to get me booting again but next time unclean shutdown it boots up and runs fsck? shows some inode stuff and next boot i get the message again.
Looking at grubenv: it is showing it to be 0 bytes , when this problem occurs.
I also have copied grubenv a read only file from a good computer really has same effect as deleting it.
Reinstall grub still same problem.
Running x64 karmic all updates
In anycase this errormessege while may show there's some bigger issue should not stop me from booting, should it?
ProblemType: Bug
Architecture: amd64
Date: Wed Sep 30 22:28:57 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelMo
Package: grub-pc 1.97~beta3-1ubuntu6
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: grub2
Uname: Linux 2.6.31-11-generic x86_64
Related branches
jamey0824 (jamesforyst) wrote : | #1 |
Antti Leppik (antti-parksepa) wrote : | #2 |
Colin Watson (cjwatson) wrote : Re: [Bug 439784] [NEW] invalid: environment block | #3 |
Thanks. This is obviously filesystem corruption of some kind (and I
don't know why; it's particularly weird that it seems to happen
repeatably), but for this particular case I'll make grub-common's init
script check for a zero-sized file on boot, and if so then make it just
delete it.
status fixcommitted
Changed in grub2 (Ubuntu): | |
status: | New → Fix Committed |
Glen Turner (gdt-gdt) wrote : Re: invalid: environment block | #4 |
Note that this happens more often on Karmic Koala (alpha), with it's use of ext4 for /boot seeming to lead to more instances of 0-length files upon system issues (in my case, the kernel crashed). I was just about to add some more information to support this, but I see Colin has fixed it. Thank you so much.
Glen Turner (gdt-gdt) wrote : | #5 |
I just had a look at the fix, and I suggest a better fix would be to allow load_env to continue with just a warning if it fails reading the file. It's not like scripts don't have to handle unset environment variables in any case. That would allow for more exotic forms of filesystem corruption.
Colin Watson (cjwatson) wrote : Re: [Bug 439784] Re: invalid: environment block | #6 |
On Thu, Oct 01, 2009 at 10:14:51AM -0000, Glen Turner wrote:
> I just had a look at the fix,
Not sure how you managed that, since it's only on my laptop hard disk
right now!
Glen Turner (gdt-gdt) wrote : Re: invalid: environment block | #7 |
What I meant is that I trialled your idea by hacking my init scripts as you suggest. You might want to test your idea further when I modify the script to "just delete it" the boot sequence still fails complaining about a read failure on grubenv. You need to say "/usr/bin/
The simplest approach might be to patch grub2 loadenv to be more robust when seeing failure.
Colin Watson (cjwatson) wrote : Re: [Bug 439784] Re: invalid: environment block | #8 |
I'd like to know why an explicit create is necessary for you, as
'grub-editenv /boot/grub/grubenv unset recordfail' will create the
environment block implicitly, as verified from the code and demonstrated
here:
$ rm -f grubenv
$ grub-editenv grubenv unset recordfail
$ ls -l grubenv
-rw-r--r-- 1 cjwatson cjwatson 1024 2009-10-01 16:17 grubenv
Where did you make your change? I put this line above '... unset
recordfail' in /etc/init.
[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv
Colin Watson (cjwatson) wrote : | #9 |
Incidentally, there is a very good reason why loadenv doesn't create the
environment block itself - GRUB's filesystem modules don't have write
support, and adding that would expose us to a whole range of exciting
new possible bugs. For this reason, we create the file when we're in a
real operating system, and all GRUB has to do is write into a
pre-allocated block on the disk, which is pretty simple and safe.
Is your problem perhaps that loadenv is finding a zero-sized environment
block and failing before we boot into Ubuntu at all? If that's what's
happening, then we could make it treat a zero-sized block like an absent
one, or something like that.
Alexander Hunziker (alex-hunziker) wrote : Re: invalid: environment block | #10 |
Is there a way to recover from this when it hit me without reinstalling the system?
Zaki Manian (zmanian) wrote : | #11 |
Yes the comments above give you a workable way to recover your system.
You need to be able load a live linux operating system that can write your your filesystem.
I used a live-usb drive. You can use the ubuntu install cd for this purpose.
After booting into the live cd based environment, you need to mount the partition on your main system that contains /boot.
Then you can make the necessary modifications to grubenv as per comments above.
cd /boot/grub
rm grubenv
grub-editenv grubenv create
grub-editenv grubenv set default=0
grub-editenv grubenv list
default=0
This should give a bootable system.
I assume this problem is related to the instabilities in ext4?
Carlos Costa (carloscosta) wrote : | #12 |
Hi Colin :)
I don't know if you already had committed your fix, however this bug still happens. I just tried to be back from hibernation, but I can't. To solve I erased grubenv file following the comment #11 and everything works normally.
Michal Parusinski (astenorh) wrote : | #13 |
Check if you have the lines by pressing e when booting
recordfail=1
save_env recordfail
if so you can delete them by pressing Ctrl-D and then boot by Ctrl-X
Michal Parusinski (astenorh) wrote : | #14 |
What does recordfail does?
Launchpad Janitor (janitor) wrote : | #15 |
This bug was fixed in the package grub2 - 1.97~beta3-1ubuntu7
---------------
grub2 (1.97~beta3-
* debian/
zero-sized for some reason. If it is, just delete it (LP: #439784).
-- Colin Watson <email address hidden> Sun, 04 Oct 2009 21:52:10 +0100
Changed in grub2 (Ubuntu): | |
status: | Fix Committed → Fix Released |
neuromancer (neuromancer) wrote : | #16 |
Solution given by Lepikk worked for me.
Just for completeness, I've used a cd-rom of Ubuntu Karmic Beta1 and from the option I've choosed "restore damaged installation" or something like that.
Than I've followed the wizard and when asked I've launched a console shell with /dev/sda1 (wich is my root filesystem) mounted.
And here I've inserted the grub-editenv command given by Leppik.
Changed in grub2 (Ubuntu): | |
status: | Fix Released → Confirmed |
Harry (harry33) wrote : | #17 |
Well this bug still affects me after every unclean shutdown (karmic ubuntu 32-bit, fully upgraded) as of today and with
grub (1.97~beta3-
Workaround: when grub loads and the menu is seen, press e and delete the 2 rows:
recordfail=1
save_env recordfail
Then normal boot with cntr-x.
After the system is up just hit reboot and the system runs OK.
Noel J. Bergman (noeljb) wrote : | #18 |
As noted below, I still see this problem:
-r-------- 1 root root 3398 2009-10-08 00:45 grub.cfg
-rw-r--r-- 1 root root 0 2009-10-08 00:56 grubenv
Upon trying to boot, I can't. I manually mounted the partition, deleted grubenv b hand, and rebooted. Still now good. I had to remove:
recordfail=1
save_env recordfail
from grub.cfg, and then I could boot. Packages installed, which I could see when I booted:
ii grub-common 1.97~beta3-1ubuntu8 GRand Unified Bootloader, version 2 (common
ii grub-pc 1.97~beta3-1ubuntu8 GRand Unified Bootloader, version 2 (PC/BIOS
Stefan Berge (olyckholm) wrote : | #19 |
I had the same problem with a 32-bit install, but after following mr Bergman´s "recepy" I can "kill" the computer by pushing the restart button, and it boots up perfectly again. So a clean shutdown is no longer needed. Thank you, mr Bergman!
Stefan Berge (olyckholm) wrote : | #20 |
Eh... just one more thing. I am not a real newbie, but I don´t type in Terminal more than necessary. So, I got some help with the linux commands here: http://
Deleting grubenv was no problem (rm grubenv after doing sudo su). Then I typed sudo gedit to open gedit but after erasing the two lines recordfail=1 and save_env recordfail, I couldn´t save it, I got the complaint that I was trying to write to a read-only media.
I don´t know what I did wrong, but as the rm command had already worked, I got around this problem by doing this:
I tested "save as" and that worked, and saved my new config-file as grub2.cfg.
Then I erased grub.cfg (rm grub.cfg) and renamed grub2.cfg to grub.cfg (mv grub2.cfg grub.cfg). It worked.
Then restart and...
Perfect! Opened a few applications and with all of them running, pushed the restart-button on my computer (a really ugly shutdown).
The computer booted up, and everything works perfectly. I have done it over and over again, no problem. Thanks again.
Felix Zielcke (fzielcke) wrote : | #21 |
Colin maybe it makes sense to use something like this in grub.cfg?
Untested but that should work.
if [ -s /boot/grub/grubenv ] ; then
set grubenv_notzero = "true"
fi
if [ -n $grubenv_notzero ] ; then
load_env
[...]
if [ -n $grubenv_notzero ] ; then
save_env
fi
>I couldn´t save it, I got the complaint that I was trying to write to a read-only media.
grub.cfg is made read only for everyone, inclusive root.
With vim you can overwrite it with using ":w!"
If your editor doestn't have something like this then just use sudo chmod u+w grub.cfg
But don't forget that the next update-grub run overwrites your changes nevertheless.
Stefan Berge (olyckholm) wrote : | #22 |
Overwriting should be OK, as I don´t plan to do any update until the final 9.10 arrives. By then, this bug will surely have been taken care of.
Riccardo 'c10ud' (c10ud) wrote : | #23 |
please Colin submit a new fix asap because during these stormy days this bug is getting annoying, and the 2009-10-04 solution doesn't work (if it was a solution) :)
greets
Mark Shuttleworth (sabdfl) wrote : | #24 |
Colin, this affected one of my machines today, which was up to date. It's an ext4 filesystem. Is there any more work planned on this for Lucid? I don't know how rare an event it is, but it's a catastrophic failure when it happens until someone finds this bugreport, there's little else in the way of help out there. Also, since the move to grub2, a lot of the docs Google throws up are out of date.
Changed in grub2 (Ubuntu): | |
status: | Confirmed → Fix Committed |
assignee: | nobody → Colin Watson (cjwatson) |
importance: | Undecided → High |
Quincy Tse (quincy-tse) wrote : | #25 |
Instead of changing grub.cfg, what I've done on my computer was to change /etc/grub.
Remove the lines that mentions recordfail:
$ diff /etc/grub.
59a60,61
> recordfail=1
> save_env recordfail
I then run:
$ sudo chmod u+w /boot/grub/grub.cfg
$ sudo grub-mkconfig > /boot/grub/grub.cfg
$ sudo chmod u-w /boot/grub/grub.cfg
This should stop update-grub from adding the lines back.
Quincy Tse (quincy-tse) wrote : | #26 |
I should also add that this change would affect all linux kernels - probably including other parallel linux installations in addition to the Karmic installation...
Colin Watson (cjwatson) wrote : Re: [Bug 439784] Re: invalid: environment block | #27 |
FWIW, if you change /etc/grub.
grub.cfg unwritable - /etc/grub.
not an output from it, and furthermore it's a conffile so changes to it
are preserved on upgrade.
Jordan (jordanu) wrote : Re: invalid: environment block | #28 |
I have not confirmed this yet by looking at any code, but the reason that grubenv is ending up zero bytes is likely that some code is writing to grubenv ( from linux, not grub itself ) by doing something like: write file "grubenv.tmp"; unlink file "grubenv"; rename "grubenv.tmp" , "grubenv". The reason this is likely being done is that /boot/grub/grubenv is read only. The problem is that unless in data=ordered mode ext* ( this affects ext3 also now that ordered mode is not default ) will sometimes write metadata before data. The work around to prevent zero byte files was to implicitly fsync when renaming over an existing file; because the code is unlinking grubenv first this implicit fsync is not triggered.
To fix this you could either temporarily make grubenv writable and do the standard write new file then rename over old or do: write /boot/grub/
Even if that is not the cause of the problem I don't see how checking for a zero byte file during init is a fix since this bug will prevent users from getting to init in the first place, but I am likely just not understanding something.
Colin Watson (cjwatson) wrote : Re: [Bug 439784] Re: invalid: environment block | #29 |
On Tue, Oct 13, 2009 at 05:29:10PM -0000, Jordan wrote:
> I have not confirmed this yet by looking at any code, but the reason
> that grubenv is ending up zero bytes is likely that some code is writing
> to grubenv ( from linux, not grub itself ) by doing something like:
> write file "grubenv.tmp"; unlink file "grubenv"; rename "grubenv.tmp" ,
> "grubenv". The reason this is likely being done is that
> /boot/grub/grubenv is read only. The problem is that unless in
> data=ordered mode ext* ( this affects ext3 also now that ordered mode is
> not default ) will sometimes write metadata before data. The work around
> to prevent zero byte files was to implicitly fsync when renaming over an
> existing file; because the code is unlinking grubenv first this implicit
> fsync is not triggered.
grub-editenv already does an *explicit* fsync, so I don't think this can
be it.
In any case, this bug will be fixed properly in my next upload, as per
Felix's suggestion. It's just waiting for me to have a chance to reboot
and test it.
Jordan (jordanu) wrote : Re: invalid: environment block | #30 |
Looking at grub-editenv.c, as Colin said, it does call fsync explicitly so my theory was wrong.
However, it looks like grub-editenv is still not atomic: If you run "grub-editenv /boot/grub/grubenv set foo=bar" the first thing it does in create_
Is there a reason why grub-editenv doesn't write to a temporary file? Would grub-editenv calling grub_util_error() or otherwise crashing trigger apport?
Felix Zielcke (fzielcke) wrote : Re: [Bug 439784] Re: invalid: environment block | #31 |
Am Dienstag, den 13.10.2009, 18:59 +0000 schrieb Jordan:
> However, it looks like grub-editenv is still not atomic: If you run
> "grub-editenv /boot/grub/grubenv set foo=bar" the first thing it does
> in
> create_
> truncating the actual file, not a temporary version. So if
> grub-editenv
> crashes between the fopen() and the fwrite() ( admittedly only two
> real
> lines of code ) or somehow fopen() succeeds but fwrite() fails, you
> will
> be left with a zero byte file.
>
> Is there a reason why grub-editenv doesn't write to a temporary file?
Colin already fixed this on 1st October upstream.
Now it's:
asprintf (&namenew, "%s.new", name);
fp = fopen (namenew, "wb");
[...]
fclose (fp);
if (rename (namenew, name) < 0)
grub_util_error ("cannot rename the file %s to %s", namenew, name);
That's included in beta4 which is already in Debian.
--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer
Colin Watson (cjwatson) wrote : | #32 |
On Tue, Oct 13, 2009 at 06:59:11PM -0000, Jordan wrote:
> However, it looks like grub-editenv is still not atomic: If you run
> "grub-editenv /boot/grub/grubenv set foo=bar" the first thing it does in
> create_
> truncating the actual file, not a temporary version. So if grub-editenv
> crashes between the fopen() and the fwrite() ( admittedly only two real
> lines of code ) or somehow fopen() succeeds but fwrite() fails, you will
> be left with a zero byte file.
I indeed noticed the same thing a couple of weeks ago, and fixed it
upstream for GRUB 1.97~beta4. :-)
2009-10-01 Colin Watson <email address hidden>
* util/grub-editenv.c (create_
.new suffix and then rename it into place, to ensure atomic
creation.
hanzomon4 (hanzomon4) wrote : Re: invalid: environment block | #33 |
I just got hit with this bug I updated this morning so I'll do the fix then update before I say that it's still a problem
Launchpad Janitor (janitor) wrote : | #34 |
This bug was fixed in the package grub2 - 1.97~beta4-1ubuntu1
---------------
grub2 (1.97~beta4-
* Resynchronise with Debian. Remaining changes:
+ debian/
- Adjust for default Ubuntu boot options.
- Use GRUB_CMDLINE_
default items only. These options won't be set in single user mode.
- Default to hiding the menu; holding down Shift at boot will show it.
+ debian/
- Change default value of grub2/linux_
splash".
+ debian/config.in, debian/postinst.in, debian/
- Migrate timeout settings from menu.lst.
+ debian/
- Set a monochromatic theme for Ubuntu.
+ debian/
- Apply Ubuntu branding: title, recovery mode, quiet option, and tweak
how memtest86+ is displayed.
- Use UUIDs where appropriate.
+ debian/control:
- Conflict with grub (<< 0.97-54) as well as grub-legacy.
+ debian/
- Remove GNU/Linux from default string.
+ debian/
- Add crashkernel= options if kdump and makedumpfile are available.
+ debian/
- If other operating systems are installed, then automatically unhide
the menu.
- Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus if
available to check whether Shift is pressed. If it is, show the
menu, otherwise boot immediately. If keystatus is not available,
then fall back to a short delay interruptible with Escape.
+ debian/
- Allow Shift to interrupt 'sleep --interruptible'.
+ debian/
- Don't display introductory message about line editing unless we're
actually offering a shell prompt. Don't clear the screen just before
booting if we never drew the menu in the first place.
+ debian/
- Remove some verbose messages printed before reading the
+ debian/
- If the environment variable "quiet" is set to something other than
0, suppress progress messages as the kernel and initrd load. Set
this for non-recovery kernel menu entries.
+ debian/
- Add GRUB_DEFAULT=saved, as well as grub-set-default and grub-reboot
utilities. Provides functionality essentially equivalent to GRUB
Legacy's savedefault.
+ debian/
- Keep the loopback file open so that subsequent changes to the "root"
environment variable don't affect it.
+ debian/
- Change prepare_
+ debian/
- Ignore devices loop-mounted from files in 10_linux.
+ debian/
debian/rules:
- Sh...
Changed in grub2 (Ubuntu): | |
status: | Fix Committed → Fix Released |
Victor Vargas (kamus) wrote : | #35 |
one hour ago I tried to upgrade Karmic (to date) and I get this issue too, unfortunately I can't remember if last update installs recent version of grub2. Any way, all this environment was tested under VirtualBox VM.
Regards
Colin Watson (cjwatson) wrote : Re: [Bug 439784] Re: invalid: environment block | #36 |
On Wed, Oct 14, 2009 at 01:55:37PM -0000, Kamus wrote:
> one hour ago I tried to upgrade Karmic (to date) and I get this issue
> too,
I don't think you gave it a chance to build and get to the mirrors.
Rocko (rockorequin) wrote : Re: invalid: environment block | #37 |
How long will it take to get to the mirrors? I just ran into this issue, too.
Mike Basinger (mike.basinger) wrote : | #38 |
@rocko It depends on the mirror. The mirror admin will set how often they sync to the main server.
Wayne McDougall (ubuntu-codeworks) wrote : | #39 |
How do I check what version of Grub2 I have installed?
I have experienced this bug on an up-to-date system, but it's possible the mirror was out of date. It is still at this moment telling me I am completely up to date.
Sorry for a noob question.
Felix Zielcke (fzielcke) wrote : Re: [Bug 439784] Re: invalid: environment block | #40 |
Am Samstag, den 17.10.2009, 05:02 +0000 schrieb Wayne McDougall:
> How do I check what version of Grub2 I have installed?
>
> I have experienced this bug on an up-to-date system, but it's possible
> the mirror was out of date. It is still at this moment telling me I am
> completely up to date.
>
> Sorry for a noob question.
>
dpkg -l 'grub*'
--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer
Colin Watson (cjwatson) wrote : | #41 |
On Sat, Oct 17, 2009 at 05:02:45AM -0000, Wayne McDougall wrote:
> How do I check what version of Grub2 I have installed?
>
> I have experienced this bug on an up-to-date system, but it's possible
> the mirror was out of date. It is still at this moment telling me I am
> completely up to date.
You almost certainly need to run grub-install to reinstall the boot
sector. In fact, I suggest using 'sudo dpkg-reconfigure grub-pc' to make
sure that it'll be installed automatically from now on.
Wayne McDougall (ubuntu-codeworks) wrote : Re: invalid: environment block | #42 |
Thank you. Yes I was running the old version and since the NZ mirror was 4 days old, I got the update from the main server.
Have also run grub-install and dpkg-reconfigure grub-pc
Will let you know if I have any further problems.
charlie_r (charlier653) wrote : | #43 |
New comment/bug??
I have multiple disks on my system, partitions set and labeled thusly:
sda, (hd0) SATA, with ntfs (sata) & ext3 (home2)
sdb, (hd1) IDE 0,0, with ntfs (windows install)
sdc, (hd2) IDE 0,1, with ntfs (apps) & ext3 (home)
sdd, (hd3) IDE 1,0, with ext3 (ubuntu root)
sde, (hd4) IDE 1,1, with ntfs (save) & ext3 (home3)
Problem: grub2 does not seem to like the multi disk arrangement. Keeps trying to look for things on the wrong drives, even though it is installed on sdd.
at grub prompt, if I type ls / it points to a random drive. It changes from boot to boot. I have tried set root=(hd3,1)
and set env=/boot/
Still, the grub goes random, and also gives error:invalid environment block.
Only way I can boot to karmic is to edit out the record fail line then ctrl+x.
Is this going to be a constant thing in karmic? How about in the next release in april?
Jarkko Niemi (niemi-jarkko) wrote : | #44 |
Ubuntu 9.10 i386 Desktop
Up to date system.
Single IDE drive, with Dual boot XP / Ubuntu.
/dev/sda1 NTFS
/dev/sda2 extended
/dev/sda5 linux-swap
/dev/sda3 ext4
Grub in MBR
Pentium 4 2.66MHz, 1Gb RAM
Intel chipset
IBM Netvista model: MT-M 8303-NGT
at Grub 2, editing didn't helped.
With Live-CD and grub reinstallation helped in Simple way (https:/
XP has been worked fine all time, when grub has worked and booted to there.
Gabriel M. (gabrielm) wrote : | #45 |
I got this problem just today with Karmic + all updates, so it's definitely not fixed. I'm re-opening it and attaching my hardware info with apport-collect.
Changed in grub2 (Ubuntu): | |
status: | Fix Released → Confirmed |
Gabriel M. (gabrielm) wrote : apport-collect data | #46 |
Architecture: amd64
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release Candidate amd64 (20091020.3)
Package: grub2 1.97~beta4-
PackageArchitec
ProcEnviron:
SHELL=/bin/bash
LANG=fr_CA.UTF-8
ProcVersionSign
Uname: Linux 2.6.31-20-generic x86_64
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare
Gabriel M. (gabrielm) wrote : Dependencies.txt | #47 |
Gabriel M. (gabrielm) wrote : XsessionErrors.txt | #48 |
tags: | added: apport-collected |
Gabriel M. (gabrielm) wrote : Re: invalid: environment block | #49 |
A bit more info:
- After a blank screen from an unknown cause (sleep/wakeup failed?), I had to do a hard reboot, and ended up with the same grub "error: invalid environment block" others were describing. After searching for 3-4 hours I stumbled upon this bug, and the following steps solved it: https:/
- I added a new duplicate
SwaJime (john-swajime) wrote : | #50 |
Similar situation ...
With karmic on a dell mini-9, got the invalid environment block / failed to boot default entries.
Combining the steps shown in Zaki's post #11 above with info from http://
Boot with Karmic LiveUSB
Ctrl-Alt-FN-F1
sudo -i
su - root
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
cd /mnt/boot/boot/grub
rm grubenv
grub-editenv grubenv create
grub-editenv grubenv set default=0
reboot
(remove LiveUSB *after* the shutdown completes)
thanks much guys :D
Bartosz Kosiorek (gang65) wrote : | #51 |
I have the same error after upgrade Grub to GRUB2:
"Error: Invalid environment block"
I resolved this bug in following way:
cd /boot/grub
sudo cp grubenv grubenv_bad
sudo grub-editenv grubenv create
sudo grub-editenv grubenv set default=0
sudo reboot
Now it works perfectly !
Bartosz Kosiorek (gang65) wrote : | #52 |
- Wrong /boot/grub/grubenv file which couse problem on Ubuntu 10.04 Edit (1.0 KiB, application/octet-stream)
Bartosz Kosiorek (gang65) wrote : | #53 |
summary: |
- invalid: environment block + Error: Invalid environment block |
Fabien Grise (fgrise88us) wrote : | #54 |
I just encountered this bug today on Ubuntu 11.04 (64 bits if that matters).
My computer froze and after reboot, got this error. Ubuntu seems to boot but apparently the X server cannot start.
I can still boot using the failsafe option in grub, but after making the changes to recreate grubenv, every time I reboot something writes over grubenv and it has a size of 0 ...
My version of grub is 1.99~rc1-13ubuntu3.
rumpl (rumplstielz) wrote : | #55 |
same here after boot-repair a (by the installer) false configured grub.
Windows is bootable via the grub menu but ubuntu 11.10 fails to boot
H.-Dirk Schmitt (dirk-computer42) wrote : | #56 |
Still occurs in 12.04.
Solution described in #2 fixed the problem.
tags: | added: precise |
AraiBob (rhhyatt) wrote : | #57 |
I installed on Ubuntu 13.04 and get this error after one of the updates for a new kernel. I doubt the issue is connected to that, but it is NOT directly related to the installation of 13.04 Raring.
I am NOT dual-booting. Exclusively Ubuntu 13.04
I do NOT get an error in which the normal error notification can occur.
What is the 'real' fix? I see comments above on typing in sudo commands. It looks like the problem will occur again and you have to do the same command. Hmmm?
Need a permanent fix, please...
Sergio007a (sergio007a) wrote : | #58 |
Ubuntu 12.04
Same here, Error: Invalid environment block
Press enter, then it will still log to ubuntu.
How it's happen or how to reproduce ?
After shutting down ubuntu 12.04, but without closing or shutting down firefox before. (With alot of tab open and youtube video).
Get this error, must do the leppick fix. Or shut down firefox before exiting ubuntu.
Then no more error with next reboot.
Changed in grub2 (Ubuntu): | |
assignee: | Colin Watson (cjwatson) → nobody |
A. Eibach (andi3) wrote : | #59 |
hah.
Maybe this is not a "bug" after all...
Got this as well, and ended up at this LP bug...BUT...there was something peculiar.
$ head -1 /boot/grubenv
did NOT cleanly display "GRUB Environment Block" but had a few characters garbled in that line.
I remember this from IDE times, with badly-seated cables that don't display MAXTOR but MBYUIPR or whatever on HDD detection. That's because one single bit is off due to one bent pin.
It hasn't happened too rarely that I only saw a skew cable connection when using a magnifiier, or, at least a good lighting source (which is not always given)
So thanks everybody for the "fix", but I can't blame grub2 for it yet. See above output ($ head....)
I had the same problem. Deleting grubenv had no efect.
Solved it temporarily using following commands in recovery shell
# cd /boot/grub
# rm grubenv
# grub-editenv grubenv create
# grub-editenv grubenv set default=0
# grub-editenv grubenv list
default=0