After Maverick to Natty upgrade, grub won't boot and displays "symbol not found : 'grub_env_export'"

Bug #756564 reported by Hadrien Titeux
74
This bug affects 15 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Invalid
High
Unassigned

Bug Description

Binary package hint: grub2

It's pretty much all in the title, but Grub2 messed up after the upgrade from 10.10 to 11.04. During the install, i watched carefully the configuration procedure, it ran fine.
I then just rebooted, and there it was: grub simply said:
error: symbol not found: 'grub_env_export'
grub rescue>

(btw: grub rescue doesn't even return me a help menu on "help")

Revision history for this message
Colin Watson (cjwatson) wrote :

The problem is almost certainly that grub-pc is misconfigured on your system. Get back in using a live CD (https://help.ubuntu.com/community/Grub2#METHOD%203%20-%20CHROOT), but instead of running grub-install, run 'debconf-show grub-pc' and post the output to this bug. Then run 'dpkg-reconfigure grub-pc' and make sure that all of the disks on your system are selected but none of the partitions, unless you know better. Then exit, unmount, and reboot as documented on the help.ubuntu.com page.

Revision history for this message
Hadrien Titeux (hadware) wrote :

Yeah, i didn't want to use the good'ol CDboot-and-chroot method to repair GRUB until someone more advanced than could maybe use the bug to eventually fix it. The repair worked fine, and i can merilly boot my 11.04 now.
The command output you asked is attached to this message.

I may precise that my computer conf may have "tricked" in some ways the grub installer:
sda: an old XP with only 1 partition
sdb: an "automatic-use-the-whole-disk" ubuntu install
Not so complicated actually, but what do you know...
Thanks!

Revision history for this message
Bart Cerneels (stecchino) wrote :

I'm hit by the same issue but with a twist. I'm using an encrypted root and nothing I seem to do, just can't seem to get past this grub error, even when booting from USB. I think I might have to reinstall without being able to rescue my data...

This is a quite serious bug, how come natty was released before this was resolved?

Revision history for this message
Martin Eve (martineve) wrote :

Just encountered this on an upgrade; not great, going to attempt the grub2 recovery.

Revision history for this message
Bart Cerneels (stecchino) wrote :

Finally managed to fix grub, at least the rest of the natty upgrade seems to have succeeded.
I had to use a different distro (systemrescue cd) to do the chroot and the first 'dpkg-reconfigure grub-pc' didn't seem to work, possible because of an error (could not write to /livemnt/boot). But after a second attempt, mkdir -p /livemnt/boot; mount -o bind /boot /livemnt/boot and a finale grub-install /dev/sda to be sure I have a working system again.

Attaching the output of 'debconf-show grub-pc' before attempting the fix.

Revision history for this message
Giuseppe Pennisi (giupenni78) wrote :

I have the same problem but I use Linux Kernel RAID0.
I can fix it?

Revision history for this message
Roman Yepishev (rye) wrote :

Same here, on a released version of Natty

Revision history for this message
Roman Yepishev (rye) wrote :
Revision history for this message
Roman Yepishev (rye) wrote :

It looks like grub is being installed on the first found hard drive even if it was originally on the second one.

I was able to reproduce this issue with the following VM (libvirt) setup:

/dev/sda - unpartitioned hard drive, ide bus
/dev/sdb - msdos label, ide bus containing Ubuntu Lucid 10.04.1 installation.

After the upgrade from Lucid to Maverick the bootloader works properly
After the upgrade from Maverick to Natty the bootloader failed with:

http://ubuntuone.com/p/q37/

error: the symbol `grub_xputs` not found
grub rescue>

Changed in grub2 (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Hadrien Titeux (hadware) wrote : Re: [Bug 756564] Re: Ater Maverick to Natty upgrade, grub won't boot and displays "symbol not found : 'grub_env_export'"

I'll test it on another pc with the same config.

On 2 May 2011 14:11, "Roman Yepishev" <email address hidden> wrote:

It looks like grub is being installed on the first found hard drive even
if it was originally on the second one.

I was able to reproduce this issue with the following VM (libvirt)
setup:

/dev/sda - unpartitioned hard drive, ide bus
/dev/sdb - msdos label, ide bus containing Ubuntu Lucid 10.04.1
installation.

After the upgrade from Lucid to Maverick the bootloader works properly
After the upgrade from Maverick to Natty the bootloader failed with:

http://ubuntuone.com/p/q37/

error: the symbol `grub_xputs` not found
grub rescue>

** Changed in: grub2 (Ubuntu)
      Status: New => Confirmed

** Changed in: grub2 (Ubuntu)
  Importance: Undecided => High

--
You received this bug notification because you are a direct subscriber
of the bug.
https://bugs...
 Confirmed

Bug description:
Binary package hint: grub2

It's pretty much all in the title, but Grub2 messe...

Revision history for this message
Malte S. Stretz (mss) wrote :

I just ran into this bug as well (upgrade from maverick to natty).

I remember that I saw something I interpreted as a warning flying by when I did the dist-upgrade. Some part of grub complained that it couldn't probe /dev/disk/by-id/ata-WDC-....something. I had a look and there was indeed a wrong entry in /boot/grub/device.map. I assumed that this would be either ignored or fixed at some later point and rebooted... (stupid me)

Indeed, I recently replaced disks, that file pointed to my old harddisk. I had a look at my notebook which I already upgraded successfully and don't have a device.map here. Guess I can tell you more once the other box is up again :-/

P.S.: Offering a grub resuce shell without even a help command is crap.

summary: - Ater Maverick to Natty upgrade, grub won't boot and displays "symbol not
- found : 'grub_env_export'"
+ After Maverick to Natty upgrade, grub won't boot and displays "symbol
+ not found : 'grub_env_export'"
Revision history for this message
Malte S. Stretz (mss) wrote :

Booting from a Live CD and `sudo grub-install --boot-directory=/media/xyz /dev/sda` (I've got a separate boot partition) fixed this problem. Afterwards, the device.map file didn't exist anymore.

I cat'ed /var/log/dist-upgrade/apt-term.log and /var/log/dist-upgrade/20110502-1000/apt-term.log together and attached it. Only the former has the errors I remembered before, it seems like the latter continues afterwards. These are the relevant lines:

Setting up grub-common (1.99~rc1-13ubuntu3) ...
Installing new version of config file /etc/grub.d/00_header ...
Installing new version of config file /etc/grub.d/30_os-prober ...
Installing new version of config file /etc/grub.d/20_linux_xen ...
Installing new version of config file /etc/grub.d/10_linux ...
Setting up grub-pc (1.99~rc1-13ubuntu3) ...
Installing new version of config file /etc/kernel/postinst.d/zz-update-grub ...
Installing new version of config file /etc/kernel/postrm.d/zz-update-grub ...
Installing new version of config file /etc/grub.d/05_debian_theme ...
Replacing config file /etc/default/grub with new version
/usr/sbin/grub-probe: error: cannot stat `/dev/disk/by-id/ata-WDC_WD3200AAJS-22B4A0_WD-WCAT12038234'.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.38-8-generic
Found linux image: /boot/vmlinuz-2.6.35-28-generic
Found initrd image: /boot/initrd.img-2.6.35-28-generic
Found linux image: /boot/vmlinuz-2.6.35-27-generic
Found initrd image: /boot/initrd.img-2.6.35-27-generic
Found memtest86+ image: /memtest86+.bin
File descriptor 40 (/var/log/dist-upgrade/history.log) leaked on lvs invocation. Parent PID 26922: /bin/sh
File descriptor 44 (/var/log/dist-upgrade/apt.log) leaked on lvs invocation. Parent PID 26922: /bin/sh
File descriptor 74 (/var/log/dist-upgrade/apt.log) leaked on lvs invocation. Parent PID 26922: /bin/sh
done
Setting up grub-gfxpayload-lists (0.2) ...

Revision history for this message
Malte S. Stretz (mss) wrote :

P.S.: I think this bug should be referenced from the Release Notes.

Revision history for this message
Olivier Mengué (dolmen) wrote :

Here is my result of "debconf show grub-pc":
----8<--------8<--------8<--------8<----
  grub2/kfreebsd_cmdline:
  grub2/device_map_regenerated:
* grub2/linux_cmdline:
  grub-pc/install_devices_empty: false
  grub-pc/install_devices_failed: false
  grub-pc/chainload_from_menu.lst: true
  grub-pc/hidden_timeout: true
  grub-pc/timeout: 10
  grub-pc/kopt_extracted: false
* grub-pc/install_devices: /dev/disk/by-id/ata-FUJITSU_MHV2120BH_PL_NW9ST72279H9-part3
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/disk_description:
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/partition_description:
  grub-pc/install_devices_disks_changed:
* grub2/linux_cmdline_default: quiet splash
* grub-pc/mixed_legacy_and_grub2: true
----8<--------8<--------8<--------8<----

"dpkg-reconfigure grub-pc" has only "/dev/sda3" (my /boot partition) selected which probably explains why /dev/sda has not been updated by the Natty upgrade.

I would like to have grub only in /dev/sda3, but I don't like to have grub in /dev/sda. I would like only a basic boot sector in /dev/sda that would be system agnostic and only load the boot sector of the active partition (which, in that case would be /dev/sda3). That would allow me to easily drop a system partition and switch to an other system using only fdisk by activating an other partition.

Revision history for this message
Hadrien Titeux (hadware) wrote :

I tested it on a PC with 2 hard disks, basically the same and exact configuration, but amazingly it ran *fine*. The only difference is that on the other PC (the one that created the bug), both HDD were SATA, and here one of the two is IDE.

Revision history for this message
Attila Lendvai (attila-lendvai) wrote :

i also saw this after upgrading to 11.04.

grub-install was not enough for me (at boot i got a grub prompt only), i had to do an update-grub in a chroot, too.

Revision history for this message
mitchelln (mitchell-neill) wrote :

I had this problem as well/ I'm running soft raid with raid-0 on Intel chipset. Upgrade all completed, but upon reboot I got grub_env_export error.

The problem is that the upgrade did not create a dmraid initrd image. I booted from live CD and CHROOTed.

Then did:

apt-get purge dmraid
apt-get install dmraid
grub install /dev/mapper/isw_jfijhfbah_MY_RAID
update grub.

Rebooted and everything was fine.

Needless to say that this would be way beyond a non linux expert. I had exactly the same problem when I upgraded from Lucid to Maverick. So to have exactly the same problem when upgrading to narwhal is extremely disappointing.

You need to start testing RAID installs and upgrades properly Ubuntu.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Happened also to me on a non-RAID, but two disk system.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

The WD device is not from where maverick booted - granted, I installed the second HD while using maverick and installed grub manually to the new disk, leaving the WD (now /dev/sdb) to host some data files. I don't know if a situation like this can be solved (although of course the information from where the system was booted from is available during upgrade).

Revision history for this message
Sebastian Schuberth (sschuberth) wrote :

I'm seeing the same grub error when booting, *however*, it just flashes up quickly and then the regular grub menu is displayed, and all boot entries work fine. I've already tried to (re-)run "grub-install" / "update-grub" / "dpkg-reconfigure grub-pc" to get rid of the error message, without success.

Funnily, "grub-probe -t device /boot/grub" displays "/dev/sda5" on my system (which is my Linux partition) although I specified "/dev/sda" in my last run of "grub-install". Is this expected?

Revision history for this message
m1st0 (m1st0) wrote :

Followed these steps from mitchelln and http://karuppuswamy.com/wordpress/2010/06/02/how-to-chroot-to-ubuntu-using-live-cd-to-fix-grub-rescue-prompt/ to repair my natty RAID1 upgrade:

# Boot from LiveCD
# Made a directory to mount the root filesystem to
sudo mkdir /media/internal
# -- Going to chroot into our RAID1 system
# Notice the following is not the whole RAID drive nor the swap, just where the root filesystem exists (specific to my system)
sudo mount /dev/mapper/[partition where the root filesystem is on the RAID] /media/internal
# i.e. sudo mount /dev/mapper/isw_[some-id]_RAID1p5 /media/internal
sudo mount --bind /dev /media/internal/dev
sudo mount --bind /proc /media/internal/proc
sudo mount --bind /sys /media/internal/sys
sudo chroot /media/internal
# May not be there
apt-get purge dmraid
apt-get install dmraid
# I believe here it is the whole RAID disk, not just the partition
grub-install /dev/mapper/isw_[some-id]_RAID1
update-grub2
reboot

That was it. Unfortunately, I do have an error that appears on the splash screen relating to skip the mounting process or the similar, but once skipped my login screen came up and system is operational.

Revision history for this message
m1st0 (m1st0) wrote :

Of course, I would not have had to do the above steps if I had fixed the RAID setup before restarting right after the upgrade to Natty. I likely would only have had to do the following before a reboot:

# May not be there
apt-get purge dmraid
apt-get install dmraid
# I believe here it is the whole RAID disk, not just the partition
grub-install /dev/mapper/isw_[some-id]_RAID1
update-grub2
reboot

Revision history for this message
pureblood (freeseek) wrote :

I had the same problem. I think what is happening is that grub 1.99 is not installed in the mbr. Not sure why. Does it say grub 1.98 on your grub console? I fixed the problem with the following command lines:
sudo apt-get purge grub-common
sudo apt-get install grub-pc
After booting the system from grub 1.98 with:
linux /vmlinux root=UUID=877e3558-6ecf-4908-818f-b0369b692834
initrd /initrd.img
boot
Notice that the UUID might not be the same in your system.

Revision history for this message
Sebastian Schuberth (sschuberth) wrote :

pureblood, in case you were referring to my post, my grub menu says 1.99~rc1-13ubuntu3, the same version that is installed on my Kubuntu 11.04. However, I just noticed the error message no longer says "error: symbol not found" (so my initial reinstall of grub seems to have fixed that), but "error: no video mode activated", which is bug 699802. Sorry for the noise.

tags: added: grub-modules-skew
Revision history for this message
Rickard Westman (rwestman) wrote :

I see the same thing as the original bug reporter, upgrading from 10.10 to 11.04. Will attach output of "debconf-show grub-pc" in a moment.

Revision history for this message
Rickard Westman (rwestman) wrote :

  grub2/kfreebsd_cmdline:
  grub2/device_map_regenerated:
  grub2/linux_cmdline:
  grub-pc/install_devices_failed: false
  grub-pc/chainload_from_menu.lst: true
  grub-pc/kopt_extracted: false
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/disk_description:
  grub2/kfreebsd_cmdline_default: quiet
  grub2/linux_cmdline_default: quiet splash
  grub-pc/install_devices_empty: false
  grub-pc/hidden_timeout: true
  grub-pc/timeout: 10
  grub-pc/install_devices:
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/partition_description:
  grub-pc/install_devices_disks_changed:
  grub-pc/mixed_legacy_and_grub2: true

Revision history for this message
Rickard Westman (rwestman) wrote :

The above output was from "debconf-show grub-pc" run directly from the live CD. I now realize that I should probably have mounted the relevant hard disk partition (/dev/sda6) and chrooted to it first. Then, the output is:

  grub2/kfreebsd_cmdline:
  grub2/device_map_regenerated:
* grub2/linux_cmdline:
  grub-pc/install_devices_empty: false
  grub-pc/install_devices_failed: false
  grub-pc/chainload_from_menu.lst: true
  grub-pc/hidden_timeout: false
  grub-pc/timeout: 10
  grub-pc/kopt_extracted: false
* grub-pc/install_devices: /dev/sda6
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/disk_description:
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/partition_description:
  grub-pc/install_devices_disks_changed:
* grub2/linux_cmdline_default: quiet splash
  grub-pc/mixed_legacy_and_grub2: true

Revision history for this message
Rickard Westman (rwestman) wrote :

Regarding the suggestion in #2:

> Then running run 'dpkg-reconfigure grub-pc' and make sure that all of the disks on your
> system are selected but none of the partitions, unless you know better.

If I just run this command, I don't get to select or deselect any partitions or disks - I'm just asked about the "Linux command line" (shown as empty by default) and "Linux parameters for the default menu entry but not for the recovery mode" (shown as "quiet splash" by default). So I was not sure what I should do to follow the recommendation of selecting all disks but none of the partitions. Just running "dpkg-reconfigure grub-pc" and accepting the defaults did *not* make my Ubuntu installation bootable.

I then tried the following sequence of commands (/dev/sda6 being the partition where I had Ubuntu installed) and it did make my Ubuntu partition bootable:

  mount /dev/sda6 /mnt
  mount --bind /proc /mnt/proc
  mount --bind /dev /mnt/dev
  mount --bind /sys /mnt/sys
  chroot /mnt
  update-grub
  grub-install /dev/sda
  exit
  umount /mnt/sys /mnt/dev /mnt/proc /mnt
  reboot

After I did this and got my Ubuntu bootable, I tried "dpkg-reconfigure grub-pc" again, and now I *did* get questions about what disks/partitions I wanted to install grub2 to. I also got some progress information in the terminal window I did not get before, so it seems the original attempt aborted prematurely somehow (but without leaving any kind of error message).

Revision history for this message
Phillip Susi (psusi) wrote :

Maverick and Natty have reached end of life and are no longer supported.

Changed in grub2 (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.