You are not logged in.

#1 2026-03-25 07:01:15

Santo C01
Member
Registered: 2026-03-02
Posts: 10

GRUB boots linux-lts by default + “sparse file not allowed”

Hi everyone,

I’m trying to understand and properly configure GRUB behavior on my Arch system, and I ran into two related issues.

#System setup

* Arch Linux (recent install)
* Btrfs root filesystem
* `/boot` is inside the Btrfs root (not a separate partition)
* EFI partition mounted at `/efi`
* Using GRUB (UEFI)

# Situation

I installed both:

* `linux`
* `linux-lts`

After installing `linux-lts`, GRUB started booting into LTS by default because it appears first in the menu.

---

# What I tried

#### 1. Using saved default:

```bash
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
```

* Rebuilt config (`grub-mkconfig`)
* Manually selected the regular kernel once

>Result:

* GRUB still defaulted to LTS
* AND I got this error during boot:

```
error: commands/loadenv.c:check_blocklists:289:sparse file not allowed
Loading Linux linux...
Loading initial ramdisk...
```

System still boots fine, but the error appears.

---

# 2. Reverting to default behavior:

```bash
GRUB_DEFAULT=0
```

> Result:

* Error disappears completely
* But GRUB still boots into `linux-lts` since it's the first entry

---

# Questions

1. Why does using `GRUB_DEFAULT=saved` trigger the “sparse file not allowed” error in my setup?
2. Is this related to Btrfs + `/boot` being inside the root filesystem?
3. What is the recommended way to:

   * keep `linux` as default
   * avoid GRUB errors
   * while still having `linux-lts` as fallback?

Would using:

```bash
GRUB_TOP_LEVEL="/boot/vmlinuz-linux"
```

be the correct approach here, or is there a better / more “Arch-native” solution?

---

#Notes

* System is stable, no crashes
* `journalctl -p 2 -b` shows no errors
* `btrfs device stats` clean
* This seems purely GRUB-related

---

Any insight would be greatly appreciated — I’m trying to understand the correct way to handle multiple kernels cleanly.

Thanks!

Offline

#2 2026-03-25 07:02:12

Santo C01
Member
Registered: 2026-03-02
Posts: 10

Re: GRUB boots linux-lts by default + “sparse file not allowed”

Update ===> Arch System 34 days old for reference.

Offline

#3 2026-03-25 08:03:09

frostschutz
Member
Registered: 2013-11-15
Posts: 1,639

Re: GRUB boots linux-lts by default + “sparse file not allowed”

Sparse file means a file that is not fully allocated (either it has holes or is empty altogether). Basically the result when you use something like `truncate -s 1G somefile`. It's a 1G large file but nothing written to it, so not allocated / empty / hole, sparse.

Basically Grub writes into a filesystem file there. However grub does not actually have write support for filesystems. That means it can't create new files, can't allocate space for files, etc. and for checksumming filesystems, it can't update checksums. All filesystem support in Grub is read-only.

So when Grub writes to save a default, or other environment variable, it overwrites sectors in a prepared, preallocated file, without updating any filesystem metadata. So the file is modified but when you boot, the file still has all the old timestamps etc.

With Btrfs checksums, copy-on-write, snapshots, relocation, compression, etc. this is a problem, similar to Btrfs Swapfile issue: https://btrfs.readthedocs.io/en/latest/Swapfile.html

Maybe that helps, otherwise you just can't use this feature, with btrfs.

If it's just about the boot order: that should be possible to fix w/o involving savedefault at all. That's a problem with how the grub config is generated.

Last edited by frostschutz (2026-03-25 08:07:54)

Online

#4 2026-03-25 08:22:33

Santo C01
Member
Registered: 2026-03-02
Posts: 10

Re: GRUB boots linux-lts by default + “sparse file not allowed”

Since my /boot is on Btrfs, I should avoid GRUB_DEFAULT=saved and instead use:

GRUB_DEFAULT=0
GRUB_TOP_LEVEL="/boot/vmlinuz-linux"

to keep the regular linux kernel as default and avoid the “sparse file not allowed” error — correct?

Offline

#5 2026-03-25 09:07:57

frostschutz
Member
Registered: 2013-11-15
Posts: 1,639

Re: GRUB boots linux-lts by default + “sparse file not allowed”

If that works for you - yeah sure. smile

Online

#6 2026-03-25 12:56:20

Santo C01
Member
Registered: 2026-03-02
Posts: 10

Re: GRUB boots linux-lts by default + “sparse file not allowed”

It worked , clean boot, Grub automatically Loaded the right kernel and now they show in the correct order !

Santo C01 wrote:

Since my /boot is on Btrfs, I should avoid GRUB_DEFAULT=saved and instead use:

GRUB_DEFAULT=0
GRUB_TOP_LEVEL="/boot/vmlinuz-linux"

to keep the regular linux kernel as default and avoid the “sparse file not allowed” error — correct?

Last edited by Santo C01 (2026-03-25 12:57:09)

Offline

Board footer

Powered by FluxBB