Repository navigation
|
Hi all, I've been trying to get grub-btrfs working on my Kubuntu 26.04 installation, but running into an issue when it attempts to update Grub on automatic snapshot detection. Installed gawk and inotify. Unfortunately none of the snapshots appears in Grub, but if I run 'update-grub' manually the boot menu is populated correctly. As I understand in Ubuntu, update-grub is just a script which runs the following:- Since a default installation didn't appear to work for my distribution I gave the grub-btrfs documentation a closer look. The section under 'Customization' suggests that different distributions update Grub in different ways and some host Grub in different folders. The advice is to update the GRUB_BTRFS_MKCONFIG variable under /etc/default/grub-btrfs/config with the command specific to your distribution. So I edited the variable (restarting grub-btrfs between each attempt) with the following:- I think that was all the variations I attempted. None of which helped. Checking JournalD log and grepping for 'grub' I see the following error message when I manually take a snapshot:- This doesn't provide much info, so again checked the documentation and seen I can create a logfile and add verbose output. So edited the grub-btrfs unit configuration with:- Restarted, ran a manual snapshot then viewed the output of the logfile:- Again, not much to go off. So I'm a bit stuck. Am I doing something incorrect? Any help or pointers would be much appreciated. |
Replies: 2 comments
|
Hi @fwilliamsgithub, I had the same issue trying to install on debian. My suspicion is that it relates to PR #428. What worked for me was removing this section from the config and then re-running make install: I think the issue is that the if statement doesn't work because the config file isn't actually run it just uses the variables defined, but I'm not 100% sure on that |
|
Sorry for the late reply. Thanks very much, this worked. Chucked the issue at Claude as well, gave the following response:- To recap what was actually wrong (two separate bugs stacked on top of each other): GRUB_BTRFS_MKCONFIG in /etc/default/grub-btrfs/config had been set to "grub-mkconfig -o /boot/grub/grub.cfg" instead of just "grub-mkconfig", which caused a duplicated -o flag whenever the daemon ran a full regen. The bigger one: the config file's Fedora-detection block (if [ -f /etc/fedora-release ]; then ... fi) is only meant to apply on Fedora, but systemd's EnvironmentFile= parser doesn't understand if/fi — it just reads every KEY=VALUE line regardless of context — so it was unconditionally setting GRUB_BTRFS_GRUB_DIRNAME="/boot/grub2" even on your Kubuntu box, where that directory doesn't exist. That's what was actually breaking grub.cfg regeneration. |

Sorry for the late reply. Thanks very much, this worked. Chucked the issue at Claude as well, gave the following response:-
To recap what was actually wrong (two separate bugs stacked on top of each other):
GRUB_BTRFS_MKCONFIG in /etc/default/grub-btrfs/config had been set to "grub-mkconfig -o /boot/grub/grub.cfg" instead of just "grub-mkconfig", which caused a duplicated -o flag whenever the daemon ran a full regen.
The bigger one: the config file's Fedora-detection block (if [ -f /etc/fedora-release ]; then ... fi) is only meant to apply on Fedora, but systemd's EnvironmentFile= parser doesn't understand if/fi — it just reads every KEY=VALUE line regardless of context — so it was uncond…