Fedora 33: BTRFS configuration for Timeshift WIP

Configuration to get Timeshift (opens new window) working.

# timeshift and timeshift-gtk: Install Timeshift

sudo dnf install -y timeshift timeshift-gtk
1

# Rename subvolumes

Replace:

  1. home00 with the name of home partition.
  2. root00 with the name of root partition.
sudo dnf install -y util-linux
sudo mkdir -pv /tmp/btrs_rename
BTRFS_PARTITION="$(findmnt --noheadings --nofsroot --types btrfs -o source --list /)"
sudo mount "${BTRFS_PARTITION}" /tmp/btrs_rename
sudo mv -v /tmp/btrs_rename/home00 /tmp/btrs_rename/@home
sudo mv -v /tmp/btrs_rename/root00 /tmp/btrs_rename/@
sudo umount /tmp/btrfs_test
1
2
3
4
5
6
7

# /etc/fstab

  1. Append/Change to options compress=zstd:1,ssd,noatime,space_cache,discard=async of both / and /home partitions.
  2. Append/Change to subvol=@home of the /home partition.
  3. Append/Change to subvol=@ of the / partition.
$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed May 12 01:05:40 2021
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
UUID=609b4828-40df-4606-828c-0875bb892ab3   /                       btrfs   subvol=@,compress=zstd:1,ssd,noatime,space_cache,discard=async          0 0
UUID=1B11-4A39                              /boot/efi               vfat    umask=0077,shortname=winnt                                              0 2
UUID=609b4828-40df-4606-828c-0875bb892ab3   /home                   btrfs   subvol=@home,compress=zstd:1,ssd,noatime,space_cache,discard=async      0 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14

# /etc/default/grub

Comment out GRUB_ENABLE_BLSCFG=true and append GRUB_ENABLE_BLSCFG=false:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="nosplash quiet"
GRUB_DISABLE_RECOVERY="true"
#GRUB_ENABLE_BLSCFG=true
GRUB_ENABLE_BLSCFG=false
1
2
3
4
5
6
7
8
9

Or alternatively:

$ sudo grub2-editenv list
$ sudo grub2-editenv - set blsdir=/@/boot/loader/entries
$ sudo grub2-editenv list
boot_success=1
blsdir=/@/boot/loader/entries
boot_indeterminate=1
menu_auto_hide=1
saved_entry=8f0d32e70f414ab9875eecf03a84ffb6-5.12.9-300.fc34.x86_64
1
2
3
4
5
6
7
8

# /boot/efi/EFI/fedora/grub.cfg: Re-generate grub configuration

sudo grubby --update-kernel=ALL --args="rootflags=subvol=@"
sudo dracut --force --regenerate-all
sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
sudo reboot # sudo systemctl reboot
1
2
3
4

NB: On Fedora 34 the command changes to:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
1

# Post Reboot

cmdline should look like:

$ cat /proc/cmdline
BOOT_IMAGE=/@/boot/vmlinuz-5.11.19-200.fc33.x86_64 root=UUID=609b4828-40df-4606-828c-0875bb892ab3 ro rootflags=subvol=@ nosplash quiet
1
2

NB: cmdline should contain rootflags=subvol=@.

# Defragment disk

sudo btrfs filesystem defrag -czstd -rv / /home/
1

# Verify configuration with timeshift-gtk

sudo timeshift-gtk
1

# Create a snapshot using timeshift CLI

D below stands for on-demand:

sudo timeshift --create --comments "rocm-4.2.0" --tags D
1
Last Updated: 7/3/2021, 2:36:44 PM