3

I want to set disk quota (limit maximum space used in the file system) that a particular process can use under Linux. There seems to be plenty ways to limit disk quota for a user, but not at a per process granularity. One way I can think about is creating a user for each process but as you can imagine that is not a great solution.

2

Handling it with different user accounts may well be the only possible way since processes do not own any files and can therefore not have a disk quota.

To make it even clearer, at the very best you could manage a quota for the files currently used, should you develop such a kernel patch, but it would still lose its sense to track the files that were written previously and got closed as they are not under its responsibility at all.

Doing such a flawed patch would also result in considerable performance degradation and wouldn't make sense in situations where more than one program opens the same file.

For those and many other reasons, it theoretically simply can not be done properly.

  • Is cgroup able to do what I have mentioned? When I search "cgroup disk quota" I saw a few related patches. No idea whether they are merged. I am not familiar with cgroup. – Chi Zhang Jul 2 '16 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.