Restore full backup

Hi, everyone,
I’m totally new to the restic topic.

On my linux mint desktop I use timeshift for backups and now I need a backup system for the raspbian OS without GUI.

I want to restore a full system backup. But can I do that with a running system? Or do I have to restore it from a live system?

I made a backup with:

sudo restic -r /restic_backup/ backup / --verbose --exclude-file=/home/user/restexclude.txt

the resteclude.txt

/boot
/dev
/lib
/lost+found
/media
/mnt
/proc
/restic_backup
/run/mount
/sbin
/sys
/tmp
$ sudo restic -r /restic_backup/ snapshots 
enter password for repository: 
repository 7aeb6259 opened successfully, password is correct
ID        Time                 Host         Tags        Paths
--------------------------------------------------------------------
aafce694  2022-07-30 17:44:13  raspberrypi              /home/user
0b358eb2  2022-07-30 22:22:58  raspberrypi              /home/user
1c70bf03  2022-07-30 22:23:28  raspberrypi              /
bb10283d  2022-07-30 22:29:01  raspberrypi              /
--------------------------------------------------------------------
4 snapshots

Greeting Tron

Working on file basis (like restic does) I’d always perform a restore offline, e.g., using a live environment.

You might also want to include /boot, /lib and /sbin for consistent results.

Hello dhopfm, I thank you for your help.

What’s the best way to restore offline? As said before, it’s Raspbian OS on a Raspberry Pi.
I prefer a simple push of a button. Sometimes I crash my OS or try something and want to undo everything.

Timeshift from Linux Mint makes it very easy. just a push of a button. Restore, reboot and so far is automatic and that’s how easy I want to set it up with restic.

dhopfm wrote:
You might also want to include /boot , /lib and /sbin for consistent results.

maybe only /boot because /lib and /sbin are links. I could also exclude /bin
Am I right? Or is it better to include the links anyway?

root@raspberrypi:/lib# ls -la /
total 71
drwxr-xr-x  19 root root  4096 Jul 30 16:06 .
drwxr-xr-x  19 root root  4096 Jul 30 16:06 ..
lrwxrwxrwx   1 root root     7 Apr  4 16:25 bin -> usr/bin
drwxr-xr-x   3 root root  3072 Jan  1  1970 boot
drwxr-xr-x  16 root root  3860 Jul 31 08:53 dev
drwxr-xr-x  88 root root  4096 Jul 31 08:32 etc
drwxr-xr-x   3 root root  4096 Apr  4 16:43 home
lrwxrwxrwx   1 root root     7 Apr  4 16:25 lib -> usr/lib
drwx------   2 root root 16384 Apr  4 16:41 lost+found
drwxr-xr-x   2 root root  4096 Apr  4 16:25 media
drwxr-xr-x   2 root root  4096 Apr  4 16:25 mnt
drwxr-xr-x   2 root root  4096 Apr  4 16:25 opt
dr-xr-xr-x 186 root root     0 Jan  1  1970 proc
drwx------   7 root root  4096 Jul 30 16:06 restic_backup
drwx------   4 root root  4096 Jul 31 06:43 root
drwxr-xr-x  25 root root   740 Jul 31 09:09 run
lrwxrwxrwx   1 root root     8 Apr  4 16:25 sbin -> usr/sbin
drwxr-xr-x   2 root root  4096 Apr  4 16:25 srv
dr-xr-xr-x  12 root root     0 Jan  1  1970 sys
drwxrwxrwt   9 root root  4096 Jul 31 09:20 tmp
drwxr-xr-x  11 root root  4096 Apr  4 16:25 usr
drwxr-xr-x  11 root root  4096 Apr  4 16:41 var

Would it work if I put the SD card from the Raspberry PI in my Linux Mint PC and then run this command?:

sudo restic -r /media/user/rootfs/restic_backup/ restore -t /media/user/rootfs/ bb10283d

You probably have to remove all files from the partition first. restore currently does not remove files which exist in the target folder but not the snapshot. But besides that it will probably work.

I’m not entirely sure about the bootloader setup used by the raspberry pi. It might be necessary to also restore the files in the boot partition, but it will probably also work without doing that.

Do you know how that works in timeshift? Is it using filesystem snapshots?

Hallo MichaelEischer, I thank you for your help.

All I know is that Timeshift lets you choose between rsync and BTRFS. I always choose rsync.