Bug 836695 - using grub2-install with grub2-2.00-1.fc18 breaks booting - "error: premature end of file /vmlinuz-3.5..."
using grub2-install with grub2-2.00-1.fc18 breaks booting - "error: premature...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: grub2 (Show other bugs)
rawhide
x86_64 Linux
unspecified Severity urgent
: ---
: ---
Assigned To: Peter Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks: F18Alpha/F18AlphaBlocker 838421
  Show dependency treegraph
 
Reported: 2012-06-29 22:26 EDT by Andre Robatino
Modified: 2012-07-29 22:58 EDT (History)
15 users (show)

See Also:
Fixed In Version: grub-2.00-3.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 838421 (view as bug list)
Environment:
Last Closed: 2012-07-29 22:58:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
output of "fdisk -l" (1.08 KB, text/plain)
2012-06-30 15:36 EDT, Andre Robatino
no flags Details
output of "parted -l" (1.32 KB, text/plain)
2012-06-30 17:41 EDT, Andre Robatino
no flags Details

  None (edit)
Description Andre Robatino 2012-06-29 22:26:43 EDT
Description of problem:
If grub2-2.00-1.fc18 is installed, then running grub2-install makes it impossible to boot ("error: you need to load the kernel first."). AFAICT this is the first version of grub2 with this problem. One can recover by booting into rescue mode, downgrading to an earlier grub2 version, and running grub2-install and grub2-mkconfig.

Version-Release number of selected component (if applicable):
grub2-2.00-1.fc18.x86_64

How reproducible:
always

Steps to Reproduce:
1. Install grub2-2.00-1.fc18.
2. Run "grub2-install /dev/sda" (or whatever the device is) and "grub2-mkconfig -o /boot/grub2/grub.cfg".
  
Actual results:
Can't boot any of the installed kernels.
Comment 1 Michal Schmidt 2012-06-30 04:39:04 EDT
I'm seeing the same problem. The complete error message from grub looks like this:

Loading Linux 3.5.0-0.rc4.git3.1.fc18.x86_64 ...
error: premature end of file /vmlinuz-3.5.0-0.rc4.git3.1.fc18.x86_64.
Loading initial ramdisk ...
error: you need to load the kernel first.


As a workaround it is possible to replace "linux" with "linux16" and "initrd" with "initrd16". Then it loads the kernel without problems.
Comment 2 Andre Robatino 2012-06-30 09:48:05 EDT
In the process of downgrading I ended up removing grub2 before installing the old version. Now the boot menu seems mostly busted (I can't see any of the entries). I think it might be good for testing each grub2 version to fully remove the old version, install the new one, and run grub2-install and grub2-mkconfig, just to catch such problems early.
Comment 3 Andre Robatino 2012-06-30 14:33:49 EDT
I removed grub2-2.00, removed the leftover /etc/default/grub file, installed the 17 Gold version (grub2-2.0-0.25.beta4.fc17), customized /etc/default/grub, and ran grub2-install and grub2-mkconfig. Booting worked normally at this point. I then updated to grub2-2.00 and ran grub2-mkconfig again (but NOT grub2-install). Booting still works normally.
Comment 4 Vladimir Serbinenko 2012-06-30 15:25:29 EDT
Could you provide information about your install layout? (including filesysems and partitioning info)
Comment 5 Andre Robatino 2012-06-30 15:28:53 EDT
This is a VirtualBox VM. I used the entire disk when installing, 30 GB image, default partitioning. It should be reproducible on almost any machine.
Comment 6 Andre Robatino 2012-06-30 15:36:01 EDT
Created attachment 595470 [details]
output of "fdisk -l"
Comment 7 Andre Robatino 2012-06-30 17:41:38 EDT
Created attachment 595478 [details]
output of "parted -l"
Comment 8 Jens Petersen 2012-07-05 05:29:14 EDT
Easily reproduced immediately after a fresh rawhide install.
ie Rawhide installs successfully and then fails to boot as above.
Comment 9 Mads Kiilerich 2012-07-05 06:19:13 EDT
A wild shot would be to blame the new grub-2.00-who-trusts-you-and-who-do-you-trust.patch - try to build a grub2 without that patch and see if that shows the same behaviour.

(grub-2.00-add-fw_path-search.patch cause other regressions for EFI - but that is probably no the issue here.)
Comment 10 Michal Schmidt 2012-07-05 07:26:41 EDT
A local build of grub2 without grub-2.00-who-trusts-you-and-who-do-you-trust.patch works for me.
Comment 11 Alexey V. Polyakov 2012-07-07 07:47:38 EDT
(In reply to comment #10)
> A local build of grub2 without
> grub-2.00-who-trusts-you-and-who-do-you-trust.patch works for me.

Works for me too, thanks!
Comment 12 Jayson Rowe 2012-07-08 21:37:31 EDT
Wanted to add I got the same trying to install Rawhide on physical hardware. My exact message is:
Loading Linux 3.5.0-0.rc5.git3.1.fc18.x86_64 ...
error: premature end of file /vmlinuz-3.5.0-0.rc5.git3.1.fc18.x86_64.
Loading initial ramdisk ...
error: you need to load the kernel first.

Press any key to continue...
Comment 13 Nils Philippsen 2012-07-10 08:02:55 EDT
Same here on physical hardware, /boot on ext4, / and /home on xfs. Will check if Mads' suggestion in comment #9 helps me as well.
Comment 14 Nils Philippsen 2012-07-10 08:32:33 EDT
It does help -- asks me for username and password before I'm allowed to boot the kernel, however. As a stop-gap for others affected, here's my scratch build with the patch removed:

http://koji.fedoraproject.org/koji/taskinfo?taskID=4230032
Comment 15 Jens Petersen 2012-07-19 03:33:22 EDT
This critical issue has been open now for nearly 3 weeks...
What is the plan of action??
Comment 16 Ben Boeckel 2012-07-19 21:32:31 EDT
Still an issue with Rawhide as of today. Will try the grub above if this boot works (been looking at Plymouth with a tty login prompt visible, but not active, for a while).
Comment 17 Jens Petersen 2012-07-19 23:50:19 EDT
Who votes for untagging grub2-2.00-1.fc18?
Comment 18 Jens Petersen 2012-07-22 21:16:05 EDT
(In reply to comment #14)
> It does help -- asks me for username and password before I'm allowed to boot
> the kernel, however.

So disabling grub-2.00-who-trusts-you-and-who-do-you-trust.patch?
I wonder if the discrepancy with others is due to difference between
installing rawhide and just updating kernel for existing install?

Anyway really wish something could be done about it this.
Breaking rawhide boot for over 3 weeks seems unacceptable to me.
Comment 19 Mads Kiilerich 2012-07-23 08:10:08 EDT
(In reply to comment #18)
> Anyway really wish something could be done about it this.
> Breaking rawhide boot for over 3 weeks seems unacceptable to me.

The grub2 package owner rarely (if ever) pays any attention to bugzilla and might not be aware of the issue. Try to contact him directly or through internal channels.
Comment 20 Nils Philippsen 2012-07-23 12:05:28 EDT
(In reply to comment #18)
> (In reply to comment #14)
> > It does help -- asks me for username and password before I'm allowed to boot
> > the kernel, however.
> 
> So disabling grub-2.00-who-trusts-you-and-who-do-you-trust.patch?

Yes.
Comment 21 Nils Philippsen 2012-07-24 05:19:42 EDT
(In reply to comment #19)
> The grub2 package owner rarely (if ever) pays any attention to bugzilla and
> might not be aware of the issue. Try to contact him directly or through
> internal channels.

How is this acceptable?
Comment 22 Peter Jones 2012-07-25 09:51:34 EDT
Please try grub-2.00-3.fc18 , it should be better.
Comment 23 Andre Robatino 2012-07-26 15:55:38 EDT
(In reply to comment #22)
> Please try grub-2.00-3.fc18 , it should be better.

Works for me. (Had to grab from Koji since there hasn't been a Rawhide push.)
Comment 24 Jens Petersen 2012-07-29 22:58:17 EDT
Works for me too from rawhide install.  Closing this out.

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