Converting ext4 root to btrfs brings up grub error "sparse file not allowed"

For example you

  • use 1 efi-partition
  • install ubuntu (extra partition, and ubuntu-version of grub to efi-partition)
  • install XXXXX (extra partition, and XXXXX-version of grub to efi-partition)
  • install manjaro (extra partiton, and manjaro-version of grub to efi-partition)

Evrey install will overwrite the previous “grub”.efi with its inserted path to the grub.cfg of this install.

At last manjaro will install its grub. This grub will point to the grub directory in the manjaro partition, where the modules for this grub reside, and where the grub.cfg of manjaro is.

These will be used. (Until you reinstall grub from elsewhere)

:warning:
But there are /boot/grub directories in every partition. When running ubuntu you will see the /boot/grub/grub.cfg of ubuntu (which is not the one, “grub”.efi will use at boottime) :rofl:

This is why manjaros grub should be the last one

1 Like

What could fail specifically? I’d like to test that in a VM. You mentioned reinstall-grub, anything else that could break?

But how is that different to having the entire /boot directory on a dedicated ext4 partition?

God, have mercy (no not you :-P), Who would do that? Each installation have a efi partition, there is no limit of the number by specification. Ok some will do that if they have no idea what they are doing. right.

I would not suggest this any more because of its problems with rollback.

  • There is no rollback of kernel-updates in this case
  • After a system-rollback there may be a missfit between
    • /boot/“kernelimage” (outside the rollback)
    • /boot/“initramdisk” (outside the rollback)
      and
    • /lib/modules/* (in the rollback)
      which may lead to problems on sleep/resume/hybernate.

These things have been good advice at some point in time. But you have to adapt, to benefit from efi, gpt, btrfs, timeshift, compression, Cow … (Then the good advice needs to change)

2 Likes

Just to add my 2 cents.

If /boot is moved to it’s own dedicated ext4 partition (this used to be common) it is no longer on a btrfs partition. The /boot that you see under / is only a mount point, effectively, and because any rollback of Grub requires Grub to reside on a btrfs filesystem, that is no longer possible.

I hope I explained that well enough; it was rather hurried. Cheers.

Ah, that workaround isn’t recommended anymore. Maybe unlock the thread I linked to (²) in my first post and write that in there as it comes up when googling the issue!

Let’s say I go with disabling Grub’s save option. What layout would you suggest for a dual boot Manjaro KDE and Gnome setup?
My current layout from which I want to convert to btrfs is this:

Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 616447 614400 300M EFI System
/dev/nvme0n1p2 616448 524902399 524285952 250G Linux filesystem
/dev/nvme0n1p3 524902400 1049186303 524283904 250G Linux filesystem
/dev/nvme0n1p4 1049186304 15628052479 14578866176 6,8T Linux filesystem

p2 is ext4/Manjaro KDE and p3 is ext4/Manjaro Gnome with p4 being a shared ext4 /home partition.

The reason why I’m asking is because @megavolt suggested to create an EFI partition per install and @andreas85 wrote about having a single EFI partition for all installs.

What are the benefits of each approach?

Simply : Separation VS All-In-One.

My approach: if one installation or efi partition breaks, you can still boot the other. Both installation don’t interfere with each other with their bootloader.

1 Like

Putting /boot/grub on ext4 while the kernels are still on btrfs wouldn’t work either, because GRUB still needs to load the kernel into RAM, and the normal version of GRUB cannot read btrfs.

Given that your system was initially installed on ext4, you have the normal version of GRUB installed. If you had opted for btrfs upon installation time, then you would have had the btrfs-capable version of GRUB instead.

sudo pacman -S grub-btrfs && sudo grub-install && sudo update-grub
1 Like

just about btrfs

2 Likes

Good to know! I didn’t install the package manually but it’s installed in that VM and listed as specifically installed, so I have no idea how it got there.

Great read, thanks for sharing! Do you think btrfs snapshots are not in a good shape at the moment because of non-standard tooling around it?