GRUB error: sparse file not allowed

I installed arch only with CLI(like installing Arch) with btrfs and everything works fine. But every time I turn GRUB shows me an error which says that a sparse file is not allowed, I looked in other forums but I could only find solutions for Ubuntu which didn’t work for Manjaro. I have installed Arch-based distributions with btrfs many times and I have never had this problem. Any help would would be great.

Welcome to the forum! :slight_smile:

Did you tell GRUB to load the btrfs module when you installed it?

You should normally be able to remedy that by reinstalling GRUB… :arrow_down:

sudo grub-install --recheck --no-rs-codes --modules="btrfs part_gpt part_msdos"
sudo update-grub

If it’s a GPT partition table, then you can omit the part_msdos module, and likewise if it’s an MBR partition table, you can omit the part_gpt module.

Thanks for the welcome. But sadly this also didn’t work, maybe you have some other advice?

Yes ─ I’m sorry but I only just remembered that you may need to include zstd support when reinstalling GRUB for a btrfs-based system.

sudo grub-install --recheck --no-rs-codes --modules="btrfs zstd part_gpt part_msdos"
sudo update-grub

Also make sure that you add the btrfs and zstd module support in /etc/default/grub, for future reference.

The reason is the grub.env which is on a filesystem not writable by grub and Manjaro grub config defaults to writing the selected entry to grub.env. To work around it edit your /etc/default/grub and change from

GRUB_SAVEDEFAULT=true
GRUB_DEFAULT=saved

To

GRUB_SAVEDEFAULT=false
GRUB_DEFAULT=0

rebuild grub config

 sudo grub-mkconfig -o /boot/grub/grub.cfg

Depending on your requirements you may need to change other settings as well.

8 Likes

Thank you so much this error has been bugging me for quite a while.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.