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
Auto cleanup old snapshots on lack of free space #50
Comments
Yes, I know this is a problem. My idea is to use btrfs qgroups (quota groups) for this. With those is should be possible to e.g. query to space used by a set of snapshots. Unfortunately qgroups are not mature yet. Simply watching the free space of the whole filesystem does not work when there are several subvolumes where snapper creates snapshots. E.g. if you have /home/linux and /home/tux you cannot decide whether linux or tux is using the space and you might delete the snapshots of the wrong user. |
Because free space is shared between all users, removing older snapshot from any user will be good solution for all - this is better that get zero free space. If users don't want to share removing of snapshots, they can use separate btrfs subvolume for each user, and limit total maximum space for each user. |
But removing snapshots of one user if unfair if that user does not occupies less space that other users. Without qgroups that problem cannot be solved and qgroups are not mature yet. |
What's the situation 8 months later from the last comment @aschnell ? |
Unfortunately qgroups are still not mature for the usecase. About two month ago I was told that level 0 qgroups are working but level 1 qgroups are not. Level 1 groups are needed. |
aschnell, can you give me the link with qgroups description? What is difference in level 0 and level 1?
|
And suggestion for auto cleanup interface. At now KDE Wastebin have good configuration for auto cleanup on lack free space: http://i.imgur.com/nqS02Dy.png |
Btrfs quota group documentation is available at http://sensille.com/qgroups.pdf. |
I have now implemented space aware cleanup using btrfs qgroups, see http://snapper.io/2016/05/18/space-aware-cleanup.html. |
Snapshots is good, but when free space is going down, users don't have easy ways to free-up space.
They can delete some files, but free space will not increased, and they will be very confused, because they don't know anything about snapshots and how to cleanup them, which snapshot must be deleted for free-up space.
For solve this problem will be good add cron job that checks current free space, and when free space is less than custom limit, do remove older snapshots.
The best way will be detect lacking free space in realtime and report to user ways for free-up space, but I don't know how to do this, so at first cron check will be good.
What do you think about described problem and my solution?
Maybe you have other ideas how we can solve this problem better?
The text was updated successfully, but these errors were encountered: