Btrfs and snapper on EOS vs. Snapper wiki recommendations

I’m trying to get a better understanding of how snapper on EOS works vs. snapper on Arch per the wiki install.

On a NUC PC I installed EOS with Plasma, BTRFS, snapper, snap-pac, grub-btrfs, and btrfs-assistant.

Once the software is installed, I use btrfs-assistant to configure snapper with configs for root and home. This seems to always work and because grub-btrfs and snap-pac are installed. I get lots of snapshots pre/post for updates and installs. I know this works because I can boot to a snapshot that is pre and the application is not there. I can boot normally and it is there. I can then use btrfs-assistant to restore to that same pre snapshot and it works just fine without the applications that was eliminated on the restore.

But unlike on Archlinux using the snapper wiki I have no @snapshots subvolume or even @.snapshots subvolume. There is not even a /.snapshots directory.

However, on the Arch install I did the snapper -c root create-config / in console and from that point on btrfs-assistant works just as it does in EOS.

EOS doesn’t have any snapshots subvolumes that are top level 5, but the arch install does. Not sure what that causes or prevents.

Normally with EOS and btrfs-assistant, I don’t have to worry, but I’d like to understand snapper better and the Arch wiki on that is about the only source for info.

I have written explanations on this quite a few times. If you search for @snapper and my username you should be able to find them.

The short answer is, if you want to use Btrfs Assistant or any of the tools that use a similar approach to restoring subvolumes, you should not create an @snapper subvolume.

Snapper itself creates a nested subvolume at /.snapshots. It is better to just use that.

There has to be. Snapper doesn’t work without it. Perhaps you are not showing hidden files?

You’re right /.snapshots is there on the EOS install.

I’ll search for the previous posts. So can btrfs-assistant work correctly on Archlinux/snapper as it does on EOS/snapper? I know the structure of the subvolumes is different but is this a case of one is right and one is wrong?

Btrfs Assistant doesn’t know or care which distro you use.

Arch doesn’t have a predefined subvolume layout like EOS so I suppose it depends on how you chose to layout the subvolumes.

That being said, Btrfs Assistant works with more or less any subvolume layout. It is just a question of how hard you are making it on yourself if you need to restore.

I have written at length in other posts about why you might choose each option.

Thanks for being patient with me on this. First I could not find with search on the forum the articles you posted using @snapper and dalto.

However, I have proven to myself that I get the same functionality in bttrfs-assistant whether I use btrfs-assistant on Arch installed by archinstall or EOS.

I can on either distro install an app, then user btrfs-assistant and restore to the pre snapshot for that app and on reboot the app in gone.

I’m trying to make sense of how that restore is done. On EOS I see that the @ and @home seem to stay at top level 5 but the ID changes to the snapshot that was used in the restore. However, I could be wrong. The longer the system runs the more snapshots get taken and the more confusing it look.

Maybe you could directly point me to the most relevant post you did on this subject that could be most helpful. I seem to be failing with search.

This topic has all the explanations although they are spread between a few posts.

Thanks for the pointer. As I read it I see that while I didn’t understand all of the thread comments, I did post what my solution was to get it right. my default method, I still follow this method on EOS KDE and it works. I’m just trying to understand it to the point that I know why I’m doing this instead of what archinstall sets you up for.

I’ll keep reading and playing. I’ll figure this out at some point. Thanks again.

I built some VMs to test out snapper and btrfs-assistant.

  1. EOS plasma kde
  2. archlinux arch way install following snapper subvol layout
  3. archinstall standard btrfs
  4. archinstall stardard btrfs but removing @.snapshot subvol and /.snapshot directory, and mount from fstab

In each case I install snapper snap-pac grub-btrfs btrfs-assistant the same way, except for #2 and #3. There I followed the snapper wiki and unmounted and removed /.snapshot.

I also removed the subvolid= from fstab for all arch installs and only use subvol=.

I used btrfs-assistant to setup the configs for root and home in all cases.

My test was to install the game aisleriot then use btrfs-assistant to restore to the pre snapshot taken before aisleriot was installed. Below is the output of btrfs su list / after that.

ID 256 gen 69 top level 5 path @_backup_20230812092527027
ID 257 gen 69 top level 5 path @home_backup_20230812092537868
ID 258 gen 73 top level 5 path @log
ID 259 gen 60 top level 5 path @pkg
ID 261 gen 10 top level 271 path var/lib/portables
ID 262 gen 10 top level 271 path var/lib/machines
ID 263 gen 64 top level 271 path .snapshots
ID 264 gen 64 top level 272 path @home/.snapshots
ID 265 gen 46 top level 263 path .snapshots/1/snapshot
ID 266 gen 47 top level 264 path @home/.snapshots/1/snapshot
ID 267 gen 65 top level 263 path .snapshots/2/snapshot
ID 268 gen 66 top level 264 path @home/.snapshots/2/snapshot
ID 269 gen 61 top level 263 path .snapshots/3/snapshot
ID 270 gen 63 top level 264 path @home/.snapshots/3/snapshot
ID 271 gen 73 top level 5 path @
ID 272 gen 73 top level 5 path @home

The original subvol ID for @ was 256 and @home was 257. They are now saved as backups.
The new @ is now subvol 271 and @home is 272.

This is consistent behavior in all my test cases.

Test case #4 duplicates the way EOS works to me. The snapshots are all in the hidden directory /.snapshots and there is no mounting of a @snapshots subvol at /.snapshots in the /etc/fstab.

Cases #2 and #3 both have the @snapshots or @.snapshots mounted via the fstab, but using btrfs-assistant makes the behavior the same as on EOS.

So what I get out of this testing is regardless of Archlinux the Arch way, archinstall, or EOS, if you use btrfs-assistant to manage snapshot restores the behavior is the same.

If my assumptions are correct, then I’m done because btrfs-assistant solves all of my problems and snapper from the console CLI can be confusing and generates results that I can’t recover from.

When I’m in a bind, I can boot a snapshot and once I determine that is the one to restore to I can run btrfs-assistant from that booted snapshot and do the restore of @ and @home to that snapshot number and then reboot. It always works for me.

Comments?

I’ve tagged this as solved. I think it is at least for me. I take this lack of additional comments as “proof”

I didn’t comment further because I wasn’t clear that there were additional questions I hadn’t already answered.

As it relates to using flat subvolume like @snapper for /.snapshots:

  • Will it work with Btrfs Assistant? - Yes
  • Does it add any value when used with Btrfs Assistant? - No
  • Will it make recovery more difficult in certain situations? - Yes
  • Is it a good idea to use that when using Btrfs Assistant(or TImeshift) - No

The question you should be asking isn’t “Is it possible to use it this way?”. It is “What advantages does this bring me?”. Given how you are using btrfs, I think you will find that it brings you no advantages but does add potential difficulties in the future.

1 Like

Thanks you for this additional clarification. btrfs is difficult enough without adding any complication, so I don’t want to do that. In trying to understand snapshots, I’ve tired roll my own with shell scripts and that is a great way to screw things up. I’ve tried snapper from the CLI and that is complicated by whose guide you use; Suse, Arch, or somebody’s U-tube video.

My decision comes down to:
For rolling releases use Endeavour OS.
If you absolutely have to use Arch. Make the subvol structure exactly like EOS.
In cases where I have to use Debian, I use timeshift since those systems tend to be simpler non-development systems where rolling back is rarely needed.

For EOS, it simply comes down to after install with btrfs, just install:
yay -S snapper snap-pac grub-btrfs btrfs-assistant btrfsmaintenance
Then create you configs with btrfs-assistant. Since I snapshot home, I enable home in snap-pac.ini.
Nothing else.

You don’t have to use the exact same structure. Just don’t use an @snapper or @.snapper or similar.

If you want to use Arch Install, you can just delete that subvolume, remove it from fstab and rmdir ./snapshots before installing snapper.

2 Likes

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