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

fix: remove default snapper config and incorrect snapshots #1939

Merged
merged 7 commits into from
Dec 6, 2024

Conversation

antheas
Copy link
Contributor

@antheas antheas commented Dec 1, 2024

Something lead to snapper turning on on its own and making snapshots forever. Revert the niceties that can still be added via ujust (and were broken) and remove the incorrect snapshots that might have been created.

@antheas antheas marked this pull request as ready for review December 1, 2024 19:39
@antheas antheas requested a review from HikariKnight as a code owner December 1, 2024 19:39
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Dec 1, 2024
@HikariKnight
Copy link
Member

I still think fixing the config using snapper set-config key=value and then running the snapper-cleanup service to cleanup the invalid snapshots would be enough.
we already confirmed the service is somehow enabled by itself but is off by default.
we can just update the bazzite-snapper-setup to force set the config values after making the config

@antheas
Copy link
Contributor Author

antheas commented Dec 1, 2024

It would create too much drift with previous images

This PR fixes the problem cleanly and removes previous drift

More than 95% of users do not need snapper. And for the other 5% messing with their config is not acceptable

@HikariKnight
Copy link
Member

we are talking about a config where the timers somehow got enabled and 10 years worth of snapshots are being kept, thats not really a sane snapper setup in general unless we are talking about some serious data hoarding in /var/home

@Zeglius
Copy link
Contributor

Zeglius commented Dec 1, 2024

This workaround is too intrusive, it will wipe out all snapshots, potentially including user made ones.
Plus using the bazzite-hardware script to do that would wipe every snapshot each time it gets updated

@antheas
Copy link
Contributor Author

antheas commented Dec 1, 2024

We only get one shot to detect the invalid config. If we start making changes we cannot detect it anymore

Deck images must not use snapper at all. It is broken functionality as it will fill up their storage when deleting games. And desktop images in their majority should not. Even if the config is set for a day, this is too long

This workaround is too intrusive, it will wipe out any snapshot the user made. Plus using the bazzite-hardware script to do that would wipe every snapshot each time it gets updated

It only deletes timeline snapshots and only runs if the invalid config is detected. We can also touch a file to force it to run once.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 1, 2024
@HikariKnight
Copy link
Member

It only deletes timeline snapshots

snapper cleanup timeline && snapper cleanup number
this will cleanup all automatic snapshots that fall outside of the numbers range and the timeline ranges in the config (which we can set to 0 on deck images)

manual ones are kept

@Zeglius
Copy link
Contributor

Zeglius commented Dec 1, 2024

Alright so only timeline snapshots. Fair.

Though this would be better off by not doing it in the hardware setup script, that doesn't do any favors.
Maybe in an oneshot Systemd service that disables itself, not before executing the cleanup script, and maybe only on deck images(?)

@antheas
Copy link
Contributor Author

antheas commented Dec 1, 2024

Alright so only timeline snapshots. Fair.

Though this would be better off by not doing it in the hardware setup script, that doesn't make any favors. Maybe in an oneshot Systemd service that disables itself, not before executing the cleanup script, and maybe only on deck images(?)

Thats what the hardware setup script is for. Random oupsies. We cannot add new services every time there is a mistake.

@Zeglius
Copy link
Contributor

Zeglius commented Dec 1, 2024

Fair. There is also the part of nuking the configuration. Maybe instead of completely removing it, setting more sane defaults would alive the issue instead of leaving btrfs-assistant unusable

@antheas
Copy link
Contributor Author

antheas commented Dec 1, 2024

It only deletes timeline snapshots

snapper cleanup timeline && snapper cleanup number this will cleanup all automatic snapshots that fall outside of the numbers range and the timeline ranges in the config (which we can set to 0 on deck images)

manual ones are kept

Would break users that want to actually use snapper. The only clean condition for cleaning snapshots is if the invalid config exists, because no sane user would set it up that way. After that, it should never run again or mess with the config

@antheas
Copy link
Contributor Author

antheas commented Dec 1, 2024

Fair. There is also the part of nuking the configuration. Maybe instead of completely removing it, setting more sane defaults would alive the issue instead of leaving btrfs-assistant unusable

Opening btrfs-assistant allows you to make a config with one click and enable the services as well.

@HikariKnight
Copy link
Member

Opening btrfs-assistant allows you to make a config with one click and enable the services as well.

that config will be for / since it will not let you make one for /var/home without one for / in the gui last time i tested IIRC

@Zeglius
Copy link
Contributor

Zeglius commented Dec 1, 2024

Fair. There is also the part of nuking the configuration. Maybe instead of completely removing it, setting more sane defaults would alive the issue instead of leaving btrfs-assistant unusable

Opening btrfs-assistant allows you to make a config with one click and enable the services as well.

Alright fair. Bit nuclear of an option. Not that mine is any better by reducing the timeline duration to like 10 days or so(?), so not against it.

Pls add a FIXME: or whatever so we can remember to remove this after these builds with the old config disappear 🙏

@antheas
Copy link
Contributor Author

antheas commented Dec 1, 2024

Opening btrfs-assistant allows you to make a config with one click and enable the services as well.

that config will be for / since it will not let you make one for /var/home without one for / in the gui last time i tested IIRC

Seems to allow me to create /var/homw with no config

@HikariKnight
Copy link
Member

Opening btrfs-assistant allows you to make a config with one click and enable the services as well.

that config will be for / since it will not let you make one for /var/home without one for / in the gui last time i tested IIRC

Seems to allow me to create /var/homw with no config

well im fine with this and then later add a proper config since we found out the config in the repo was not used.
instead later i will just make it create a config and use the snapper command to set the values to 0 for deck and use the default values of the original PR for desktop instead of changing the default template since that clearly is not respected on the end image.

@HikariKnight HikariKnight changed the title fix: remove btrfs assistant and incorrect snapshots fix: remove default snapper config and incorrect snapshots Dec 6, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 6, 2024
@KyleGospo KyleGospo added this pull request to the merge queue Dec 6, 2024
Merged via the queue into ublue-os:testing with commit 651c5bd Dec 6, 2024
20 checks passed
HikariKnight added a commit that referenced this pull request Dec 9, 2024
feat: Move default snapper config into ujust as followup to #1939
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants