FS#63656 - [grub] unable to grub-install (2.04) on btrfs partitionless disk

Attached to Project: Arch Linux
Opened by christophe yayon (cyayon) - Wednesday, 04 September 2019, 14:23 GMT
Last edited by Evangelos Foutras (foutrelis) - Tuesday, 29 March 2022, 23:08 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Ronald van Haren (pressh)
Christian Hesse (eworm)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 5
Private No

Details

Description:

unable to grub-install (2.04) on btrfs partitionless disk

# grub-install /dev/sda
Installing for i386-pc platform.
grub-install: warning: your core.img is unusually large. It won't fit in the embedding area.
grub-install: error: filesystem `btrfs' doesn't support blocklists.

The system could be potentially unbootable !

no issue with previous grub 2.02.

If i create a /dev/sda1 partition, no problem.

Additional info:
* package version(s) : grub 2.04
* config and/or log files etc.
* link to upstream bug report, if any

Steps to reproduce:

just grub-install on a partitionless btrfs disk

This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Tuesday, 29 March 2022, 23:08 GMT
Reason for closing:  Fixed
Additional comments about closing:  grub 2:2.06-5
Comment by Alexander Schnaidt (Namarrgon) - Wednesday, 04 September 2019, 14:51 GMT
This isn't a bug and belongs on the forums at best.

https://wiki.archlinux.org/index.php/Btrfs#Partitionless_Btrfs_disk
Comment by Robin Broda (coderobe) - Wednesday, 18 March 2020, 13:01 GMT
  • Field changed: Percent Complete (100% → 0%)
This *is* a bug, that should not be happening, it is a failure assert in grub.
Comment by Christian Hesse (eworm) - Wednesday, 18 March 2020, 13:49 GMT
So no RAID levels involved?
Comment by Robin Broda (coderobe) - Wednesday, 18 March 2020, 14:13 GMT
nope
Comment by Robin Broda (coderobe) - Wednesday, 18 March 2020, 14:18 GMT
The relevant bit is
> grub-install: warning: your core.img is unusually large. It won't fit in the embedding area.

This comes from https://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/fs/btrfs.c?id=386128648606a3aa6ae7108d1c9af52258202279#n2143, and indicates that core.img grew in size beyond what is assumed to be a reasonable maximum; This should also break other non-btrfs related embeds where the embedding area is small - some targets are even smaller than btrfs' embedding area.

The i386-pc core is a heavily size restricted core in grub, per its docs, and shall not be this large.

I can also reproduce this on other distros, however, so this must be an upstream bug.
I plan to bisect grub to figure out what caused core.img to grow by a non-negligible amount, and then file an upstream bug report if nobody beats me to it. I couldn't find a detailed existing report about this specifically.
Comment by Robin Broda (coderobe) - Thursday, 11 June 2020, 22:05 GMT
Welp, this bug just hit arch infra.
I am almost convinced it would be a good idea to roll back this grub version until this is fixed upstream, this is literally broken software breaking people's actual boot *right now*.
Comment by Eli Schwartz (eschwartz) - Thursday, 11 June 2020, 22:16 GMT Comment by Christian Hesse (eworm) - Friday, 12 June 2020, 18:17 GMT
Our wiki gives the hint to create partitionless btrfs with `--alloc-start` [0]. Though man mkfs.btrfs says this option is deprecated and will be removed...

Anyway... downgrading to 2.02 and sticking with that forever is not an option.

[0] https://wiki.archlinux.org/index.php/Btrfs#Partitionless_Btrfs_disk
Comment by Robin Broda (coderobe) - Friday, 12 June 2020, 18:52 GMT
Why is that not an option? It's not like people are waiting for grub's hot new features :P

As far as i can tell, upstream is thinking about this and may or may not do something about this - until then, people upgrading are automatically left with unbootable systems.
Comment by Eric Wang (enihcam) - Monday, 15 February 2021, 01:55 GMT
https://archive.archlinux.org/packages/g/grub/ no longer provides GRUB 2.02.

SAD :(
Comment by Robin Broda (coderobe) - Monday, 15 February 2021, 02:08 GMT
https://archive.archlinux.org/packages/g/grub/grub-2%3A2.02-8-x86_64.pkg.tar.xz will automatically rewrite to the internet archive for you, even if it's not shown in the directory listing
Comment by Evangelos Foutras (foutrelis) - Monday, 28 March 2022, 09:53 GMT
grub 2:2.06-5 should work with this setup. :)
Comment by Eric Wang (enihcam) - Monday, 28 March 2022, 15:11 GMT
MBR boot is deprecated and replaced by UEFI, which does not support partitionless disk by design.

Loading...