Skip to content

Add Read-Only Btrfs Snapshots Option (issue #332) #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

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
4 participants