[HOWTO] edit: obsolete workaround to a problem with grub-btrfs

EDIT:

This post was an elaborate workaround to a problem with the current state of grub-btrfs. A simpler workaround has been found with the help of members here, and thus the one I posted is obsolete. Therefore it has been deleted.

1 Like

Pardon me if I might have got it wrong (it’s been quite a while I used such a setup) but isn’t monitoring the snapshot directory and updating the grub whenever an snapshot is taken handled as indicated in the following:

I couldn’t get them to work in a virgin install, hence this howto on how to set it up from start to finish.

I might have done something wrong, though. Have you tried?

No, I just wondered since it is trying to address a similar issue as yourself but I haven’t tried it.
At the moment I am not planning any new Arch/EnOS install but when/if I do, I’ll try to make a similar setup and see if how things would work.
Thanks for the write-up!

1 Like

Understanding subvolume layout has been and is a headache for me. I’m working on an “ideal” Arch BTRFS installation with snapper, looking into how distros like Garuda (where snapper comes as default), EOS and Manjaro are doing it.

I needed a break and decided to check out Timeshift, btrfs and bootable snapshots. It should be a piece of cake, but no matter how close I followed the most official instructions I could find, it wouldn’t work as advertised.

1 Like

You definitely don’t have to do all that.

There are tons of people here using snapper and grub-btrfs together. There are instructions in multiple posts here. Especially in the btrfs assistant topic.

Garuda uses a package called snapper-support which is also in the AUR. If you want an “easy button”, that is it. It installs everything you need and configures them for you.

If you have questions, just ask, there are many people here that can help you.

2 Likes

Thanks!

I want to get as much understanding of it as I’m capable of, therefore I want to avoid “easy button” -type stuff (with regards to snapper that is, not Timeshift in this case) at this point in time, and do it manually. Then I can use those helpers more confidently in the future.

As for Timeshift, what is the simpler setup?

Follow the instructions @pebcak linked above.

OK, I’ll try them again tomorrow. I’ve already followed them several times with no success. Could have made a mistake somewhere though.

By the way, here’s a guy who had the same problem. Seems like a seasoned IT guy ( associate professor in Computer Science). His instructions did not work for me (at least not a few days ago, now he has updated them again very recently), but they had valuable info.

1 Like

Did you ever read this?

https://discovery.endeavouros.com/encrypted-installation/btrfs-with-timeshift-snapshots-on-the-grub-menu/2022/02/

Yeah! It never worked!

OK folks, my head is swimming! But I SWEAR that this has been a MAJOR GODDAMN problem over the last few days! I can’t be the only one!!! :grinning:

I’ll be darned!

1 Like

Hehe, I’ve been struggling with this for days and I’m still convinced there’s been some major problem somewhere between changes in Timeshift and grub-btrfs.

Anyhow, I can’t think straight about this so maybe someone could tell me: with the configuring of systemd above, and creation of services, is my install of grub-btrfs superfluous, and should be removed from the howto?

OK is seems not. Sorry. Time for bed. I’ll double my efforts tomorrow to see if the official wikis and instructions will somehow work, and this whole howto can be deleted.

Get some rest. The last days might have been challenging…

1 Like

Nope, no luck.

Fresh install of EndeavourOS in Virtualbox. Followed the official Endeavour wiki instructions. New snapshots are not registered in grub at boot. Then I followed the official grub-btrfs instructions on Github. New snapshots still not registered.

How come the Github procedure works for dalto, I don’t know.

I used to have it working in VBox until a few months ago. I followed that article by @joekamprad on the EnOS Discovery site (see link above).

I wonder what you’re doing wrong with your setup?

The exact steps:

Fresh install of EndeavourOS in virtualbox. Grub, no swap, btrfs, erase disk and default setup. reboot and update.

Then I go to the EndeavourOS Timeshift wiki and follow the instructions.
https://discovery.endeavouros.com/encrypted-installation/btrfs-with-timeshift-snapshots-on-the-grub-menu/2022/02/

The steps I took from the wiki:

yay -S timeshift

then I create a snapshot, and:

sudo pacman -S grub-btrfs

sudo grub-mkconfig -o /boot/grub/grub.cfg

sudo systemctl enable grub-btrfs.path

the last command gives:

[vlad@endeavouros ~]$ sudo systemctl enable grub-btrfs.path
Failed to enable unit: Unit file grub-btrfs.path does not exist.
[vlad@endeavouros ~]$

I figure perhaps the wiki is outdated, so I go to the grub-btrfs github:

GitHub

GitHub - Antynea/grub-btrfs: Include btrfs snapshots at boot options. (Grub…

Include btrfs snapshots at boot options. (Grub menu) - GitHub - Antynea/grub-btrfs: Include btrfs snapshots at boot options. (Grub menu)

Per instructions there, I take these steps:

grub-mkconfig -o /boot/grub/grub.cfg

sudo systemctl start grub-btrfsd
sudo systemctl enable grub-btrfsd

sudo systemctl edit --full grub-btrfsd

where I put:

[Unit]
Description=Regenerate grub-btrfs.cfg

[Service]
Type=simple
LogLevelMax=notice
# Set the possible paths for `grub-mkconfig`
Environment="PATH=/sbin:/bin:/usr/sbin:/usr/bin"
# Load environment variables from the configuration
EnvironmentFile=/etc/default/grub-btrfs/config
# Start the daemon, usage of it is:
# grub-btrfsd [-h, --help] [-t, --timeshift-auto] [-l, --log-file LOG_FILE] SNAPSHOTS_DIR
# SNAPSHOTS_DIR         Snapshot directory to watch, without effect when --timeshift-auto
# Optional arguments:
# -t, --timeshift-auto  Automatically detect Timeshifts snapshot directory
# -o, --timeshift-old   Activate for timeshift versions <22.06
# -l, --log-file        Specify a logfile to write to
# -v, --verbose         Let the log of the daemon be more verbose
# -s, --syslog          Write to syslog
ExecStart=/usr/bin/grub-btrfsd --syslog /.snapshots

[Install]
WantedBy=multi-user.target

sudo systemctl restart grub-btrfsd

sudo grub-mkconfig -o /boot/grub/grub.cfg

Now I start testing. New snapshots are not registered by grub.

I don’t think that article has been updated since the recent changes in both timeshift and grub-btrfs.

to activate this mode of the daemon, --timeshift-auto must be passed to the daemon as a command line argument

The line that says

ExecStart=/usr/bin/grub-btrfsd /.snapshots --syslog

should be edited into

ExecStart=/usr/bin/grub-btrfsd --syslog –timeshift-auto

https://github.com/Antynea/grub-btrfs#-timeshift--version-2206