Add Read-Only Btrfs Snapshots Option (issue #332)#373
Add Read-Only Btrfs Snapshots Option (issue #332)#373CloverGit wants to merge 2 commits intolinuxmint:masterfrom
Conversation
|
Do we need a warning if someone tries to use |
|
The shell argument description already clarifies that this feature is specifically for
Btrfs, and I believe that users familiar with rsync will understand that
it doesn't have a "read-only" concept. However, if necessary, perhaps
consider changing the argument name to '--btrfs-readonly'?
|
|
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 |
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). |
|
One can always change the "read-only-nes" of a snapshot by either
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.
commit 797d8c2 makes it an option in the settings. |
|
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; |
There was a problem hiding this comment.
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
|
Thanks for the info. It sounds like read-only should just be the norm. Is there any argument to let a user see this state or modify it in timeshift? Btrfs-assistant seems a bit power-user-oriented, and timeshift is more about simple backups and restores. It doesn't need to become a btrfs management tool (also, it looks like btrfs-assistant is becoming available on more distributions, including Mint). |
Since Timeshift is aimed at ease of use, I see no reason to expose this detail to the user. What a typical Timeshift user does is simply create and restore snapshots. For the user, this change would have zero impact, while internally it would make snapshots safer. |
|
So, it seems like we can update this PR to make snapshots RO but there's no need to advertise or even make it an option is there? It just boils down to adding a |
|
There at least needs to be an option for new snapshots to be created read-write (i.e. even if individual snapshots cannot be modified), so that "grub-btrfs" can be used, otherwise it will prevent the ability to boot into a snapshot. |
Yes, that’s how it was supposed to work from the beginning. For those using tools like “grub-btrfs” and similar applications to restore snapshots from GRUB, this can still be handled by switching the snapshots back to read-write (RW).
|
I don't see how that would work. The whole point of grub-btrfs is you can choose to boot a snapshot at boot time (e.g. if the OS fails to boot), while the commands suggested need you to have already booted (never mind working out which snapshot number corresponds to which snapshot). What's the problem with adding a little tick box in the GUI to choose whether or not the user wants read-writeable snapshots to be created? |
openSUSE does exactly this: it boots into a read-only snapshot selected from GRUB, starts the session, and then you decide whether to restore it as the default if it matches your expectations. However, I don’t think this is feasible on a system that isn’t designed around that layout. Thinking about it, you need a separate subvolume for the entire /var, and with Debian-based distributions this isn’t really possible, because the package manager databases are located under /var, specifically /var/lib/dpkg and /var/lib/apt/. openSUSE and Fedora have addressed this by moving those databases into /usr.
That said, I’m not against adding an option for this. Ultimately, it’s up to the maintainers to decide. |


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