How to setup Disk Quotas on macOS Big Sur?

Is there a way to limit a user's disk space usage in macOS Big Sur?

I found this article to setup disk quotas from CNET, but apparently it is not working anymore with Big Sur. There are two problems that I discovered:

  • The root "/" file system cannot be written on (even with sudo).
  • Creating the quota files (.quota.ops.user) within the /System/Volumes/Data directory had no effect in setting up the quota (e.g. running sudo edquota) had no output.

Solution 1:

You would need to install quota-tools from Homebrew and then use that to configure your disk quotas.

Install Homebrew (if you haven't done so already)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then install quota-tools.

brew install quota-tools

Afterwards edit your /etc/fstab to enable disk quotas for the file sytem

/dev/rdisk0 /home apfs defaults,usrquota 0 2

Then run edquota to add disk quotas for the individual users:

sudo edquota -p user1 user2

After that restart the system to have the disk remounted and disk quota to take effect.