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

Broken system after restore (when /boot is on separate partition) #365

Open
mwoz123 opened this issue Nov 3, 2024 · 2 comments · May be fixed by #381
Open

Broken system after restore (when /boot is on separate partition) #365

mwoz123 opened this issue Nov 3, 2024 · 2 comments · May be fixed by #381

Comments

@mwoz123
Copy link

mwoz123 commented Nov 3, 2024

Describe the bug
I've (luks encrypted) btrfs / + separate /boot (ext4 & efi).
Due to that /boot dir is not inclueded in backups, this means restoring backup will cause also /boot to be skipped.

Let's say I was on Mint 22 (Ubuntu 24) and tried to restore Mint 21 (Ubuntu 22), the system won't be usable due to mismatch in modules on restored system and in linux image (which was unchanged).

To Reproduce
Steps to reproduce the behavior:

  1. On linux that consist of separate /boot partition & root btrfs
  2. create a btrfs backup
  3. upgrade linux image, purge previous one
  4. restore timeshift btrfs backup

Expected behavior
/boot folder to be included/copied to btrfs backup (or other place so it could be restored.

After restore root, timeshift should also restore /boot backup.

Maybe a good idea would be to allow creating "custom script"/hooks to be executed after each backup and another one after each restore (that would allow to copy over the /boot dir) - and might be also usefull for different scenarios.

Screenshots
N/A

System:

  • Linux Distribution Name and Version: Mint 22 (Ubuntu 24)
  • Desktop - issue it's not about UI - no influence
  • Application Version 24.06.3
@mwoz123
Copy link
Author

mwoz123 commented Nov 23, 2024

From what I see there's a place for post restore hooks from /etc/timeshift/restore-hooks.d dir but unfortunetely it's executed only for RSync restore, not for BTRFS :(

I as for this scenario also post backup would be required.

mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 1, 2025
mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 1, 2025
@mwoz123 mwoz123 linked a pull request Jan 2, 2025 that will close this issue
mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 6, 2025
Co-authored-by: Yannis Gerlach <[email protected]>
mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 6, 2025
Co-authored-by: Yannis Gerlach <[email protected]>
mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 6, 2025
mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 6, 2025
mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 6, 2025
mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 6, 2025
mwoz123 added a commit to mwoz123/timeshift that referenced this issue Jan 6, 2025
@mwoz123
Copy link
Author

mwoz123 commented Jan 7, 2025

(In case someone find this usefull)
draft of my setup for /boot on separate partition:

  • /etc/timeshift/backup-hooks.d/backup:
#!/bin/bash
echo $TS_SNAPSHOT_PATH
rsync -avr --progress /boot "${TS_SNAPSHOT_PATH}"/@/ --exclude efi
  • and /etc/timeshift/restore-hooks.d/restore
#!/bin/bash
echo $TS_SNAPSHOT_PATH
rm -Rf /boot~
rsync -avr --progress /boot /boot~ --remove-source-files --exclude efi
BOOT_SOURCE_BACKUP="${TS_SNAPSHOT_PATH}/@/boot"
rsync -avr --progress $BOOT_SOURCE_BACKUP / --exclude efi 

requires (not merged yet) changes from: #381

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

Successfully merging a pull request may close this issue.

1 participant