Question about what Timeshift restores with UEFI system and BTRFS filesystem
0
votes
0
answers
284
views
I am curious how Timeshift restores will work with my system configuration which includes UEFI and a BTRFS formatted system partition.
First, here's some information about how my system is organized:
OS: Mint 20.3
Kernel: 5.4.0-149-generic x86_64
Disk info:
GPT with UEFI
Partitions:
/sda1: EFI system partition formatted with FAT32 mounted at /boot/efi
/sda2: swap
/sda3: System partition formatted with BTRFS with two subvolumes: @ mounted at / and @home mounted at /home
*Note* Since BTRFS was not the default configuration, I read a guide about how to install Mint 20 with BTRFS and UEFI. I can't remember where I found the guide, unfortunately, so I can't link it here. The partitioning scheme above was the recommended layout.
Bootloader: Grub2
Timeshift: configured to run with BTRFS; @home is excluded from the snapshots
I have installed Mint on a virtual machine to test out some things, including Timeshift. I run Mint 20.3 and use Timeshift on my daily driver and I've been meaning to test out different restore scenarios in case I ever need them. I've been using various distributions, including Arch, so I'm fairly familiar with Linux and system administration. I'm not saying that to flex or anything; just to say that it's OK to get technical.
**My question is how would Timeshift restores work given my configuration above?** From what I understand of BTRFS, since my EFI system partition is on a separate partition, it will not be included in the snapshots. That seems like it would be a problem because the ESP won't get restored. If I'm restoring a snapshot after a kernel update or even after an in-place OS upgrade, it seems like the fact that the ESP doesn't get restored would be a big problem.
It seems like most of the documentation and use cases that I've seen in various places online either assume that the system is running BIOS or that everything, including all of the boot files, are all on the same partition. But, I see in the Timeshift ReadMe on its Github page that it says that UEFI systems are supported. As I've been searching around on the forums and the internet I've also seen that Timeshift has some options to restore GRUB. What I have not been able to find is any sort of recommendation about partitioning schemes which use BTRFS and UEFI and how to set up Timeshift so that restoring a snapshot "just works".
So far, as a test, I did the following:
1. I made sure that I had a Timeshift snapshot and then I did a full system update which included a kernel update.
2. Then, as a test, I modified the text of /boot/efi/EFI/ubuntu/BOOTX64.CSV (I have done something like this before while testing something else so I know that it won't mess up Grub).
- I wanted to have a modification in my ESP which I knew about so that I could tell whether or not Timeshift had restored anything.
3. I rebooted the machine to verify that the boot process worked and also so that the new kernel would be used. The machine came back up without any trouble.
4. I made sure that the ESP was mounted at /boot/efi and then I restored the snapshot that I took prior to the full system update and rebooted.
- The machine came back up without any problems.
5. I checked the file at /boot/efi/EFI/ubuntu/BOOTX64.CSV and my modification was still present.
6. Once again, I made sure that the ESP was mounted at /boot/efi and I restored the automatic snapshot which was taken prior to the restore, rebooted, and checked the file and nothing had changed.
- As a note, I never saw any dialogs in Timeshift about where to restore or about bootloader options like the user in [this post](https://forums.linuxmint.com/viewtopic.php?p=1990657#p1990657) saw.
From what I understand of BTRFS and the way that snapshots work, what I'm seeing (and describing above) is expected behavior. It seems like other people are using Timeshift with a similar configuration but it seems like nobody is having any trouble with restores. Is their configuration different or are they not testing restores? Or maybe is it not a big deal that my ESP isn't getting restored by Timeshift? Alternatively, should I be reinstalling Grub after a Timeshift restore to make sure that Grub and the ESP get set up correctly?
Asked by greyseal96
(101 rep)
Feb 2, 2024, 11:28 PM