david-cortes / snapper-in-debian-guide

Step-by-step guide for configuring Debian with automated BTRFS snapshots and rollbacks from the boot menu
GNU General Public License v3.0
42 stars 5 forks source link

Suggestion: Mention Timeshift as alternative to snapper and why it might work better for some #5

Closed danboid closed 3 months ago

danboid commented 3 months ago

Hi David

Thanks for writing this very handy guide! It is a great companion to SpiralLinux for how to configure Debian for BTRFS snapshot use. I found it especially useful for your description of how to restore @home subvolumes under Debian.

I have noticed that it currently makes no mention of using Timeshift as an alternative to snapper, and I think it probably should.

There are two main advantages of using Timeshift instead of snapper. Restoring timeshift snapshots when you also want to restore your home dir is much easier using the timeshift gui than using snapper-rollback or the snapper command. snapper-rollback currently only supports rolling back the root subvolume and I have had no luck using btrfs-assistant to rollback although it works fine for creating and deleting snapper snapshots. When you restore a timeshift snapshot using timeshift-gui, it asks if you also want to rollback your @home subvolume snapshot too.

timeshift-gui also lets you easily browse and copy individual files and folders from within snapshots, a feature missing from both snapper-gui and btrfs-assistant.

Note that when you install Debian from its live installers (which uses the Calamares based GUI installer) if you install using BTRFS the Debian live installer will automatically configure your BTRFS subvolumes in the way required to use timeshift. Unfortunately the standard Debian installer does not configure any BTRFS subvolumes, as you know.

Hence, if you want to install Debian for use with snapper you should install SpiralLinux and f you want to use timeshift then you should install using the Debian Live graphical installer.

I have successfully used timeshift under Debian with grub-btrfs in a very similar manner to what you describe in your guide. For people who only want to create manual snapshots, timeshift might be a better choice.

Do you think this might justify adding a small section to you guide to cover these points, so people know there is an alternative?

EDIT

I forgot to mention, the big disadvantage of timeshift versus snapper is that timeshift only supports one subvolume configuration (@ for root and @home for /home) whereas snapper gives the user much more freedom in configuration.

It is best to minimise the number of subvolumes and snapshots per subvolume. Both should be kept to having no more than about 10.

Hopefully snapper-rollback will get updated to support rolling back @home and other subvolumes.

imthenachoman commented 3 months ago

I would be curious how many of the steps would have to be altered for Timeshift?

And I think this guide is using Snapper since that is what openSUSE uses. openSUSE's installation process includes snapper out of the box.

danboid commented 3 months ago

This guide says in the introductory paragraph

The tutorial is inspired by the [SpiralLinux](https://github.com/SpiralLinux/SpiralLinux-project) distribution, which configures this automatically upon install.

The guide uses snapper because SpiralLinux uses snapper by default.

imthenachoman commented 3 months ago

Ah, my bad!

danboid commented 3 months ago

I forgot to mention, the big disadvantage of timeshift versus snapper is that timeshift only supports one subvolume configuration (@ for root and @home for /home) whereas snapper gives the user much more freedom in configuration.

david-cortes commented 3 months ago

Thanks for the suggestion - I added a short paragraph about it. Feel free to suggest more resources for setting it up in Debian if you have any.

That being said, as far as I am aware, timeshift's capabilities for /home do not all work correctly with KDE due to the latter requiring booting into a writable /home/<user>.

danboid commented 3 months ago

Thanks for your quick reply David!

I'd not heard of yabsnap before reading the updated guide. I shall have to check that out but I think I'll stick with snapper or timeshift because I like to use GUI tools sometimes, like when manually removing multiple snapshots. Its easier than having to think about shell scripting.

I don't think setting up timeshift under Debian needs its own guide. The only thing anyone needs to know about that is what I mentioned about the Debian Live installer automatically creating the subvols required to use timeshift whereas the normal Debian installer doesn't. Setting up grub-btrfs is the same procedure as when using snapper as described in your guide.

david-cortes commented 3 months ago

@danboid By "Debian Live Installer", do you mean this one? https://www.debian.org/CD/live/

If so, is the difference w.r.t. the non-live installer that the Calamares installer does the subvolume setup within a BTRFS partition? What sort of option do you have to choose there in order to have BTRFS subvolumes for e.g. /var/log created by the installer?

danboid commented 3 months ago

Yes, that is the correct link to the Debian Live installation images that I'm referring to as being good for Timeshift.

You don't need to choose any special options during installation, the only requirement is that you choose the custom partition option and assign your / partition to be formatted with BTRFS because I'm pretty sure the Debian Live Calamares installer defaults to using ext4 otherwise if you choose the default partitioning option.

The Calamares installer doesn't give you the option to create any custom subvols, it will just create a @ subvol for / and a @home for /home which is what timeshift requires.