Bug 911250 - Grub 2: sparse file not allowed
Summary: Grub 2: sparse file not allowed
Status: RESOLVED DUPLICATE of bug 856391
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: Bootloader (show other bugs)
Version: 13.2
Hardware: x86-64 openSUSE 13.2
: P5 - None : Critical (vote)
Target Milestone: ---
Assignee: Michael Chang
QA Contact: Jiri Srain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-24 16:56 UTC by Forgotten User 2ZOw4Ks_yC
Modified: 2015-11-25 19:00 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Faulty grub header (9.07 KB, application/x-shellscript)
2014-12-24 16:56 UTC, Forgotten User 2ZOw4Ks_yC
Details
Workaroung grub header (9.08 KB, text/plain)
2014-12-24 16:57 UTC, Forgotten User 2ZOw4Ks_yC
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Forgotten User 2ZOw4Ks_yC 2014-12-24 16:56:52 UTC
Created attachment 618358 [details]
Faulty grub header

Hi,

One day Grub 2 just stopped showing me dual boot menu.

Actually, menu as be replace by a very fast error message, it was:

    error: sparse file not allowed

Without success, I tried to regenerate Grub's menu with:

    $ sudo /usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg

Then I commented some lines in /etc/grub.d/00_header as I red on a blog[1] and regenerate Grub's menu with previous command.

The error message is gone but grub dual boot menu still does not appear.

How can I recover dual boot?

Thanks for the work.
Kevin


[1] https://www.barryprice.co.uk/2012/05/04/fun-with-btrfs/ .
Comment 1 Forgotten User 2ZOw4Ks_yC 2014-12-24 16:57:37 UTC
Created attachment 618359 [details]
Workaroung grub header
Comment 2 Wolfgang Bauer 2014-12-24 17:09:55 UTC
(In reply to Kevin KIN-FOO from comment #0)
> Created attachment 618358 [details]
> Faulty grub header
The header is not faulty per se.
The problem is that grub2 cannot write to a btrfs partition, so it cannot reset the specified boot entry and boots it again and again (without showing the menu).
See bug#856391, of which this is a duplicate IMHO.

> How can I recover dual boot?
Remove the file /boot/grub2/grubenv and your menu should be back.
Comment 3 Forgotten User 2ZOw4Ks_yC 2015-01-05 08:40:37 UTC
(In reply to Wolfgang Bauer from comment #2)
> (In reply to Kevin KIN-FOO from comment #0)
> > Created attachment 618358 [details]
> > Faulty grub header
> The header is not faulty per se.
> The problem is that grub2 cannot write to a btrfs partition, so it cannot
> reset the specified boot entry and boots it again and again (without showing
> the menu).
> See bug#856391, of which this is a duplicate IMHO.
> 
> > How can I recover dual boot?
> Remove the file /boot/grub2/grubenv and your menu should be back.

I removed /boot/grub2/grubenv and menu is back and working.

Should we close this bug and mark it as duplicate of bug#856391 as I use btrfs.
Comment 4 Forgotten User OhAPCihhTu 2015-01-06 02:54:26 UTC
Hi Kevin, I do not know if this will work for you, but I had a similar case today. After an update (mainly patches through Yast), grub presented only the "sparse file not allowed" error and no more boot menu as well.

The solution was quite simpler than what I have read. Just open Yast / System / Bootloader /  and on the tab "Bootloader options" just unselect the first line "search for other operative systems"; accepted and restarted. Grub as good as before the update.

This is in an HP notebook with OpenSUSE 13.2 _64bits (alone, no other OS).
Regards,

Gian Paolo Sanino
Comment 5 Forgotten User 2ZOw4Ks_yC 2015-01-06 10:30:57 UTC
(In reply to Gian Paolo Sanino from comment #4)
> Hi Kevin, I do not know if this will work for you, but I had a similar case
> today. After an update (mainly patches through Yast), grub presented only
> the "sparse file not allowed" error and no more boot menu as well.
> 
> The solution was quite simpler than what I have read. Just open Yast /
> System / Bootloader /  and on the tab "Bootloader options" just unselect the
> first line "search for other operative systems"; accepted and restarted.
> Grub as good as before the update.
> 
> This is in an HP notebook with OpenSUSE 13.2 _64bits (alone, no other OS).
> Regards,
> 
> Gian Paolo Sanino

Hi,

Your solution is an elegant way to bypass the problem.
Do you have several OS on your computer?

Kevin
Comment 6 Wolfgang Bauer 2015-01-06 22:04:35 UTC
(In reply to Gian Paolo Sanino from comment #4)
> The solution was quite simpler than what I have read. Just open Yast /
> System / Bootloader /  and on the tab "Bootloader options" just unselect the
> first line "search for other operative systems"; accepted and restarted.
> Grub as good as before the update.
Hm, how is this easier than just removing grubenv? ;)

But you're right, your solution works as well, because YaST resets grubenv.

Btw, you do _not_ have to disable "search for other operative systems". It will work as well if you just enter YaST->Boot Loader and press OK.
The os-prober is totally unrelated to the problem.

As you mentioned this happening "after an update": this should not be caused by any update. But maybe you installed a kernel update, and then hibernated before rebooting to the new kernel? There is another bug that would cause the hibernate script to set the wrong boot entry and your system would not resume from hibernation at all (and therefore not reset grubenv). See bug#911243

@Kevin: Probably this other bug was what actually happened to you?
Comment 7 Jean Delvare 2015-04-04 12:31:36 UTC
I am affected by this bug too.
Comment 8 Wolfgang Bauer 2015-11-25 19:00:50 UTC
Ok, since there's no answer to my question, let's close it as duplicate of  bug#856391 now.

It is fixed in Tumbleweed and Leap 42.1 btw, grub2 uses a special filesystem area in the case of btrfs for its "environment block" instead of /boot/grub2/grubenv.
I hope we can release this as update for 13.2 as well.

*** This bug has been marked as a duplicate of bug 856391 ***