I’m currently using Btrfs on EndeavourOS with systemd-boot as the bootloader on my main machine. On my test machine (an old laptop), I use Manjaro KDE with Btrfs and Grub. What bothers me most is that it’s not possible to use a kernel other than the most recently installed one under Grub if you still have an older LTS kernel installed. The problem here seems to be that the settings set in /etc/default/grub are ignored:
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
For this reason (many users have multiple kernels installed at the same time), I don’t think it’s a good idea to rigorously set Btrfs as the default if a solution to this problem can’t be offered at the same time.
The “Advanced options for Manjaro Linux” entry in the menu lets you choose from the installed kernels.
No, they are not ignored.
grub remembers the last kernel you booted. However, if you hit Enter at the grub menu instead of letting it time out and choose the last-booted kernel, it will indeed boot the most recent kernel in terms of kernel version.
Apart from the fact that you appear to misunderstand how (Manjaro’s) grub works, in and of itself this has nothing to do with btrfs.
If you mean a kernel in the same series, then at least with updates in Manjaro, the older kernel is actually replaced by the latest one in that series.
This is not the way it works in Linux Mint, for example. I’d forgotten about this and upon reviving an old Mint machine, I quickly found my /boot partition becoming full as previous versions weren’t removed (also, those pesky HUGE Ubuntu-based kernels ).
I could of course be wrong, but I believe that Endeavour OS — which @Scruggs is using — as well as Garuda and Arch proper handle kernels the same way as Manjaro does, because that’s just how pacman works.
I can’t currently confirm this on my test computer. My previously booted kernel was 6.12 LTS, but after the next boot, it reverted to 6.14. Manjaro is up to date.
Yes, that’s right. I would then have to manually select kernel 6.12 every time I booted. That’s not practical for daily work. Or I would have to uninstall all kernels installed above it. That’s equally unacceptable.
EndeavourOS uses systemd-boot, which sets the default boot entry in /efi/loader/loader.conf, which works perfectly. Btrfs and Grub don’t mix…
@Aragorn No, not at all. The previously booted kernel (in this case, 6.12 LTS) is NOT saved, and regardless of whether I wait for the timeout or not, the most recently installed kernel is ALWAYS booted. And this ALWAYS happens until I uninstall everything after 6.12.
Then maybe that’s specific to Endeavour OS. Over here in Manjaro, it works just as I’ve described above. And I can vouch for that, because I’ve recently upgraded from 6.6 to 6.12, and the submenu was still selected.
The only thing one needs to be mindful of with btrfs is that if you use compression and /boot is on btrfs — in my case, it’s on ext4 — then you should not use any compression in /etc/mkinitcpio.conf. But this has nothing to do with what kernel gets booted from within grub.
This has nothing to do with EndeavourOS. I already said that it works very well there thanks to systemd-boot. This is about Manjaro and the settings for saving the last booted kernel in /etc/default/grub, which obviously CANNOT be read during boot (at least nothing that has been changed, like GRUB_SAVEDEFAULT=true). Otherwise, my last booted kernel would be restored without any problems the next time I boot. I read somewhere that the configuration file for the bootloader in Btrfs can only be read if it’s located on an ext partition. I have no idea if that’s true, but I don’t think Manjaro will make it onto my main computer this way. It’s a shame, because I’m looking for a fallback in case EndeavourOS ever disappears.
Once again you are displaying ignorance — pardon my choice of words — on account of grub.
Of course/etc/default/grub is not read at boot. After making the necessary edits to /etc/default/grub, you must execute update-grub — which is a shell script that simply executes…
grub-mkconfig -o /boot/grub/grub.cfg
… and this will then save the configuration to /boot/grub/grub.cfg. And that is the file that grub will read upon booting.
Well, it does work as advertised here on my system, so if it doesn’t on yours, then you must have done something strange to the configuration — perhaps to the scripts in /etc/grub.d.
No, but some versions of grub don’t work well with btrfs, or even with xfs — which is the reason my /boot is on ext4 — but grub-btrfs does. The versions that don’t work with btrfs or xfs cannot only not read the configuration file, but they also cannot read anything else, including the kernels.
Then that’s your choice.
Why would it disappear? It seems to be quite healthy to me. And EOS users don’t have to worry about the availability of the repos, because they are using the Arch proper repos.
That is not what I said, nor why I said it. I was simply explaining something you didn’t seem to be aware of, which is that /etc/default/grub is never read at boot time.
I’ve now taken out the laptop again and experimented a bit. Neither the setting GRUB_SAVEDEFAULT=true nor the setting #GRUB_SAVEDEFAULT=false will allow the bootloader to remember the last booted kernel. With GRUB_SAVEDEFAULT=true, an error message even appears during boot (I didn’t remember that). And the default setting after a fresh install (GRUB_SAVEDEFAULT=false) obviously has no effect either. This is a two-day-old fresh installation of Manjaro. It’s and will remain rubbish. So if a newbie installs Manjaro with Btrfs and then installs an older kernel after the installation, they’re in for a treat…
I’ve already told you that this has nothing to do with btrfs. Now please stop monopolizing this thread.
Furthermore, it is your prerogative to think Manjaro is “rubbish”, but blaming your own ignorance on Manjaro is unfair, and so is trolling, not to mention that it’s against the forum rules.
Does this do what you want? (But only half of it.)
If I’m wrong, please laugh and forgive me.
“saved” doesn’t work with BTRFS. This is by design.
The workaround is to use EXT4 for /boot etc.
However, since it’s not a simple configuration, backups will be a pain.
To change the default selected entry, edit /etc/default/grub and change the value of GRUB_DEFAULT:
Using menu titles:
GRUB_DEFAULT=‘Advanced options for Arch Linux>Arch Linux, with Linux linux’
Note: If you are using a non-English locale, the generated menu title may be different from the example above. It might be a good idea to add LANG=C above the GRUB_DEFAULT line, or set GRUB_DEFAULT according to the correct title in your locale.
Using numbers:
GRUB_DEFAULT=“1>2”
Grub identifies entries in the generated menu (i.e. /boot/grub/grub.cfg) counted from zero. That means 0 for the first entry which is the default value, 1 for the second and so on. Main and submenu entries are separated by a > and are both identified by a number, title, or ID.
The example above boots the third entry from the main menu ‘Advanced options for Arch Linux’.
Using IDs (see value after --id or $menuentry_id_option in grub.cfg if generating your grub.cfg):