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

add on hold snapshot feature #29

Open
kapitainsky opened this issue Apr 25, 2023 · 4 comments
Open

add on hold snapshot feature #29

kapitainsky opened this issue Apr 25, 2023 · 4 comments

Comments

@kapitainsky
Copy link
Contributor

kapitainsky commented Apr 25, 2023

First - great simple script. Exactly what I was looking for.

At the moment finding common snapshots to protect them during pruning depends on both source and target datasets being present which does not have to be always the case and creates risk that pruning will delete last sent snapshot.

It would be great to add "hold" feature:

https://www.thegeekdiary.com/understanding-holding-a-zfs-snapshot-feature/

This way snapshot would be safe.

After successful sent hold can be removed and new snapshot marked as hold.

@kapitainsky
Copy link
Contributor Author

kapitainsky commented Apr 25, 2023

tested it by replicating to pool on external disk

when external destination disk/pool is not present and I run ./zfsbud.sh --remove-old on source it can delete last common snapshot

and subsequent attempt to sync results with:

WARNING: No common snapshot found between source and destination. Add the --initial|-i flag to clone the snapshots to the destination.

The "hold" would prevent it.

@kapitainsky
Copy link
Contributor Author

ok I really need it:) so PR will follow soon

kapitainsky added a commit to kapitainsky/zfsbud that referenced this issue Apr 25, 2023
Without holding snapshots when destination dataset is missing (example can be external disk) script can accidentally delete last common snapshot - as can not compare source and destination.

The solution is to hold common snapshots using "zfs hold keep":

https://www.thegeekdiary.com/understanding-holding-a-zfs-snapshot-feature/
@gbytedev
Copy link
Owner

gbytedev commented Jun 4, 2023

@kapitainsky I missed this issue; sorry for keeping you waiting. This is very interesting and I'm happy to test and merge this if you are still inclined to create a PR. Same with other sensible changes you have made to your fork. 👍

@kapitainsky
Copy link
Contributor Author

Thx. I think PR is in waiting:) I am happy if you have any comments. I have been using my modified version and it works perfectly

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

No branches or pull requests

2 participants