User Disk Quota on Monterey (follow up)
I've asked a few month ago (https://discussions.apple.com/thread/253385872) how to have user disk quota in Monterey (and it should work also in Big Sur).
BlueberryLover told me about the APFS volumes trick.
So I tried it, and I wanted to share my findings. I've tried to create both Standard and Admin user, and the type of user doesn't have any influence.
I've tried with my disks encrypted with FileVault 2, and it works.
I have found 2 ways to do it, in an "easy" way:
To move the home directory to the new APFS volume:
- Create a new APFS volume in "Disk Utility", and in the "Size Options" you can say the size that will be placed for Quota. In my case, I've put 100GB. I've named the Volume "Little Green Home".
- The APFS volume is automatically mounted in "/Volumes/Little Green Home"
- Create your user in "System Preferences - Users & Groups", for example:
- Username: littlegreen
- Name: Little Green
- (implicit home directory: /Users/littlegreen)
- Now you have the choice to change the home directory to the new one:
- In "System Preferences - Users & Groups", you change the home directory of the user with "/Volumes/Little Green Home". To change it, you need to "right-click" on the user icon/avatar and select "Advanced Options", and there you can change the "Home directory".
- Use the command line (Terminal) and with the help of "sudo" to copy the complete directory of the user to the new directory, for example:
- cd /Users/littlegreen
- sudo cp -pr . "/Volumes/Little Green Home"
- After the user was logged in, you can remove the original home directory, with "sudo"
- cd /Users
- sudo rm -rf littlegreen
To keep the home directory as /Users/...
- Create a new APFS volume in "Disk Utility", and in the "Size Options" you can say the size that will be placed for Quota. In my case, I've put 100GB. I've named the Volume "Little Green Home".
- The APFS volume is automatically mounted in "/Volumes/Little Green Home"
- Create your user in "System Preferences - Users & Groups", for example:
- Username: littlegreen
- Name: Little Green
- (implicit home directory: /Users/littlegreen)
- Use the command line (Terminal) and with the help of "sudo" to copy the complete directory of the user to the new directory, for example:
- cd /Users/littlegreen
- sudo cp -pr . "/Volumes/Little Green Home"
- cd /Users
- rm -rf littlegreen
- sudo ln -s "/Volumes/Little Green Home" littlegreen
- User can log in
Now, I don't know if the second option really works in the long run, but for my small test it worked.
I would suggest, still, to use the first option, since some apps might not be happy to have a home directory which is a link... I might be wrong, I've haven't seen it during my tests, but who knows!
If you have any ideas, suggestions, improvement or constructive critics, please use that thread to discuss about it! :-)
See ya!