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

Allow setting ref/user/group/ quotas on datasets lower than used space #16495

Open
manfromafar opened this issue Sep 1, 2024 · 0 comments
Open
Labels
Type: Feature Feature request or new feature

Comments

@manfromafar
Copy link
Contributor

Describe the feature would like to see added to OpenZFS

Allow settings quotas on datasets too a lower value then used space.
Enabling users to only delete files until they are below the quota.

zfs's quota system works well if your doing brand new datasets or the usage is below the quota level you want to set, but problems arise when migrating data or retroactively applying quotas to a system.

In this case you are unable to set a quota to the desired level since zfs can't set a quota to be lower then the used space.

An example of this would be migration of a user home file server over to zfs. Where in the previous deployment users had no quotas and filled up their home directories. When the server is migrated over to zfs a new quota would be enforced. The problem is that users with more space get larger quotas since you can't specify something lower.

Example:
You have 3 users A,B,C
On the old system the users had the following usages:
A = 5GB
B = 50GB
C = 0GB

For the new home directories users are given a max of 5GB of space.
When the users are migrated over to zfs
users A and C would get 5GB of quota but user B would be given 50GB because they exceed the quota and can't have a smaller quota without removing files.

Users quotas would look like:
A = 5GB quota
B = 50GB quota
C = 5GB quota

Ideally what would happen is that you would copy over all data then set the quota's as before to the 5GB and any users over that would only have able to delete files until they are below their quota.
With being able to undersize quotas you would end up with
A = 5GB usage with 5GB quota (no change)
B = 50GB usage with 5GB quota ( can only delete until below quota)
C = 0GB usage with 5GB quota (no change)

How will this feature improve OpenZFS?

This would allow easier management of quotas when migrating or retroactively applying quotas to a system without making special cases.

Additional context

I nice to have with this would be to expand out quotas to also have a soft quota that could send a zfs event for when users exceed their soft quota but doesn't stop them from writing data unless they hit the normal (hard) quota

@manfromafar manfromafar added the Type: Feature Feature request or new feature label Sep 1, 2024
@manfromafar manfromafar changed the title Allow setting ref/user/group/quotas on datasets lower than used space Allow setting ref/user/group/ quotas on datasets lower than used space Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Feature request or new feature
Projects
None yet
Development

No branches or pull requests

1 participant