BTRFS Luks Snapper Snap-Pac grub-btrfs combination --> the OpenSuse way

Hello there,
I know there are several topics already about BTRFS and possible backup solutions, but none of them really helps. Therefore I start this new one.

Starting point:
New installation of EndeavourOS Atlantis Neo KDE in VirtualBox with EFI.

Expected result:

  1. Use of BTRFS
  2. Encrypted installation
  3. Automatic snapshots of the system each time I update using pacman
  4. Ability to restore snapshots from grub

My current result:
By just following the installation process in Calamares I’m able to install EOS on BTRFS with encryption. After the installation I install snapper, snap-pac and grub-btrfs and out of the box the automatic snapshots work. Never thought it would be this easy. :partying_face: But the snapshots are not available from grub-btrfs

Steps I took to change this:

  1. Try to follow the outdated guides at https://discovery.endeavouros.com/category/encrypted-installation/ and modify them for snapper
  2. Change owner and rights for .snapshots folder
  3. Create a new subvolume for snapshots (OpenSuse uses more subvolumens than the EOS installer creates. And when reading other documentation about this, it is recommend to use a separate subvolume for snapshots) and change configuration accordingly in btrfs, snapper, snap-pac

Every step I took to make it work the way I want just made it worse (e. g. broken automatic snapshots). So please give me advice how to get this working. Maybe we can use this information to than update the discovery page for other new users like me.

Specific question:

  1. What do I need to do to get my expected result?
  2. Should I follow the suggested file system layout?

Thanks in advance

Just install off the ISO, install snapper, snap-pac and grub-btrfs and use them.

I think there are a couple of things to consider:

  • Some of the official snapper documentation assumes a highly specific configuration that opensuse uses. It doesn’t generally apply to using snapper on other distros
  • You don’t need to create or mess with .snapshots. snapper creates these subvolumes for you automatically. Creating them by hand only makes things more complicated.

I would not but it all comes down to your restore strategy. Some snapshot restore methods require certain layouts and others require the opposite.

Without more diagnostics it is hard to say what is happening but my guess would be you didn’t enable any of the options which trigger grub-mkconfig when a snapshot is created.

One easy solution is to take the path unit and service unit from snapper-support and then enable the path.

4 Likes

Thanks for your quick reply.

I think you are right about this, but I didn’t find a way to do it myself. Everybody just mentions snap-pac-grub in AUR and I try to do it without AUR as I want to stick to the official repos, which is also one of the reasons for picking snapper over timeshift.

This could be the solution without AUR. But unfortunately I’m too stupid / uneducated in Linux to follow (mostly GUI user so far). Is it possible that you describe in detail what I need to do? Couldn’t find something useful for “enable the path”

Have you enabled the the grub-btrfs.path service? afaik without it those snapshots won’t be populated to the grub menu.

3 Likes

Save those two files I linked above as /etc/systemd/system/grub-btrfs.path and /etc/systemd/system/grub-btrfs.service.

Then type

sudo systemctl enable --now grub-btrfs.path
3 Likes

Thank you very much. This did the trick.
I always failed starting the grub-btrfs service and using the configuration provided by these two files it works flawlessly.

3 Likes

I want to share the exact steps I have taken for anybody as clueless as me. These might not be perfect, but worked for me and therefore could be helpful for others.

  1. Boot Live-System
  2. Refresh mirror list and start Installer
  3. Configure localization settings
  4. Choose „delete harddisk“, pick a suitable swap configuration and the file system btrfs and if you want encryption tick the checkbox for encryption and type in a password (password should be typable on English keyboard layout!)
  5. Proceed with normal installation
  6. Reboot to new installation
  7. Refresh mirror list
  8. Install snapper, snap-pac and grub-btrfs
    sudo pacman -S snapper snap-pac grub-btrfs
  9. Configure snapper at least for root subvolume (if you like for every other subvolume you want to do manual snapshots of)
    sudo snapper -c root create-config /
  10. Get configuration for automatic update for grub
    Save path and service as /etc/systemd/system/grub-btrfs.path and /etc/systemd/system/grub-btrfs.service
  11. Enable update service for grub
    sudo systemctl enable --now grub-btrfs.path
1 Like

Well instead of all these steps you should just do

paru -S snapper-support

And reboot

As mentioned in my second post I didn’t want to use packages from AUR. I try to do everything on machine with just Arch repositories.

1 Like

I don’t think this is actually necessary. The path service should be included in the grub-btrfs package.

The above path/service units have a couple of improvements over the stock unit files.

First, they remove the harmless errors in the logs. This is not a big issue unless you are log neat freak.

More importantly, they stop the config from being updated when you are booted off a snapshot which can be problematic. Especially if you have converted the snapshot to be read/write for some reason.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.