Set Up Fedora Partitions for Timeshift

If you’re a Fedora user and want a seamless snapshot of your filesystem, Timeshift is the tool for you. Leveraging BTRFS, Timeshift ensures easy restoration in the event of system mishaps without affecting your personal files.
Fedora is however not supported by the developper and to make this work, you need to rename your subvolumes as per Ubuntu’s naming. Here’s a succinct guide on setting things up.

Why Timeshift?

  • Snapshot Capability: Periodic or on-boot filesystem snapshots.
  • Space Efficiency: Minimal space use with BTRFS.
  • System Protection: Restore quickly from changes or upgrades that may cause issues.
  • Separate Personal Files: As the $HOME directory is on a distinct subvolume, rollbacks don’t affect personal files.

Setup Steps:

  1. Check Your Partitions: Identify BTRFS and its mounting.

    $ sudo lsblk
    

    Look for your BTRFS partition, typically denoted by TYPE="btrfs" or in our case (since we use LUKS) TYPE="crypt".

    NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
    zram0                                         252:0    0     8G  0 disk  [SWAP]
    nvme0n1                                       259:0    0 476.9G  0 disk  
    ├─nvme0n1p1                                   259:1    0   600M  0 part  /boot/efi
    ├─nvme0n1p2                                   259:2    0     1G  0 part  /boot
    └─nvme0n1p3                                   259:3    0 475.4G  0 part  
      └─luks-c3316e6d-1231-32c0-97b4-0fd589f26b13 253:0    0 475.3G  0 crypt /home
                                                                             /
    
  2. Mount BTRFS Pool:

    $ sudo mkdir /btrfs-pool
    $ sudo mount -t btrfs /dev/mapper/[your-btrfs-uuid] /btrfs-pool
    
  3. Rename Subvolumes for Timeshift Compatibility: Fedora uses a different naming convention than Ubuntu. To make Timeshift compatible:

    $ sudo mv /btrfs-pool/root /btrfs-pool/@
    $ sudo mv /btrfs-pool/home /btrfs-pool/@home
    
  4. Confirm Subvolume Names:

    $ sudo btrfs subvolume list /btrfs-pool
    

    You should see paths like @ and @home.

  5. Edit fstab: Update the fstab to reflect the new subvolume names.

    $ sudo nano /etc/fstab
    
  6. Update GRUB:

    $ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
    

    Your mounts should now be subvol=@ and subvol=@home.

  7. Unmount and Clean Up:

    $ sudo umount /btrfs-pool
    $ sudo rmdir /btrfs-pool
    
  8. Reboot: It’s crucial to reboot after these changes to ensure they’ve taken effect. Make sure you keep a live-usb at hand everything’s confirmed to work.

  9. Set Up Timeshift: Now that your partitions are ready, install and configure Timeshift. Initiate a manual snapshot to verify it’s working.

Final Thoughts: Harness the power of Timeshift with Fedora for a safer, more resilient system. Ensure you’ve read accompanying documentation and familiarize yourself with recovery procedures. Happy computing!


Note: The code snippets provided are based on the sample input and may require adjustments based on your actual system details. Always back up critical data before making changes.