This tutorial should help if you are having issues using Timeshift on a BTRFS system with swap enabled

  1. Turn off swap sudo swapoff -a
  2. Remove old swap sudo rm /swapfile
  3. Create dedicated BTRFS subvolume sudo mount -o subvolid=5 /dev/nvme1n1p2 /mnt
  4. Create the new @swap subvolume sudo btrfs subvolume create /mnt/@swap
  5. Create a permanent directory for it and mount the new subvolume there
sudo mkdir -p /swap
sudo mount -o subvol=@swap /dev/nvme1n1p2 /swap
  1. Create the empty file sudo touch /swap/swapfile
  2. Disable Copy-on-Write (critical for BTRFS) sudo chattr +C /swap/swapfile
  3. Allocate the file size (e.g., 8GB) sudo fallocate -l 8G /swap/swapfile
  4. Lock down the file permissions for security sudo chmod 600 /swap/swapfile
  5. Format the file as swap space sudo mkswap /swap/swapfile
  6. Turn the new swapfile on sudo swapon /swap/swapfile
  7. Edit your filesystem table sudo vim /etc/fstab
  8. Delete the old swap line and add the new one
UUID=YOUR-UUID-HERE /swap btrfs subvol=@swap,defaults 0 0
/swap/swapfile none swap defaults 0 0
  1. Unmount the temporary top-level directory sudo umount /mnt

If done correctly, swapon --show should show 8GB, findmnt /swap should show subvol=/@swap, sudo lsattr /swap/swapfile should show a capital C. Test Timeshift: sudo timeshift --create