-
Notifications
You must be signed in to change notification settings - Fork 4
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
Does this tool support online rollback? #37
Comments
Yes, online rollback is supported. The You will need to review the script and run it manually (or type in the commands one by one). It can be run from the system mounted on the root which you want to roll back. After you run the script, the system will continue to function with the current snapshot until you reboot, upon which the rollback will take effect. For rollback to work correctly, root should be mounted (in fstab) with |
Also fyi, here's an example of rollback script it generates. This should clarify exactly how the rollback process works. Command - $ yabsnap rollback-gen 20240728183030 Output - #!/bin/bash
# Save this to a script, review and run as root to perform the rollback.
set -uexo pipefail
mkdir -p /run/mount/_yabsnap_internal_0
mount /dev/mapper/luksdev /run/mount/_yabsnap_internal_0 -o subvolid=5
cd /run/mount/_yabsnap_internal_0
mv @home @.snapshots/rollback_20240728192848_@home
btrfs subvolume snapshot /.snapshots/@home-20240728183030 @home
mv @ @.snapshots/rollback_20240728192848_@
btrfs subvolume snapshot /.snapshots/@root-20240728183030 @
echo Please reboot to complete the rollback.
echo
echo After reboot you may delete -
echo "# sudo btrfs subvolume delete /.snapshots/rollback_20240728192848_@home"
echo "# sudo btrfs subvolume delete /.snapshots/rollback_20240728192848_@" |
Thanks. Please consider letting the user do rollbacks without saving the script as this is quite cumbersome. After all the operation is reversible, maybe just inform the user of the changes after they're done and allow them to undo it if they want. |
Perhaps we should add a It can print the script, confirm with the user, then run it. Initial reason for not doing this was safety, but I think the code has matured enough (and tested enough times) for this to makes sense. Optionally, |
See hirak99#37 and hirak99#6 (comment) Tests - - Added test cases for rollbacker.py Refactor - - Split the rollbacker.rollback() function Style - - Formatted main.py, os_utils.py, rollbacker.py, and rollbacker_test.py using isort and black - `isort --python-version 310 --profile google --line-length 80 --src-path "src/code"` - `black --line-length 80 --target-version py310 --target-version py311 --target-version py312`
See hirak99#37 and hirak99#6 (comment) for details Tests - - Added test cases for rollbacker.py Refactor - - Split the rollbacker.rollback() function Style - - Formatted main.py, os_utils.py, rollbacker.py, and rollbacker_test.py using isort and black - `isort --python-version 310 --profile google --line-length 80 --src-path "src/code"` - `black --line-length 80 --target-version py310 --target-version py311 --target-version py312`
See hirak99#37 and hirak99#6 (comment) for details Tests - - Added test cases for rollbacker.py Refactor - - Split the rollbacker.rollback() function Style - - Formatted main.py, os_utils.py, rollbacker.py, and rollbacker_test.py using isort and black - `isort --python-version 310 --profile google --line-length 80 --src-path "src/code"` - `black --line-length 80 --target-version py310 --target-version py311 --target-version py312`
See hirak99#37 and hirak99#6 (comment) for details Tests - - Added test cases for rollbacker.py Refactor - - Split the rollbacker.rollback() function Style - - Formatted main.py, os_utils.py, rollbacker.py, and rollbacker_test.py using isort and black - `isort --python-version 310 --profile google --line-length 80 --src-path "src/code"` - `black --line-length 80 --target-version py310 --target-version py311 --target-version py312`
Also added some additional changes such as documentation. - Reformatted a few files. - batch_deleter: Removed interactive_confirm (it's already in os_utils). - os_utils.interactive_confirm: Moved [Y/n] prompt there. - rollback.py - Reorganized rollback() and some functions. - Removed some trivial functions. - Using a temporary directory to save script to prevent any collusion. - Honor the dry-run flag, and do not actually execute if it is set. - Added few tests. - Updated README.md and manpage. Related to #37, #44, #45.
The Thanks to @Tql-ws1 for help with this and more! |
Not clear from the documentation and I don't have an arch btrfs system to test. Would you be able to rollback the mounted root subvolume in place? Also, if I were booted into a snapshot, the rollback script would rollback the root subvolume, correct?
The text was updated successfully, but these errors were encountered: