FirefoxHow Tolinuxupdate

How To: Timeshift on Fedora 34 with BTRFS

Tested with a luks encrypted BTRFS drive

Timeshift works fine on Fedora, but with a little bit of tweaking.

Elevate to sudo with sudo -i, then install Timeshift with:

dnf install timeshift -y

Next find the name of the partition you want to use Timeshift on by running lsblk. On my laptop (ThinkPad X390) it is under nvme0n1 -> nvme0n1p3 > luks-xxxx… – copy the luks-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx string to your clipboard (it’s luks+ the UUID of your drive).

lsblk output

Next we’ll need to change the mount point of the luks volume (replace luks-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with the UUID of the partition you found in the step above):

mkdir /btrfs_timeshift
mount -o subvolid=5 /dev/mapper/luks-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /btrfs_timeshift

Then move your root and home directories:

mv /btrfs_timeshift/root /btrfs_timeshift/@
mv /btrfs_timeshift/home /btrfs_timeshift/@home

Next up edit your /etc/fstab file to replace subvol=root with subvol=@ and subvol=home with subvol=@home

nano /etc/fstab

/etc/fstab with changes made

Next update grub’s configuration and reboot:

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

Now you can log back in, open Timeshift, and run through the setup guide.

Select Snapshot Type: pick BTRFS, click Next
Select Snapshot Location: pick your partition, click Next
Select Snapshot Levels: up to you
User Home Directories: I ticked Include @home subvolume in backups, left Enable BTRFS qgroups ticked and then clicked Finish.

Credit: this was based on an excellent guide here: https://mutschler.eu/linux/install-guides/fedora-btrfs/

Jonathan Procter

Linux, Unix, and Windows server sysadmin.

Related Articles

Back to top button