# Error: sparse file not allowed. - press any key to continue booting

**URL:** <https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409>\
**Category:** Kernel, boot, graphics & hardware\
**Created:** [May 14, 2021, 12:27am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409 "2021-05-14T00:27:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon92247698](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anon92247698](https://forum.endeavouros.com/u/anon92247698)\
**Post date:** [May 14, 2021, 12:27am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/1 "2021-05-14T00:27:11Z")

</div>

Possibly the wrong category: I changed my /root partition to btrfs and changed `/etc/deafult/grub` as follows to select the last used kernel at boot:

`GRUB_DEFAULT=saved`  
`GRUB_SAVEDEFAULT=true`

This worked fine with ext4, but with btrfs it gives the error message at boot time:

`error: sparse file not allowed. - press any key to continue booting`

I found out that under btrfs it is not possible to write to _grub.env_. Resetting the values to default helps, but I have to manually select my kernel every time I boot.

I followed the following tip on the net to reinstall GRUB, but that didn’t help either:

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

```

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [May 14, 2021, 1:02am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/2 "2021-05-14T01:02:06Z")

</div>

Edit: Try this

```auto
GRUB_SAVEDEFAULT=false
GRUB_DEFAULT=0

```

---

<div class="post-metadata">

**Author:** ![anon92247698](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anon92247698](https://forum.endeavouros.com/u/anon92247698)\
**Post date:** [May 14, 2021, 1:29am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/3 "2021-05-14T01:29:36Z")

</div>

So let me get this straight: with  
GRUB\_SAVEDEFAULT=false  
GRUB\_DEFAULT=0

I only achieve that there is no error message, but still the last selected kernel is not booted. How also, if that is avoided with it. I have the last LTS kernel as fallback 8at 1st and 2nd place in the grubloader, at 3rd place the CURRENT kernel to be booted. If I  
GRUB\_DEFAULT=2, the error message comes again. Sh. btrfs …

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [May 14, 2021, 1:34am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/4 "2021-05-14T01:34:14Z")

</div>

The best guy to ask is @2000 i think. I really know little about Btrfs setup. I found that on the Manjaro forum.

---

<div class="post-metadata">

**Author:** ![anon92247698](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anon92247698](https://forum.endeavouros.com/u/anon92247698)\
**Post date:** [May 14, 2021, 1:35am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/5 "2021-05-14T01:35:11Z")

</div>

I found it there too … 😉

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [May 14, 2021, 1:35am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/6 "2021-05-14T01:35:37Z")

</div>

Well it did say the error message was gone. 😆

---

<div class="post-metadata">

**Author:** ![dalto](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/dalto/32/5577_2.png) [@dalto](https://forum.endeavouros.com/u/dalto)\
**Post date:** [May 14, 2021, 1:54am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/7 "2021-05-14T01:54:50Z")

</div>

You could always not use grub… 😉

---

<div class="post-metadata">

**Author:** ![anon92247698](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anon92247698](https://forum.endeavouros.com/u/anon92247698)\
**Post date:** [May 14, 2021, 1:57am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/8 "2021-05-14T01:57:31Z")

</div>

> [@dalto](#):
>
> You could always not use grub

Well you’re funny, what else should I take?

---

<div class="post-metadata">

**Author:** ![anon92247698](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anon92247698](https://forum.endeavouros.com/u/anon92247698)\
**Post date:** [May 14, 2021, 2:08am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/9 "2021-05-14T02:08:47Z")

</div>

I found this:

_The reason is the grub.env which is on a filesystem not writable by grub and 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_

OK, I’ve been there, so there’s no point in changing the grub.config. But how can I achieve that the kernel I preset boots?

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [May 14, 2021, 2:24am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/10 "2021-05-14T02:24:48Z")

</div>

The first boot entry is 0 so if you want the other one then it is 1

_GRUB\_DEFAULT=1_

Edit: I assume the next one would be 2 and so on

---

<div class="post-metadata">

**Author:** ![dalto](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/dalto/32/5577_2.png) [@dalto](https://forum.endeavouros.com/u/dalto)\
**Post date:** [May 14, 2021, 2:29am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/11 "2021-05-14T02:29:02Z")

</div>

> [@anon92247698](#):
>
> what else should I take?

grub isn’t the only bootloader. 🙂

I remove it from all my installs.

---

<div class="post-metadata">

**Author:** ![anon92247698](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anon92247698](https://forum.endeavouros.com/u/anon92247698)\
**Post date:** [May 14, 2021, 2:29am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/12 "2021-05-14T02:29:06Z")

</div>

As soon as I write something other than 0 on GRUB\_DEFAULT, I get the error message back. I’ve been searching the net for a solution for several hours now. Or I kick btrfs in the a… and take ext4 again.Too bad, I wanted it for the snapshots …

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [May 14, 2021, 2:30am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/13 "2021-05-14T02:30:21Z")

</div>

I have btrfs set up on mine but it was done with the wiki using quick copy and paste method.

Edit: I only have the current kernel and it is luks encryption with snapshots & timeshift.

---

<div class="post-metadata">

**Author:** ![anon92247698](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anon92247698](https://forum.endeavouros.com/u/anon92247698)\
**Post date:** [May 14, 2021, 2:40am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/14 "2021-05-14T02:40:40Z")

</div>

I probably already did everything wrong during the setup. I should have created subvolumes, but my swap partition is still ext4. I’ll go to sleep now and think about it tomorrow, if the whole effort is worth it.

---

<div class="post-metadata">

**Author:** ![freebird54](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/freebird54/32/83106_2.png) [@freebird54](https://forum.endeavouros.com/u/freebird54)\
**Post date:** [May 14, 2021, 4:55am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/15 "2021-05-14T04:55:59Z")

</div>

Well - immediately systemd boot and rEFInd come to mind (rEFInd for me). However, if you use grub to select between Timeshift snapshots, you might want to keep it. Of course, you can use rEFInd to boot the grub - but I’m not sure it gets around the difficulty you are having.

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [May 14, 2021, 8:12am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/16 "2021-05-14T08:12:08Z")

</div>

> [@anon92247698](#):
>
> but my swap partition is still ext4.

I think swap partition cannot be ext4…

---

<div class="post-metadata">

**Author:** ![manuel](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/manuel/32/396_2.png) [@manuel](https://forum.endeavouros.com/u/manuel)\
**Post date:** [May 14, 2021, 8:59am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/17 "2021-05-14T08:59:51Z")

</div>

Tried this in a VM with a btrfs disk:

- changed `GRUB_DEFAULT=2` in `/etc/default/grub`
- `sudo grub-mkconfig -o /boot/grub/grub.cfg`

And now it boots to linux instead of linux-lts. So here it works.

---

<div class="post-metadata">

**Author:** ![jonathon](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/jonathon/32/18722_2.png) [@jonathon](https://forum.endeavouros.com/u/jonathon)\
**Post date:** [May 14, 2021, 10:21am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/18 "2021-05-14T10:21:00Z")

</div>

> [@anon92247698](#):
>
> Or I kick btrfs in the a… and take ext4 again.Too bad, I wanted it for the snapshots …

You could always shrink the btrfs partition and add an ext4 boot partition.

---

<div class="post-metadata">

**Author:** ![anon95074228](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@anon95074228](https://forum.endeavouros.com/u/anon95074228)\
**Post date:** [May 14, 2021, 10:22am UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/19 "2021-05-14T10:22:32Z")

</div>

The reason for the message originates in the fact that grub cannot write to grub environment file (`/boot/grub/grubenv`) - I am not using grub - so I may remember the name incorrect - but grub writes the last used entry to the environment file and because grub cannot write on btrfs you get this grub message.

Only way around it is to have your /boot mounted on a ext filesystem **or** disable the save function.

---

<div class="post-metadata">

**Author:** ![anon92247698](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anon92247698](https://forum.endeavouros.com/u/anon92247698)\
**Post date:** [May 14, 2021, 1:16pm UTC](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409/20 "2021-05-14T13:16:59Z")

</div>

> [@anon95074228](#):
>
> Only way around it is to have your /boot mounted on a ext filesystem

Wait, I have a boot partition in fat32 (boot-efi). Is THAT the reason? I just replace it with ext4?

[Next page](https://forum.endeavouros.com/t/error-sparse-file-not-allowed-press-any-key-to-continue-booting/14409.md?page=2)
