Am I the only one using Btrfs snapshots like this?
from dario@feddit.it to linux@lemmy.ml on 23 Aug 2024 22:19
https://feddit.it/post/10339125

I use Btrfs with Parabola GNU/Linux-libre, a derivative distribution of Arch Linux. I use no snapshot management tools such as Snapper or Timeshift. I keep my system minimal and tidy. Everything is boring and predictable. I do not bork my system by mistake, except when something breaks after an odd update, usually once or twice per year. When it happens, I find a workaround (usually something needs to be downgraded) and file a bug report if there is none.

When I need to tinker with something that can possibly go out of control, like installing a new package for a program that I want to try out and I am not sure I will want to keep it, I take a snapshot of my current “pristine” system and boot into it. In the snapshot copy of my system I do all the dirty stuff I want to try out. When I am satisfied with my findings, I reboot into the main subvolume and delete the snapshot.

It seems to me that most people use Btrfs snapshots preemptively in case of unexpected failure. I use snapshots exactly when I know I am going to do something that can lead to instability or «OS rot». Am I the only one using Btrfs snapshots like this?

#linux

threaded - newest

savvywolf@pawb.social on 23 Aug 2024 22:29 next collapse

I’ve done that before when debugging system issues. Create a snapshot before and after the issue, and diff the files to see what changed.

I also took a snapshot before updating to a new version of Mint, realised it broke a bunch of stuff and rolled back.

Honestly, I wish btrfs was the default in many places since taking a snapshot is so cheap and easy.

[deleted] on 23 Aug 2024 22:31 next collapse

.

henfredemars@infosec.pub on 23 Aug 2024 22:35 next collapse

You’re not alone. I do use snapshots for failure protection but I also use it when I know I’m likely to induce a failure by running an experiment.

It’s also just as valid to not use the snapshot feature at all. Perhaps you value data integrity, for example, through the use of full checksums enabled by the design.

Your system and the software it runs belongs to you and is in your service.

[deleted] on 23 Aug 2024 22:51 next collapse

.

dario@feddit.it on 24 Aug 2024 10:31 collapse

systemd-nspawn is interesting. I never managed to try it out.

lurch@sh.itjust.works on 23 Aug 2024 23:19 next collapse

I’m not using btrfs on my main workstation, but I make a fresh backup whenever my distro prompts me to update. I haven’t needed a backup in years though, because I’m experienced in doing even experimental things the way they should be done (like not using sudo in reflex for any permission error or using /usr/local/ or .local/ instead of mixing custom stuff with OS stuff etc)

kata1yst@sh.itjust.works on 23 Aug 2024 23:33 next collapse

This is precisely what Opensuse MicroOS, Aeon, etc do, with the one difference that they use the snapshots as a fallback rather than a test env.

seaQueue@lemmy.world on 24 Aug 2024 01:10 next collapse

I wrote snapshot hooks for Arch that fire before installing or upgrading packages and I have a simple shell alias that I can use to fire off a manual snapshot any time I need one. If a package breaks in an inconvenient way and can’t just be dowgraded back to function or I have some other time pressure I can just point my root partition at a clone of my most recent snapshot and reboot to roll back. I don’t usually bother rebooting into a cloned snapshot to test changes as I can just perform the same steps to roll back and the automated rolling snapshots mean I don’t need to baby anything to have the same protection.

dario@feddit.it on 24 Aug 2024 10:33 collapse

This is also a sensible approach.

rotopenguin@infosec.pub on 24 Aug 2024 03:46 next collapse

“Except when something breaks after an odd update once or twice per year”

You don’t need snapshots, except for the moments when you do. The point of snapshots is that they’re so cheap that you can let them roll on their own and only care about them the day your system breaks.

dario@feddit.it on 24 Aug 2024 10:28 collapse

A broken system is no big deal for me, I can easily get up and running after a failed update. My data is also mirrored to my Nextcloud instance.

Sina@beehaw.org on 31 Aug 2024 17:07 collapse

You have to reboot yes, however only once. The step where you boot into your snapshot is redundant.

dario@feddit.it on 01 Sep 2024 22:12 collapse

Yes, now I understand.

teawrecks@sopuli.xyz on 24 Aug 2024 04:23 next collapse

That sounds fine, but isn’t this also what LXC is for?

dario@feddit.it on 24 Aug 2024 10:29 collapse

It could be a sensible approach, but with a snapshot I am free to tinker with every aspect of the system knowing that I can revert everything with a reboot.

beeng@discuss.tchncs.de on 24 Aug 2024 10:48 collapse

Which is exactly how the normal flow of snapshots work too. Except no initial reboot to start tinkering

mrvictory1@lemmy.world on 24 Aug 2024 04:46 next collapse

I do not use snapshots despite using BTRFS due to low disk space

zkrzsz@hexbear.net on 24 Aug 2024 07:11 next collapse

You can still do the auto snapshot daily/weekly plus the manual snapshot whenever big update coming or try something.

dario@feddit.it on 24 Aug 2024 10:26 collapse

Of course, I could, but I do not need periodic snapshots.

beeng@discuss.tchncs.de on 24 Aug 2024 07:56 next collapse

You restart and reboot into the snapshot? Maybe KVM and ssh into it could be a nicer workflow?

dario@feddit.it on 24 Aug 2024 10:25 collapse

Yes, I reboot into the snapshot. I need to tinker into a copy of my system and I think there is no easy way to boot into the snapshot with a virtual machine.

fmstrat@lemmy.nowsci.com on 24 Aug 2024 11:03 next collapse

Why not do both?

I use a script in cron that uses timestamps as snapshot names, and deletes old ones. Then I also take a snapshot with a timestamp right before doing anything dumb.

You could even make a script called mksnap that figures out what zfs/btfs you’re in on the current folder and auto-snaps it.

dario@feddit.it on 25 Aug 2024 16:02 collapse

This is an option, but I really do not need periodic snapshots.

TCB13@lemmy.world on 24 Aug 2024 12:28 next collapse

+1, I do the same.

dario@feddit.it on 25 Aug 2024 15:59 collapse

Glad to read that.

Sina@beehaw.org on 26 Aug 2024 03:51 next collapse

You are making it unnecessarily difficult for yourself. Rolling back a snapshot that you made before the intentional messing around is less effort than rebooting twice for seemingly no reason. Booting into a snapshot is not sandboxing, it’s not an added layer of security against a malicious package.

dario@feddit.it on 26 Aug 2024 21:05 collapse

I know it is not secure. Are you saying that I can roll back to the state before I intentionally messed around without rebooting? Can you elaborate?

ViaFedi@lemmy.ml on 27 Aug 2024 15:06 collapse

i prefer nix-shell -p or distrobox