Skip to content

grub-btrfsd not working with systemd on Debian  #272

@Schievel1

Description

@Schievel1

_Sorry to derail this PR slightly but can I just ask if @lmmarsano has got auto-updating of the GRUB menu working using systemd (under Ubuntu)? If so, how? Did the README instructions work for you?

Here's how I currently have it configured under Debian #270

Ideally the grub menu would get updated every time a snapshot is created or removed, unlike my current solution of updating GRUB at shutdown or reboot, which at least works reliably but I'd prefer the GRUB menu got updated instantly._

Originally posted by @danboid in #250 (comment)

Ok, let me clarify a few things first. The architecture of this whole grub-btrfs thing is a follows:

  • There is [41_snapshots-btrfs](https://github.com/Antynea/grub-btrfs/blob/master/41_snapshots-btrfs) which uses the output of btrfs-progs' snapshot list to create a snapshots submenu. It is either run manually or during grub-mkconf. It is completely independent from systemd, openrc and also grub-btrfsd. It depends on btrfs-progs output, though, which was kind of unstable lately
  • Then there is [grub-btrfsd](https://github.com/Antynea/grub-btrfs/blob/master/grub-btrfsd) which is a script that watches a directory for changes. (usually the directory where your snapshots are) and triggers 41_snapshots-btrfs or grub-mkconf if there is a change in that directory. (which usually means there is a new snapshot or a snapshot was deleted)
  • Neither grub-btrfsd nor 41_snapshots-btrfs are connected to systemd or openrc in any way. This is what [grub-btrfsd.service](https://github.com/Antynea/grub-btrfs/blob/master/grub-btrfsd.service) (for systemd) and [grub-btrfsd.initd/confd](https://github.com/Antynea/grub-btrfs/blob/master/grub-btrfsd.initd) are for. They tell their respective init systems how and when to run grub-btrfsd. (usually at system startup) This is the only connection, in fact a user could also run /usr/bin/grub-btrfsd at every system startup, and it would have the same effect.

So, when you posted your problem with snapshot menu creation in that other issue, it was a problem with 41_snapshots-btrfs and its dependency on btrfs-progs. Your problem with snapshots not being created automatically are with grub-btrfsd, the grub-btrfsd.service-file and with systemd. So lets figure that out here.

Let's check first if grub-btrfsd is runnig ok. If you run it as a systemd service, it usually outputs to syslog (when its started with --syslog in the .service file), so start watching the syslog witch journalctl -f, in another terminal add --verbose after syslog in your grub-btrfsd.service-file, then restart grub-btrfsd with systemctl restart grub-btrfsd and watch the output in the other terminal. This should give you a hint why grub-btrfsd is failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions