Live data from Hacker News

Timeshift: System Restore Tool for Linux

github.com

151–160 of 180 posts

Re: Timeshift: System Restore Tool for Linux

#151
My first "real" experience with Linux was with Wubi (Ubuntu packaged as a Windows program). I think it was based on Ubuntu version 6 or 8.

I also tried to update it, when the graphical shell displayed a message saying that update is available. Of course, it bricked the system.

I've switched from Ubuntu to Mint to Debian to Fedora to Arch to Manjaro for personal use and had to support a much wider variety of distributions professionally. My experience so far has been that upgrades inevitably damage the system. Most don't survive even a single upgrade. Arch-like systems survive several major package upgrades, but also start falling apart with time. Every few years enough problems accumulate that merit either a complete overhaul or just starting from scratch.

With this lesson learned, I don't try to work with backups for my own systems. When the inevitable happens, I try to push forward to the next iteration, and if some things to be lost, then so be it. To complement this, I try to make the personal data as small and as simple to replicate and to modify moving forward as possible. I.e. I would rule against using filesystem snapshots in favor of storing the file contents. I wouldn't use symbolic links (in that kind of data) because they can either break or not be supported in the archive tool. I wouldn't rely on file ownership or permissions (god forbid ACLs!) Try to remove as much of a "formatting" information as possible... so I end up with either text files or images.

This is not to discourage someone from building automated systems that can preserve much richer assembly of data. And for some data my approach would simply be impossible due to requirements. But, on a personal level... I think it's less of a software problem and more of a strategy about how not to accumulate data that's easy to lose.

Re: Timeshift: System Restore Tool for Linux

#152

Earlier quoted context omitted.

Is there something about your home directory that you'd want to back up that is not covered by invoking home manager as a nix module as part if nixos-rebuild? https://nix-community.github.io/home-manager/index.xhtml#sec... To me, it's better than a filesystem-backup because the things that make it into home manager tend to be exactly the things that I want to back up. The rest of it (e.g. screenshots, downloads) aren…

Data (documents, pictures, source code, etc.) is not handled by home-manager. Backing up home.nix saves your config, but the data is just as if not more important.

Hmm, different strokes I guess. Maybe it's just that too much kubernetes has gone to my head, but I see files as ephemeral.

Code and docs are in source control. My phone syncs images to PCloud when I take them. Anything I download is backed up... wherever I downloaded it from.

Re: Timeshift: System Restore Tool for Linux

#154
post #65
post #48

Earlier quoted context omitted.

One problem with file based backups is that they are not atomic across the filesystem. If you ever back up a database (or really any application that expects atomicity while it’s running), then you might corrupt the database and lose data. This might not seem like a big problem, but can affect e.g. SQLite, which is quite popular as a file format. Then again, the likelihood that the backup will be inconsistent is fair…

You can also use lvm2 and then you get atomic snapshots with any file system (I think it needs to support fsfreeze, I guess all of them do).

lvm requires unallocated space in the volume which makes it kind of garbage to use for snapshots

Re: Timeshift: System Restore Tool for Linux

#155

Earlier quoted context omitted.

Do you only back up your home directory, or also others? I didn't find info about that in your post.

I backup everything except for scratch/tmp/device style directories. Bytes are cheap to store, my system is a rounding error vs my /home, and deduping goes a long way.

I'm less worried about the size and more about something breaking when doing a recovery.

Let's say you're running Fedora with Gnome and you want to switch to KDE without doing a fresh install. You make a backup, then go through the dozens of commands to switch, with new packages installed, some removed, display managers changed etc. Now something doesn't work. Would recovering from the restic backup reliably bring the system back in order?

The tool from the original post seems to be geared towards that, while most Restic and rclone examples seem to be geared towards /home backup, so I wonder how much this is actually an alternative.

Re: Timeshift: System Restore Tool for Linux

#156
post #146

Earlier quoted context omitted.

Thanks, sounds interesting. So you create a snapshot, then let kopia process that snapshot rather than the live filesystem, and then remove the snapshot? > I suppose if it only walked files it knew were changed it would be a lot faster. Right, for me I'd want to set it up to do the full disk, so could be millions of files and hundreds of GB. But this trick should work with other backups software, so perhaps it's a vi…

Exactly so. Here's the script, should it be of benefit to someone, even if it of course needs to be modified: #!/bin/sh success=false teardown() { umount /mnt/backup/var/lib/docker || true umount /mnt/backup/root/.cache || true umount /mnt/backup/ || true for lv in root docker-data; do lvremove --yes /dev/hass-vg/$lv-snapshot || true done if [ "$1" != "no-exit" ]; then $success exit $? fi } set -x set -e teardown no-…

Awesome, thanks!

Re: Timeshift: System Restore Tool for Linux

#157
post #145

Earlier quoted context omitted.

Thanks for the pointers, looks very relevant. It's just such a low-effort peace of mind. Just a few clicks and I know that regardless what happens to my disk or my system, I can be up and running in very little time with very little effort. On Linux it's always a bit more work, but backups and restore is one of those things I prefer is not too complicated, as stress level is usually high enough when you need to do re…

it depends. Doing a complete disaster recovery of a windows system IMHO can be a real struggle. Especially if you have to restore a system to different hardware, which the system state backup that microsoft offers does not support afaik. Backing up a linux system in combination with REAR: https://github.com/rear/rear and a backup utility of your choice for the regular backup has never failed me so far. I used it to r…

For my cases it's been quite easy, but then I've mostly had quite plain hardware so didn't need vendor drivers to recover.

While I've had to recover in anger twice, I've used the same procedure to migrate to new hardware many times. Just restore to the new disk in the new machine, and let Windows reboot a few times and off I went.

REAR looks useful, hadn't seen that before.

Re: Timeshift: System Restore Tool for Linux

#158

Earlier quoted context omitted.

I backup everything except for scratch/tmp/device style directories. Bytes are cheap to store, my system is a rounding error vs my /home, and deduping goes a long way.

I'm less worried about the size and more about something breaking when doing a recovery. Let's say you're running Fedora with Gnome and you want to switch to KDE without doing a fresh install. You make a backup, then go through the dozens of commands to switch, with new packages installed, some removed, display managers changed etc. Now something doesn't work. Would recovering from the restic backup reliably bring th…

Oh, I see what you're saying. I personally wouldn't use it to do a 100% filesystem restore. For the sake of simplicity, I'd just use dd/ddrescue to make a .img file and then load that .img file directly into a partition to boot from a new piece of hardware. Likewise if I were doing a big system change like GNOME to KDE or vice versa, I'd just make an .img file before and restore from it if it went wrong.

I think of restic system backups covering something like losing a customized /etc file in an apt upgrade and wanting to get it back.

Re: Timeshift: System Restore Tool for Linux

#159

Earlier quoted context omitted.

Proprietary package vendors often provide a. deb that assumes Ubuntu. Maybe also a. rpm for RedHat if you're lucky.

That's definitely true, but maybe I've just been lucky, pretty much every proprietary program I've wanted to install in NixOS has been in Nixpkgs. Skype, Steam, and Lightworks are all directly available in the repos and seem to work fine as far as I can tell. I'm sure there are proprietary packages that don't work or aren't in the repo, but I haven't really encountered them.

I've unfortunately encountered a few. TotalPhase's Data Center software for their USB protocol analyzers is my current annoyance, someday I'll figure out how to get it to work but thus far it's been easier to just dedicate a second laptop to it.

Re: Timeshift: System Restore Tool for Linux

#160

Earlier quoted context omitted.

Data (documents, pictures, source code, etc.) is not handled by home-manager. Backing up home.nix saves your config, but the data is just as if not more important.

Hmm, different strokes I guess. Maybe it's just that too much kubernetes has gone to my head, but I see files as ephemeral. Code and docs are in source control. My phone syncs images to PCloud when I take them. Anything I download is backed up... wherever I downloaded it from.

Cloud sync != backup. Cloud sync won't help if you accidentally delete the file, backups will. Cloud sync won't help if you make an undesired edit, backups will.
Post reply on HN