linuxmint / timeshift

System restore tool for Linux. Creates filesystem snapshots using rsync+hardlinks, or BTRFS snapshots. Supports scheduled snapshots, multiple backup levels, and exclude filters. Snapshots can be restored while system is running or from Live CD/USB.
2.53k stars 91 forks source link

Freeze in timeshift-gtk when clicking on anything related to BTRFS #232

Open anadon opened 1 year ago

anadon commented 1 year ago

On a fresh install with a disk with two partitions, the first UEFI mounted as /boot/efi and the second BTRFS mounted as /, when I start timeshift-gtk as root the first interactable screen is a "Setup" screen (another flashes before closing). At the first view, when selecting between RSYNC and BTRFS, clicking the radio button for BTRFS causes a unresponsive freeze requiring SIGKILL. If I stay with RSYNC and then select the root partition I want to back up, then it has the exact same behavior.

The debug logs looks like this:

For the initial click on BTRFS: Screenshot from 2023-09-12 22-11-44

D: page: 0
D: try_select_default_device_for_backup()
D: SnapshotRepo: available()
D: is_available: ok
D: SnapshotRepo: from_null()
D: device not set
D: SnapshotRepo: from_null(): exit
D: update_partitions()
D: df -T -B1
D: Device: get_disk_space_using_df(): 6
D: Device: get_mounted_filesystems_using_mtab(): 6
D: Device: get_filesystems(): 30
D: partition list updated
D: check_btrfs_volume():@
D: Device: get_mounted_filesystems_using_mtab(): 6
D: Device: get_mounted_filesystems_using_mtab(): 6
D: ------------------
D: arg=4f1a6412-7c2c-4da2-87b8-7ee5f4f46010, device=/dev/nvme0n1p2
D: /run/timeshift/196722/btrfs
D: /run/timeshift/196020/btrfs
D: /run/timeshift/186367/btrfs
D: /run/timeshift/176695/btrfs
D: /var/snap/firefox/common/host-hunspell
D: /gnu/store
D: /
D: ------------------
D: Device: get_mounted_filesystems_using_mtab(): 6
D: Device: get_mounted_filesystems_using_mtab(): 6
D: Unmounting from: '/run/timeshift/198491/btrfs'

For RSYNC then clicking the root partition: Screenshot from 2023-09-12 22-12-59

selected device: /dev/nvme0n1p2
D: fstype: btrfs
D: SnapshotRepo: from_device(): RSYNC
D: SnapshotRepo: init_from_device()
D: 
D: SnapshotRepo: unlock_and_mount_devices()
D: device=/dev/nvme0n1p2
D: SnapshotRepo: unlock_and_mount_device()
D: device=/dev/nvme0n1p2
D: Device: get_mounted_filesystems_using_mtab(): 6
D: ------------------
D: arg=4f1a6412-7c2c-4da2-87b8-7ee5f4f46010, device=/dev/nvme0n1p2
D: /run/timeshift/196722/btrfs
D: /run/timeshift/196020/btrfs
D: /run/timeshift/186367/btrfs
D: /run/timeshift/176695/btrfs
D: /var/snap/firefox/common/host-hunspell
D: /gnu/store
D: /
D: ------------------
D: Device: get_mounted_filesystems_using_mtab(): 6
D: Unmounting from: '/run/timeshift/197290/backup'

System:

Timeshift was installed via nix-env -i timeshift.

fstab:

/dev/disk/by-uuid/4f1a6412-7c2c-4da2-87b8-7ee5f4f46010 / btrfs defaults 0 1
/dev/disk/by-uuid/7A41-8BEB /boot/efi vfat defaults 0 1
/dev/disk/by-uuid/521f8e69-b470-4628-a311-a27ce9f7485f /mnt/spinning-rust btrfs defaults 0 1
emanuc commented 1 year ago

/dev/disk/by-uuid/4f1a6412-7c2c-4da2-87b8-7ee5f4f46010 / btrfs defaults 0 1 /dev/disk/by-uuid/7A41-8BEB /boot/efi vfat defaults 0 1

The requirements for Btrfs:

In BTRFS mode, snapshots are taken using the in-built features of the BTRFS filesystem. BTRFS snapshots are supported only on BTRFS systems having an Ubuntu-type subvolume layout (with @ and @home subvolumes).

If you have installed Ubuntu 23.04, it has the new subiquity based installer, it is a regression of the new Ubuntu installer that does not create the @ and @home subvol, you should open an issue on the Ubuntu installer. But anyway, Timeshift should not crash if it finds an unsupported filesystem layout, but show a warning message.

anadon commented 1 year ago

Consolidated a few duplicate reported bugs, but others have run into the subvolume issue before. For cross reference: https://bugs.launchpad.net/ubuntu-desktop-installer/+bug/1881932 .