Background:

Typically when I’m trying something new on Linux, I search for an online guide that doesn’t assume I’m already an expert and looks like it should be easy enough for a pleb like myself to follow. Whatever it is I’m trying to do, it usually takes me multiple tries to get it right. Sometimes, when I’m venturing into new territory, I’ll derp around in a VM so I can take snapshots and then revert to the last good snapshot when something inevitably goes wrong. This approach works well for me most of the time.

But every now and then, I don’t want to use a VM, I want to use a spare laptop that I have lying around, “bare metal” if you will. It just feels more… authentic? My hesitation w/ practicing on spare laptops is that when I mess it up, the only way I know how to start over with a clean slate is to reinstall the OS and try again. This approach is not ideal b/c I mess up a lot - this is a fact of my life - and reinstalling the OS after every mistake takes a lot of time, to the point that I just stop persuing whatever project I was working on.

Question:

Is this a good use case for btrfs? How easy is it for a pleb like myself to take snapshots and then roll back to the previous state after jacking up a config file in /home or /etc or something?

  • Nibodhika@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    1 hour ago

    Yes, that should work, but as someone who went through that phase before BTRFS was a thing keeping /home in a separate partition helps quite a lot, because then reinstalling the system is just a 15 min afair and you’re mostly back where you were before except some programs you might have installed that you will need to do so again.

    The next logical step for me was to keep a list of those programs, so I could just run a single command and get all of them installed. That eventually evolved into convincing me to use Gentoo, since it has this concept baked into the system. But compiling everything wasn’t for me, so I went back to Arch where I stayed for over a decade. And even though I almost never broke my system again, I always had that fear. I even switched to BTRFS when it became more stable, but never had to use a snapshot, so can’t help you on how much it restores.

    Recently I’ve migrated to NixOS, and I’m very happy with it. The appeal of it for me was how the system is declared, which is a very advanced version of my packages in a file that also includes configurations. This makes it so that making changes to your system requires you to modify those files and rebuild your system, and at boot time you can select from the previous generations of the system in case you broke something. In short, this makes your system unbreakable because worst case scenario you boot into the previous generation that worked and figure out what you did wrong.

    That being said, it’s learning curve is very steep, but the payoff for those of us who like to tinker is huge. If you’re interested I recommend checking vimjoyer’s YouTube channel, he has several videos about it, and since you’re already used to running things in VMs to test it should be easy for you to get started. And the best thing is that once you’re done with configuring the VM, almost the exact same config would work on your main machine out of the box and give you the exact same system (the only caveat is that there’s one file that relates to hardware which would have to be different, but it gets auto-generated during the install process).