Btrfs and snapshots

Hi,
I’m very very new, I just installed Bluefin. I come from Fedora KDE. I’m no developer, I’m not afraid of the terminal, but I’m a real beginner there.
I don’t completely understand the underlying mechanisms of an atomic desktop, but I’ll keep reading and learning.
I used btrfs assistent/snapper to have snapshots from my system. I guess that’s not useful on this kind of system. How do I manage snapshots, or do I have to maintain them, can I see somewhere that they are being made?

1 Like

There are parts of Bluefin that are designed to be writeable: /var and /etc. It can make sense to take snapshots of these directories. Note that your home directory is at /var/home/jonasan and not /home/jonasan.

Thank you.
If i search for btrfs, snapper or snapshot, there are no results in flatpak.

Flatpak are meant for GUI applications…not CLI applications…

Yes, I know. I used Btrfs Assistent on Fedora KDE, which is a GUI application.

but it need to have root access to the system, so you should install that app though rpm-ostree install

1 Like

You don’t need this app there’s no need to layer it. Your initial thoughts were correct, it doesn’t make sense to snapshot reproducible data.

You can just back up your home directory and call it. If you’re making a ton of changes in /etc/ then it might be worth backing that up, but usually there’s no need to touch anything in there post-installation.

4 Likes

I use it to back up /var and /var/home.

I do this when I am making changes to my ‘production’ containers.

Take a snap shot, experiment, if it doesn’t work do a rollback.

This seems to work very well for me unless I’m missing something important (could be, I didn’t do a big ‘study’ on the inner workings of snapper and BTRFS, but I have broken my containers (ComfyUI, adding new nodes that install conflicting python or system packages) many times, and a quick ‘restore’ and reboot works perfectly so far.

Much better than doing a backup (which I do, but for other reasons than experiementing with containers) and then a retore … snapshots take no time at all (the reboot is the only time consuming part) to take or restore … backups can be a real time waster to use to do something like this.

2 Likes

Did you find a way to make the automatic btrfs snapshots that you wanted?

Backing up my home directory is fine and everything, but I would also quite like to have hourly btrfs snapshots or similar. On other distros I’ve used snapper for this. I’m sure it could be layered in, but I’m wondering if you found a better solution…?

I use Pika Back-up. You can set that to make a backup hourly, I believe.

The snapshot feature of btrfs is a major advantage, costing almost nothing extra. So why isn’t it supported? (By directly including btrfs-assistant in the image)
I struggled a lot in distrobox, spending ages just to get btrfs-assistant to work, and even then it was really clunky.

Also, even for backing up the home directory, btrfs snapshots are much more efficient than tools like Déjà Dup or Pika Backup.

1 Like

One of the problems with snapshots is they are on the same drive that you are making the snapshot of. If the drive fails, or is accidentally formatted, etc., then all is lost.

Hello,

I would love a way to easily enable btrfs snapshots not as backup, but more as an escape hatch in the event of a big mistake. For example, I messed my whole ostree by forcing a shutdown while my system was updating in the background and now I wish I had an automated btrfs snapshot to rollback to.

1 Like

The primary purpose of snapshots isn’t backups but to guard against e.g. accidental file deletions and corruptions. For example let’s say you accidentally save an empty document over an important document and lose a bunch of work – snapshots will save you from this.

That being said, btrfs send and btrfs receive allow you to back snapshots up to external media. Personally I use the script snap-sync to back btrfs snapshots (created with snapper) to an external HDD. One advantage of this is that said external HDD is also formatted using btrfs, so (1) the backups are incremental, and (2) the backups are deduplicated so it can hold a long history of older backups instead of just the latest one.

1 Like

Snapshots are a powerful tool. I use them all the time, they are my preferred method of backing up as well since the other tools can have inconsistent backups. If a snapshot is taken and sent to external media or a backup server, then your backup contains all files at that point in time.

btrbk is my CLI app of choice for this.