grub error: sparse file is not allowed - sp2004c/wiki-and-QA GitHub Wiki

On a NRR btrfs install, one runs into:

grub error: sparse file is not allowed - press any key to continue

good news: even without keypress, booting will resume bad news: this cannot be fixed easily - the "save last entry as default" is not working on btrfs hence.


links:

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/736743

http://lists.gnu.org/archive/html/grub-devel/2011-02/msg00011.html

https://btrfs.wiki.kernel.org/index.php/Compression

https://www.spinics.net/lists/linux-btrfs/msg43831.html


what's not gonna help - seemingly SUPPRESSING compression is impossible:

grub2 : "sparse file is not allowed"

ls -lash ## if a file has 2 diff. sizes ---> sparse

# 4,0K -rw-r--r-- 1 root root 1,0K 7. Okt 19:17 grubenv # sparse :-(

sudo grub-editenv grubenv2 create # make a possibly sparse file

mv grubenv grubS.env

cp --sparse=never grubenv2 grubenv # un-sparse the file

btrfs property set /boot/grub/grubenv compression ""

btrfs property get /boot/grub/grubenv compression

#btrfs property set <file> compression <zlib|lzo>

#compress never -- if the NOCOMPRESS flag is set per-file/-directory :

chattr -c -V /boot/grub/grubenv # -R recursevly

lsattr /boot/grub/grubenv

#chattr 1.43.6 (29-Aug-2017)

#Flags of /boot/grub/grubenv set as -------------------

⚠️ **GitHub.com Fallback** ⚠️