Skip to content

BTRFS top level mount generated by Timeshift don't use root mount flags #439

Open

Description

@Fantu

Describe the bug
Hi, I started to use Timeshift for system btrfs snapshots of one recent Mint installation, is first time I use timeshift on a production system with btrfs, I use btrfs for more than a decade, but I have always used other software for snapshots.
Outside the subvolumes layout and not optimal mount flags, which however concern the low btrfs support in the installer, and which I had manually workaround after installation, I noticed that the toplevel mount created by Timeshift to manage snapshots does not consider the flags used by the system mount.
I mean the mount it has done on /run/timeshift/xxxx/backup that use the default flag that may be different from the ones used for the / mount, for example relatime->noatime, the compression etc...
For most operations, I don't think it's a problem because, if I'm not mistaken, these parameters impact writes made to that mount, while the data remains as is when a snapshot is created. However, for write operations made to that mount, for example, using relatime (the default) instead of noatime (one of the most commonly used optimizations) will generate more metadata even just for a simple "consultation" of the snapshots.
The other btrfs snapshot management software I know of either requires an existing toplevel mount (where you set the "right" mount options) or creates nested snapshots (the latter has significant drawbacks, however) and therefore does not create its own mounts.

Expected behavior
Use the mount flag of / for the top level, or maybe more simply you could at least add in the settings the possibility to specify a "fixed" toplevel mount (with a security check that verifies that it is correct)

System:

  • Linux Distribution Name and Version: Mint 22.1
  • Desktop: Cinnamon
  • Application Version: 24.06.6

Activity

  1. orgcontrib commented on Sep 27, 2026

    @orgcontrib

    Hello, I am coming from OMV and hit the same root cause in a different context (snapshot cleanup/rotation).

    dacbarbos@dacrpione:~ $ sudo timeshift --delete --snapshot '2026-09-24_00-21-43'
    Mounted '/dev/mmcblk0p2' at '/run/timeshift/30126/backup'
    btrfs: Quotas are not enabled
    ------------------------------------------------------------------------------
    Removing snapshot: 2026-09-24_00-21-43
    Deleting subvolume: @ (Id:262)
    E: ERROR: Not a Btrfs subvolume: Invalid argument
    
    E: Failed to delete snapshot nested subvolume: '/run/timeshift/30126/backup/timeshift-btrfs/snapshots/2026-09-24_00-21-43/@'
    E: Failed to remove snapshot: 2026-09-24_00-21-43
    ------------------------------------------------------------------------------
    dacbarbos@dacrpione:~ $ sudo mkdir -p /run/timeshift/test
    dacbarbos@dacrpione:~ $ sudo mount /dev/mmcblk0p2 /run/timeshift/test
    dacbarbos@dacrpione:~ $ sudo btrfs subvolume show /run/timeshift/test/timeshift-btrfs/snapshots/2026-09-24_00-21-43/@
    timeshift-btrfs/snapshots/2026-09-24_00-21-43/@
    	Name: 			@
    	UUID: 			5e075314-500f-f343-8cf2-2dbb18563b21
    	Parent UUID: 		d3a194a1-58d2-ed47-b091-bf1b1acd783c
    	Received UUID: 		-
    	Creation time: 		2026-09-24 00:21:43 +0300
    	Subvolume ID: 		262
    	Generation: 		3419
    	Gen at creation: 	1927
    	Parent ID: 		5
    	Top level ID: 		5
    	Flags: 			-
    	Send transid: 		0
    	Send time: 		2026-09-24 00:21:43 +0300
    	Receive transid: 	0
    	Receive time: 		-
    	Snapshot(s):
    	Quota group:		n/a
    dacbarbos@dacrpione:~ $ sudo btrfs subvolume delete /run/timeshift/test/timeshift-btrfs/snapshots/2026-09-24_00-21-43/@
    Delete subvolume 262 (no-commit): '/run/timeshift/test/timeshift-btrfs/snapshots/2026-09-24_00-21-43/@'
    dacbarbos@dacrpione:~ $ sudo umount /run/timeshift/test
    

    openmediavault-timeshift is primarily a glue plugin. It provides the OMV WebUI wrapper, manages scheduled tasks, and writes /etc/timeshift/timeshift.json.

    dacbarbos@dacrpione:~ $ cat /etc/timeshift/timeshift.json |jq
    {
      "backup_device_uuid": "5a485499-fd39-4195-8a71-1fb7c6f12338",
      "parent_device_uuid": "",
      "do_first_run": "false",
      "btrfs_mode": "true",
      "include_btrfs_home_for_backup": "false",
      "include_btrfs_home_for_restore": "false",
      "stop_cron_emails": "false",
      "schedule_monthly": "true",
      "schedule_weekly": "true",
      "schedule_daily": "true",
      "schedule_hourly": "false",
      "schedule_boot": "false",
      "count_monthly": "6",
      "count_weekly": "3",
      "count_daily": "6",
      "count_hourly": "0",
      "count_boot": "0",
      "snapshot_size": "0",
      "snapshot_count": "0",
      "date_format": "%Y-%m-%d %H:%M:%S",
      "exclude": [
        "/srv/**",
        "/home/**",
        "/root/**"
      ],
      "exclude-apps": []
    }
    dacbarbos@dacrpione:~ $ 
    

    When a snapshot deletion is triggered (either via cron, WebUI, or CLI), the plugin simply invokes the native binary:

    timeshift --delete --snapshot '...'
    

    Because sudo timeshift --delete --snapshot ... failed with EINVAL when run directly in my terminal, it confirms that the failure happens entirely inside timeshift itself when its internal mount logic mounts /dev/mmcblk0p2 at /run/timeshift/<PID>/backup without explicit subvolid=5 flags during snapshot deletion.

    In short:

    • openmediavault-timeshift plugin: Doing its job correctly (passing configuration and parameters to Timeshift).
    • timeshift upstream binary: Failing at the subvolume deletion step due to how its Vala/C++ backend mounts and resolves top-level Btrfs subvolumes on this volume structure.
  2. ygerlach commented on Sep 29, 2026

    @ygerlach
    Contributor

    @orgcontrib i cant follow your reason, why your case is related to this issue. When you later mounted the volume, you also didnt specify the subvolume id.
    What is the entry of that partition in your /etc/fstab ?
    What is your btrfs subvolume get-default ?
    Is it an option for you to change the default subvolume?

  3. orgcontrib commented on Sep 30, 2026

    @orgcontrib

    btrfs subvolume get-default

    dacbarbos@dacrpione:~ $ rg ^UUID= /etc/fstab
    3:UUID=5a485499-fd39-4195-8a71-1fb7c6f12338 / btrfs noatime,compress=zstd,space_cache=v2,subvol=/@ 0 1
    4:UUID=5a485499-fd39-4195-8a71-1fb7c6f12338 /root btrfs noatime,compress=zstd,space_cache=v2,subvol=@root 0 2
    5:UUID=5a485499-fd39-4195-8a71-1fb7c6f12338 /home btrfs noatime,compress=zstd,space_cache=v2,autodefrag,subvol=@home 0 2
    6:UUID=5a485499-fd39-4195-8a71-1fb7c6f12338 /var/cache btrfs noatime,compress=zstd,space_cache=v2,subvol=@cache 0 2
    dacbarbos@dacrpione:~ $ 
    dacbarbos@dacrpione:~ $ sudo btrfs subvolume get-default /
    ID 5 (FS_TREE)
    dacbarbos@dacrpione:~ $ 
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions