Bug 18781 - grub2 flashes "error: sparse file not allowed" message when booting from btrfs
Summary: grub2 flashes "error: sparse file not allowed" message when booting from btrfs
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Low minor
Target Milestone: ---
Assignee: Barry Jackson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 416
  Show dependency treegraph
 
Reported: 2016-06-24 13:33 CEST by Thierry Vignaud
Modified: 2021-03-03 14:53 CET (History)
2 users (show)

See Also:
Source RPM: grub2-2.02-0.git10457.7.mga6
CVE:
Status comment:


Attachments

Description Thierry Vignaud 2016-06-24 13:33:10 CEST
grub2 flashes "error: sparse file not allowed" message when booting from btrfs.
While not a real issue, it doesn't look good.

See also:
https://bugzilla.opensuse.org/show_bug.cgi?id=849718
https://bugzilla.opensuse.org/show_bug.cgi?id=856391
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/736743
(especially Colin Watson's comment in last one)
Thierry Vignaud 2016-06-24 13:33:27 CEST

Priority: Normal => Low
Blocks: (none) => 416
Severity: normal => minor

Comment 1 Thierry Vignaud 2016-07-04 18:17:23 CEST
There's a similar issue for LVM/RAID:
"grub2 diskfilter writes not supported"
Comment 2 Alejandro Vargas 2016-07-07 15:38:06 CEST
Here is a posible walk around:

http://askubuntu.com/questions/100329/message-sparse-file-not-allowed-after-installing-on-a-btrfs-filesystem



either comment out or remove this line:

if [ -n ${have_grubenv} ]; then save_env recordfail; fi
or

if [ -n "\${have_grubenv}" ]; then if [ -z "\${boot_once}" ]; then save_env \
recordfail; fi; fi
in this file

/etc/grub.d/00_header
then run

update-grub

CC: (none) => alejandro.anv

Comment 3 Thierry Vignaud 2016-07-07 18:13:55 CEST
That's not a proper fix as it breaks the future for people where it's supported.
Barry, I think it's just better to disable the warning and let this feature not work for the "happy few"
Comment 4 Otto Leipälä 2016-07-08 20:21:41 CEST
Even if you wait it will automatically start to boot system so it can be just ignored.

I am too against that op posted hack that would break whole grub if you make little mistake.

CC: (none) => ozkyster

Comment 5 Alejandro Vargas 2016-07-08 20:23:37 CEST
I don't understand why in Mageia 5 with grub 2 there is no problem using btrfs.
Comment 6 Barry Jackson 2016-07-09 01:25:25 CEST
(In reply to Alejandro Vargas from comment #5)
> I don't understand why in Mageia 5 with grub 2 there is no problem using
> btrfs.

IIRC in Mga5 all grub2 messages to screen were suppressed by a patch, in Mga6 I think the patch was removed, but I have not had time to check.
Comment 7 Otto Leipälä 2016-07-09 22:42:52 CEST
This is very normal case that Cauldron have dropped some patches what may break something and this kind of minor "bugs" are fixed when it hits release freeze.
Comment 8 Barry Jackson 2016-07-10 13:25:33 CEST
(In reply to Thierry Vignaud from comment #3)
> That's not a proper fix as it breaks the future for people where it's
> supported.
> Barry, I think it's just better to disable the warning and let this feature
> not work for the "happy few"

OK, I have committed a fix that disables that message and returns without the delay:

   if (total_length != grub_file_size (file))
     {
       /* Maybe sparse, unallocated sectors. No way in GRUB.  */
-      return grub_error (GRUB_ERR_BAD_FILE_TYPE, "sparse file not allowed");
+      /*return grub_error (GRUB_ERR_BAD_FILE_TYPE, "sparse file not allowed")*/
+       return GRUB_ERR_NONE;
     }

It works for me so submitting and closing as fixed.

Resolution: (none) => FIXED
Status: NEW => RESOLVED

Comment 9 Alejandro Vargas 2016-07-10 13:29:13 CEST
For me the problem is not the "flash" of a message. The problem is it waits for enter to continue. In case of a power loss the system will not boot after somebody pressed a key.
Comment 10 Barry Jackson 2016-07-10 14:30:37 CEST
(In reply to Alejandro Vargas from comment #9)
> For me the problem is not the "flash" of a message. The problem is it waits
> for enter to continue. In case of a power loss the system will not boot
> after somebody pressed a key.

Please test grub2-2.02-0.git10457.9.mga6 when it appears on your mirror and see if you still have this issue.
Comment 11 Alejandro Vargas 2016-07-12 10:35:54 CEST
It worked OK. Fresh install. Added repos, urpmi grub2 for updating only grub2. Rebooted and booted without any message.
Comment 12 Barry Jackson 2016-07-12 18:28:00 CEST
(In reply to Alejandro Vargas from comment #11)
> It worked OK. Fresh install. Added repos, urpmi grub2 for updating only
> grub2. Rebooted and booted without any message.

Good - thanks for testing.

Barry
Florian Hubold 2021-03-03 14:53:46 CET

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=27117


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