im planning to migrate from opensuse tumbleweed to EOS on my main machine. one particular feature from suse, that i dont wanna miss, is the btrfs/snapper functionality. i know this can be done on EOS, but im struggling a bit. im testing this in a virtual machine right now.
installation of EOS (with btrfs) is not the issue, thats super easy fortunately
what i want
i am going to use the whole ssd for EOS, however i dont use /home in a traditional way. i dont really like personal files and dotfiles, python programs, etc mixed up in /home. all my personal files will be on another ssd. therefore i want to include /home in my root snapshots. as far as i understand deleting the @home subvolume (before setting up snapper) will result in root snapshots including the /home folder (since its not a seperate subvolume anymore).
i want bootable read-only snapshots taken automatically via the pacman/yay hook. i dont want snapshots taken from a time schedule, which is often included in snapper. also im a bit confused about kernels. when pacman updates the linux kernel old snapshots will not work anymore, right? since the kernel itself is not included in the snapshot. i would really like snapper (or pacman/yay hook) to backup kernels too, so i can boot into snapshots if the kernel-update goes wrong
what ive planned so far
fresh install of EOS with BTRFS (suggested layout by calamares)
deleting @home subvolume
sudo umount /home
get ID of @home → sudo btrfs subvolume list /
sudo btrfs subvolume delete -i HOMEID /
comment out /home in /etc/fstab
reboot
mkdir $USER in /home
sudo chown -R $USER /home/$USER
sudo chmod -R 755 /home/$USER
ive read/watched guides on how to do this, but theyre either outdated or contradict each other. also i dont know if i should use the aur packages snapper-support and/or btfs-assistant or if i should install them first or after setting up everything else
im sure this is not too hard, but at this point im super confused. and i really dont wanna reinstall trial-and-error several times. please help
You can do it this way if you want. However, it would be easier if before launching the installer, you edit /etc/calamares/modules/mount.conf and delete the two lines that reference home. That will stop it getting created in the first place.
If you do follow your instructions, don’t forget to mount the snapshot somewhere else and copy the files out of it. Alternatively, you could delete your user account and recreate it.
Those probably aren’t the commands you need. However, in order to help you with the right steps, I need to know if you want suse-style rollbacks.
OpenSUSE doesn’t actually restore the root. When you rollback root, it actually changes the default subvol and you just start booting off the snapshot instead(permanently). You can do this but it will require using snapper for restores at the CLI. You won’t be able to use Btrfs Assistant for example to rollback root.
Most other distros/tools restore by replacing the subvol with the snapshot and keeping the same subvol name. This is what most of our users do.
snapper-support is a package that sets everything up for you. You should either install it first or not at all.
btrfs-assistant is a GUI tool which helps you manage btrfs and Snapper. It doesn’t really matter when you install it but it can make creating the Snapper configs easier.
oh yeah, that sounds way easier! im gonna do it like this
those 2, right?
well tbh im not really sure, i guess the way most other distros do it sounds better to me. booting into a snapshot and just running “snapper rollback” is super convenient though, but the scenario that my system actually breaks shouldnt happen too often. ive read about the “arch way” of doing snapper rollback, its a little more complicated, but i dont mind. i just wanna be able to still have a functional system (snapshot), in case something goes wrong
i do like to configure on my own, so snapper-support is probably not needed then. ive read that you are the author and maintainer of btrf-assisant so i will check it out for sure
OK, I haven’t tested this precisely, but I think the instructions would be something like this:
yay -Syu snapper inotify-tools snap-pac grub-btrfs btrfs-assistant btrfsmaintenance (You don’t need the last two but they are convenient. I am going to use Btrfs Assistant in the instructions but it can all be done via the CLI as well)
In Btrfs Assistant, on the “Snapper Settings” tab:
Uncheck “Snapper timeline enabled” so you won’t get hourly snapshots
Check “Snapper cleanup enabled” to automatically delete older snapshots based on your retention rules
Click “New”, select / in the box and use the name “root” for the config
Set the settings to your preference although since we disabled the timeline timer, the only one that matters is the “Numbers” setting. This is the number of snapshots from pacman operations that will be retained. Keep in mind that it takes two snapshots for each so if you set this to 10 you will get 5 pacman operations.
After saving the changes, go to the snapper tab and take a manual snapshot to ensure that it works and for testing.
Run sudo systemctl enable --now grub-btrfsd
Run sudo grub-mkconfig -o /boot/grub/grub.cfg
Install or remove a package using yay or pacman
Reboot and see if the snapshots are in your grub menu. You should see 3 snapshots. The manual one and the two from the pacman operation.
Go back into Btrfs Assistant and delete the manual snapshot we created earlier.
As long as you choose grub as the bootloader during the install process, the kernel and initramfs will be part of the snapshot so you should not have issues with this.
i installed neofetch and was confused, that it was also present in the manual snapshot (before installation of neofetch). its preinstalled in EOS probably it worked fine with exa! but the grub-menu didnt update automatically after installing exa, is that what the grub-btrfsd service is supposed to do? systemctl status grub-btrfsd says its enabled and running
whats the difference between initramfs-linux and initramfs-linux-fallback?
i just tested restoring a snapshot with btrfs-assisant. works just as intended and is as easy as it gets. so if my system breaks i can boot into a snapshot and restore any snapshot i want like that? thats actually amazing
initramfs-linux contains the minimal information you need to boot the system. initramfs-linux-fallback contains a more generic set of included files and drivers. You would only use that one if the normal initramfs fails.
i think restoring the snapshot disabled grub-btrfsd, thats why it didnt refresh the grub-menu. i re-enabled it and played around a bit installing some packages, works perfectly!
thanks so much for your support!
if you have buymeacoffee or anything similar let me know