Bug 771508 - anaconda f16 upgrades grub to grub2 on system where grub2 won't boot
Summary: anaconda f16 upgrades grub to grub2 on system where grub2 won't boot
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 16
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-03 22:40 UTC by Torsten Rohlfing
Modified: 2013-02-13 21:13 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-13 21:13:49 UTC
Type: ---


Attachments (Terms of Use)

Description Torsten Rohlfing 2012-01-03 22:40:50 UTC
Description of problem:

When upgrading from F15 to F16 using preupgrade, anaconda replaces the grub bootloader with grub2. But on systems where grub2 won't work (due to small/nonexistent embedding area), this breaks booting and disables the system.


Version-Release number of selected component (if applicable):

Anaconda 16.25
grub2 1.99-13.fc16


How reproducible:

Update a F15 system with a system disk partitioned in a way not supported by grub2. My example system is partitioned as follows:

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63     2097214     1048576   83  Linux
/dev/sda2         8241345   286744184   139251420   83  Linux
/dev/sda3         2104515     8241344     3068415   82  Linux swap / Solaris



Steps to Reproduce:
1. on F15, run "preupgrade" to F16
2. reboot
3. 
  
Actual results:

Reboot fails with "file not found" error issued by grub (after boot menu appears).


Expected results:

Preferred result would be for system to boot.

In the absence of that possibility, the second-best option would be for anaconda to either not upgrade grub2 or refuse to upgrade system altogether. Third best option, perhaps, run grub2-install with using blocklists (see below). Unreliable is still better than simply broken.

Regardless, just killing the upgraded system (actual result) must be one of the worst possible choices here.


Additional info:

Problem apparently originates with grub2's inability to find sufficient space for its core.img file on legacy-partitioned disks.

grub2-install produces something like this:

/sbin/grub2-setup: warn: Your embedding area is unusually small. core.img won't fit in it..
/sbin/grub2-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/sbin/grub2-setup: error: will not proceed with blocklists.

Comment 1 Terje Røsten 2012-01-08 14:16:51 UTC
I have seen this on  ~10 boxen now. 

Must boot from Fedora 15 DVD[1] in rescue mode and run:

$ chroot /mnt/sysimage
$ grub2-install --recheck --no-floppy --force /dev/sda

After that, every system has been working just fine.

Why will anaconda not fall back to use the --force option when it's sure not to work
without the option?

[1]: Another issue: Fedora *16* DVD in rescue mode don't find the installed system.

Comment 2 Christopher Beland 2012-02-13 02:48:27 UTC
I had the same problem, and cured it with:

mount /dev/sda1 /mnt/hd
grub2-install --recheck --boot-directory=/mnt/hd/boot /dev/sda

Unfortunately, it took me about a month to get around to finding the solution, and in the meantime I spilled water on my laptop.  The F16 box was its filesystem backup, so I may have lots a bunch of data due to this machine being down.  8(

I just have the Fedora installed on /dev/sda1 with the entire filesystem mounted on / including /boot and everything else all in one partition.  (I like keeping things simple.)

Comment 3 Gregoire Barbier 2012-05-19 13:49:15 UTC
I had the same problem. The following explain what successful solution I found.
I think that it would be great if next Fedora releases either fix the issue or at less warn at install/upgrade time.

> /dev/sda1   *          63     2097214     1048576   83  Linux

Like in your case, my first partition began too early, at sector 63, which used to be default sector proposed by fdisk, and leave only 32kB to install the boot loader in the MBR.

My first partition was my /boot partition, thus it was small and I was able to backup it, destroy it, and create it again at sector 2047 instead of 63. 2047 is the new fdisk default value and leaves 1 MB to the boot loader, which is enough for GRUB2.

After recreating the partition I restored the data and installed GRUB2 without problems (grub2-install /dev/sda).

I did everything using rescue mode on F16 DVD. This is rather long because you have to reboot at less twice (to reload partitions table) but works well. What took me several hours was not to resize the partition, but to guess what was happening.

To be frank my problem was slightly harder because my /boot was not an ext2 partition but rather an ext2 partition over software raid device, hence I had to recreate partitions on both sda2 and sdb2 and then install GRUB twice. But in your case this is irrelevant.

I personnaly think that Anaconda/preupgrade should warn when GRUB2 does not install because the MBR is too small. I performed the upgrade with a DVD and was only warned that "the boot loader did not install" with no clue about the problem or the way to solve it.

Comment 4 Fedora End Of Life 2013-01-16 16:58:40 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Fedora End Of Life 2013-02-13 21:13:53 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.