Skip to content
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

Feature Request: Allow multiple POST snapshots w.r.t. an existing PRE snapshot #764

Open
pinysuse opened this issue Jan 4, 2023 · 2 comments

Comments

@pinysuse
Copy link

pinysuse commented Jan 4, 2023

Issue

In case there is an existing pre - post snapshot pair, the attempt to create another, later post snapshot w.r.t. the same pre fails

Example

cat /.snapshots/116/info.xml
    [...]
      <type>pre</type>
      <num>116</num>
    [...]

this is our intended pre

cat /.snapshots/117/info.xml
    [...]
      <type>post</type>
      <num>117</num>
      <date>2023-01-04 11:34:35</date>
      <pre_num>116</pre_num>
    [...]

this is our existing post we want to replace with another later snapshot.
(we do not care at the moment whether we want to keep it still or can dispose of it...)

snapper create --type post --pre-number 116 --description "another post snapshot"
    Illegal snapshot.

Requested Feature

Allow more than one post snapshot.

In case of implications: Allow deletion of an existing post snapshot and creation of a new one

In the snapper GUI there could be new button Additional post snapshot next to the Modify button.
As second choice would be a new button Replace post snapshot.

Manual Work Around

Inspired by #24

btrfs subvolume delete /.snapshots/117/snapshot
    Delete subvolume (no-commit): '/.snapshots/117/snapshot'
rm -r /.snapshots/117
snapper create --type post --pre-number 116 --description "another post snapshot"
snapper list | tail -2  

    116  | pre    |       | Wed Jan  4 12:30:01 2023 | root |  96.00 KiB | number  | yast snapper                                   |              
    117  | post   |   116 | Wed Jan  4 13:52:22 2023 | root |  96.00 KiB |         | another post snapshot                    |              

(by chance again number 117 - could be any other higher increment due to intermediate (timeline) snapshots)
snapper diff 116..117

..works as intended

@aschnell
Copy link
Member

aschnell commented Jan 4, 2023

It is a 1:1 mapping between pre- and post-snapshots. I do not like to change that. How should the empty-pre-post cleanup and the list with --type=pre-post work in that case? Likely there are more problems.

What could maybe be done is a new option to remove the pre number from the old post-snapshot.

@pinysuse
Copy link
Author

pinysuse commented Jan 5, 2023

I understand that snapper

  • under the hood makes use of the btrfs tool set and other tools like, maybe, diff
  • adds snapper specific information in the files /.snapshots/NN/info.xml

So, would it be possible to have the snapper GUI* provide diffs between arbitrary /.snapshots/NNs?

In such case the pre and post tags are still a very helpful feature to document explicit snaphot-protected activities - but basically nothing special for the diff mechanism?

  • snapper CLI does it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants