Linux Ubuntu user? Please help with a system backup solution

FW 13 AMD version. I initially was running Fedora 39 but realised my Timeshift backups weren’t working as I didn’t rename the partitions during install. I read that Timeshift was actually designed for Ubuntu based systems, so that (plus a bunch of other annoyances with having to setup all the basics in Gnome 45) meant I instead have switched to Ubuntu 22.04 LTS.

I setup Timeshift immediately and tried to create a snapshot but I’m suffering from this issue where Snapshots are shwon / being made: rsync - Timeshift GUI not showing snapshots - Ask Ubuntu

AskUbuntu not the most helpful so thought I’d tap the community here.

Essentially, how do you all create simple system restore points for your Ubuntu based systems? I’ve done quite a bit of reading but I haven’t really found a GUI-based solution that allows me to create simple system restore points (I don’t have any personal files to backup).

Any help appreciated,
Taimur

(This isn’t going to be helpful, but I wanted to make sure that you got at least one response.)

I couldn’t find a backup solution that did the specialized things I wanted, so I wrote my own backup script. It relies on the system being built on BTRFS, and going to a TrueCrypt-encrypted backup drive hosted on my Network-Attached Storage system (the encryption is so that I can safely copy the encrypted backup file to an offsite location).

I don’t use any GUI for fs snapshots. Only cli or scripts.

Iirc Timeshift supports ext4 via hardlink or btrfs. Which filesystem are you using?

Have you checked if your issue has been reported/solved upstream?

To be honest, I used timeshift back in the past, and stopped using it.
What I use now is BorgBackup → https://www.borgbackup.org/ which does practically the same. As I use it in CLI version only, don’t know if non server admins can deal with it easily.
You can use some GUI’s though → GitHub - borgbase/vorta: Desktop Backup Client for Borg Backup is one of them.

3 Likes

Another vote for Borg (either to local NAS or to a (very cheap) provider like BorgBase); My 15m snapshots are zero-to-no overhead. CLI or GUI options, so for all tastes. Doesn’t care about your O/S version.

The fam also has Nextcloud to our NAS for simpler “just sync this folder” backups. CLI and GUI ditto; they only use the GUI.

But it’d also be useful to know some background. You say you have “no personal files to backup”. So this is some kind of server ? And you want to be able to do… what ? A bare metal recovery if it burns down and you get new hardware ? Roll back config files if you change something and it breaks ? Are you hand rolling this server by manually doing things ad-hoc to it ? … ?

Wow, thanks so much all of you for your responses. As a bit more info, given my history of borking my Linux installations, or upgrades causing issues, I’m just wanting a way to be able to restore the system to a previous point should anything break (like a Windows system restore point).

So:

  • I’m using the standard Ubuntu file system w 22.04 LTS (ext4?)
  • I’m not backing up any personal files so encryption not needed - I manage personal files through the cloud and also local backup solutions
  • it’s basically just the root folder (is my understanding) that I would like to backup

Have you checked if your issue has been reported/solved upstream?
This problem seems to be fairly commonly encountered.. Timeshift is no longer actively maintained for Ubuntu - the linux mint community have taken over development. The linked solution for the issue was to add a private personal repository of someone that is updated with daily (poss unstable) builds from the Linux Mint team. This seemed a bit too sketchy for a long term solution.

And you want to be able to do… what ? A bare metal recovery if it burns down and you get new hardware ? Roll back config files if you change something and it breaks ?
Just be able to roll back my laptop if something breaks yes.

I had a look at Vorta / Borg but they seemed more aimed at data / personal files backup rather than system backups. If you think it is still relevant to my use-case I will take a look again.

Thanks again in advance for any further insight!

The thing is - installing Ubuntu LTS is so simple, I don’t need all the rest.
All that is important are the files in my home directory.
Sometimes I copy also a file or 2 from the /etc directory as a reference (all system configuration resides in there), but that’s about it.

As I do it:
I host everything at home myself (Mail, DNS, Nextlcoud Intranet/Extranet, DHCP, media and more => Server IMB-V2000P setup ). By default - I have my important files in the /home/[username]/nextPub|nextCloud
(nextPub being publicly accessible stuff, and nextCloud only accessible through the Intranet).
The directories nextPub/nextCloud are always synced through the nextcloud client to my NAS (self setup BTW - running Kubernetes on it and in there all the services).
On the NAS I have one OS SSD NVmw, one Data NVMe SSD and one Storage Raid 1 HDD running.
Backups go into the storage disk (running in raid).

On the NAS, I have a BORG cron-job going through all persistent files from all running services.
The problem nowadays is not the deployment of the OS anymore. It is the configuration and personal data. So that’s what I store.
FYI - installing a system from scratch takes 10 minutes. Adding kubernetes another 10 - then restoring the kubernetes configuration and persistent drives 10 more minutes (fast disks :} ) that’s it. Server restored with all that is needed.

Thing is - whatever backup strategy you choose, make sure the restore operation works.
And, only back up what is important to you. The files freely accessible on the internet are not a worthy backup target :wink:

For a client - install client, install nextcloud client, let it sync, done. All files are there.
You can also configure nextcloud to sync user’s home - then make sure to exclude all cache/temp directories! they can get huge for nothing.

I’m with you on the reinstallation of the OS. Very straightforward, but still takes a lot of time in comparison to just rolling back a snapshot when I have an install go wrong and want to return to a closed system.

As you’re obviously versed in Linux architecture can you help me understand then

a. what Timeshift was effectively doing was using rsync to copy all the files in the root folder (excluding the home directory) to create a snapshot, which it did incrementally

b. if I was to do this manually, would this achieve the same purpose? ie to ‘restore’ a system could I just copy and paste the root directory from the backup folder, into the Ubuntu root director?

c. is Borg /Vorta an appropriate tool then to achieve this kind of backup and restore?

  • what Timeshift was effectively doing was using rsync to copy all the files in the root folder (excluding the home directory) to create a snapshot, which it did incrementally
    JM: Timeshift is just syncing your disk and keeping a time based copy of the changes. Same as Borg does.

  • if I was to do this manually, would this achieve the same purpose? ie to ‘restore’ a system could I just copy and paste the root directory from the backup folder, into the Ubuntu root director?
    JM: If you have it entirely, yes. But you will need to take care of the boot/efi entries.

  • is Borg /Vorta an appropriate tool then to achieve this kind of backup and restore?
    JM: Borg does the same as timeshift but is IMHO faster. I also think it has a smaller footprint as it automatically deduplicate same files.
    To be honest, in 35 years (started with kernel 0.07p11 end 1992 or so) I maybe have reinstalled an entire system because of a massive crash or misconfiguration 5 times… and I have min 5 systems running.

Usually, when a system misbehaves, it is not directly linked to the last change you did, but a series of changes you did over time, daisy-chaining together to the “disaster” situation.

In that case, it takes way longer to recover correctly, and playing back a timeshift backup will only push back the happening of the “disaster” one more time.

1 Like

I am migrating to btrfs + btrbk (+ btrfsmaintenance ) ecosystem for all of my machines on my home network.

6 months in use, no issues and it has handled a bunch of goofy situations elegantly.

1 Like

Thank you. Yes reinstalling is definitely not too painful these days, sometimes an easy rollback is helpful though.

I will look again more into Borg / Vorta, sounds promising. One thing though, can that deal with grub/EFI entries?

I am migrating to btrfs + btrbk (+ btrfsmaintenance ) ecosystem for all of my machines on my home network. 6 months in use, no issues and it has handled a bunch of goofy situations elegantly.

I was unaware Ubuntu could run as BTRFS. Will look up how to do this, thank you

BTRFS is the cornerstone of my home-grown backup scripts. :smile: Though I’m eagerly awaiting bcachefs, to see if that might be usable instead.

No. It does not. You can backup the /boot/efi directories, but it has nothing to do with the grub/efi entries as registered in the onboard efi entries.

If you want to have something dealing with that, check out CloneZilla …
But there are not snapshots with it, and you need to boot from USB Stick.
I use it for our gaming rigs. When frehsly installed, I take a clonezilla image.
When something goes wrong, I dump it onto the disks and apply the updates again. Done.

It can. I don’t remember if in the latest versions is a “normal” installation option or if you have to go into the “advanced” ones. But it works very well.

I’m also planning to trying that with some redundant(don’t trust it yet) data this year. Looks interesting. Still some features missing compared to zfs but nothing essential for me.

Be mindful that Ubuntu mounts on /boot/grub/efi / /boot/efi the ESP (EFI system partition), which has to be a separate FAT partition.

GRUB configuration, has generated by update-grub, is saved in the grub.cfg file.

EFI boot entries can be managed with efibootmgr: for example efibootmgr -v lists current entries and boot order.

It can. I don’t remember if in the latest versions is a “normal” installation option or if you have to go into the “advanced” ones. But it works very well.

That’s good to know thank you. When i recently tried to use BTRFS and Timeshift with Fedora 39, snapshots didn’t work as you have to rename Fedora filesystem to match Ubuntu filesystem (something about the ‘@home’ or similar. I take it that one does not need to do that then with Ubuntu, BTRFS snapshots in Ubuntu should be working out the box (as Timeshift was originally designed for ubuntu systems I read).

Well, KDE Neon based on ubuntu 22.04 mounts efi under /boot/efi.

smurphy@jupiter:~$ df | grep efi
efivarfs              148        84         60  59% /sys/firmware/efi/efivars
/dev/nvme0n1p3     523248      7828     515420   2% /boot/efi
smurphy@jupiter:~$ ls -l /boot/efi/EFI
total 12
drwxr-xr-x 2 root root 4096 mars  11 15:17 BOOT
drwxr-xr-x 2 root root 4096 mars  11 15:17 neon
drwxr-xr-x 2 root root 4096 mars  11 15:17 ubuntu

I used the info from this blog Pop!_OS 22.04: installation guide with btrfs, luks encryption and auto snapshots with timeshift | mutschler.dev to set up BTRFS with Pop-OS and it has been working very well for me with timeshift working reliably for local snapshots. I also use backintime to back up EFI, boot, root and home separately and have separate BTRFS subvolumes for root, /var/log and home each on the main partition. Pop-OS uses a separate RECOVERY partition to boot into if needed so a recovery/installation usb stick isn’t always needed.

1 Like

Oh this is excellent thank you. I’m going to try installing then Ubuntu again on the old SSD using BTRFS, and seeing if snapshots then work. I don’t need disk encryption so hopefully will make things simpler.

Thanks again everyone!

1 Like

I just point Borg at /etc/ as well any other config files, as well as daily MariaDB dumps or whatever, and let it do it’s thing.

If I have to reinstall, I do the base setup by hand, then restore all the config from there.

2 Likes