Skip to content

Conversation

@CloverGit
Copy link

Adds an option to create read-only Btrfs snapshots by default. Resolves #332

@ygerlach
Copy link
Contributor

ygerlach commented Dec 7, 2024

Do we need a warning if someone tries to use --readonly in an rsync setup?

@CloverGit
Copy link
Author

CloverGit commented Dec 8, 2024 via email

@clefebvre clefebvre changed the title Add Read-Only Btrfs Snapshots Option (issue #332) [Next] Add Read-Only Btrfs Snapshots Option (issue #332) Dec 19, 2024
@clefebvre clefebvre changed the title [Next] Add Read-Only Btrfs Snapshots Option (issue #332) Add Read-Only Btrfs Snapshots Option (issue #332) Feb 24, 2025
@cshandley-uk
Copy link

Please do NOT make snapshots read-only, as this will basically break "grub-btrfs", and prevent the ability to boot into a snapshot. Or if you DO make them read-only, then there should be a separate set of snapshots that are read-write, but I think that would be over-complicating things. At best make this change optional please.

@agusdmb
Copy link

agusdmb commented May 13, 2025

Please do NOT make snapshots read-only, as this will basically break "grub-btrfs", and prevent the ability to boot into a snapshot. Or if you DO make them read-only, then there should be a separate set of snapshots that are read-write, but I think that would be over-complicating things. At best make this change optional please.

i think having it optional would be ideal

@CloverGit
Copy link
Author

Please do NOT make snapshots read-only, as this will basically break "grub-btrfs", and prevent the ability to boot into a snapshot. Or if you DO make them read-only, then there should be a separate set of snapshots that are read-write, but I think that would be over-complicating things. At best make this change optional please.

I agree with making it optional, but I still recommend keeping read-only as the default behavior, a "writable snapshot" contradicts the design purpose of snapshot (frozen disk state).
For read-only snapshots, you should use grub-btrfs-overlayfs instead of grub-btrfs.

@ygerlach
Copy link
Contributor

ygerlach commented May 18, 2025

One can always change the "read-only-nes" of a snapshot by either

  • creating a new writeable snapshot of the given read-only snapshot (btrfs subvolume snapshot /path/to/snapshot /path/to/snapshot_rw
    or
  • actually changing the flag btrfs property set -ts /path/to/snapshot ro false

I think having an option to set the value for all new snapshots (default to ro) and having the option to toggle a snapshot with the context menu would be the best option for everybody.
Users often booting into snapshots can set the default to be writable and other users are protected against accidentally destroying their snapshots, but still have the option to edit a snapshot for what ever reason they may need.

At best make this change optional please.

commit 797d8c2 makes it an option in the settings.

@mtwebster
Copy link
Member

I'd prefer it keep the current behavior by default, or else there should be a way in the ui to change it (context menu), and something other than the comment field indicating that it's read-only (Maybe an additional tag?)

public void refresh(){

opt_btrfs.active = App.btrfs_mode;
opt_btrfs_readonly.active = App.btrfs_readonly;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be guarded by if (opt_btrfs.active) {} or else it throws a runtime warning. What I'd prefer is to always add the widget, but mark it insensitive (grey it out) - like we already do for the btrfs radio button:
https://github.com/linuxmint/timeshift/pull/373/files#diff-4a9255872e366bab354c5ddc6d435d03d84ae8b736856a284092dc137ff21257R101-R104

@mtwebster mtwebster changed the title Add Read-Only Btrfs Snapshots Option (issue #332) [next] Add Read-Only Btrfs Snapshots Option (issue #332) Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Btrfs Snapshots should be readonly

5 participants