Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

maclover001

macrumors 6502a
Original poster
Mar 25, 2008
895
0
Vancouver, Canada
I'm giving someone space on my Leopard web server (Via WebDAV), and I don't want them filling my hard drive with their life story. How can I cap the DAV folder at a gigabyte?

Thanks
 
http://www.macosxhints.com/article.php?story=20090202064037457&query=quota

OS X has long supported disk quotas to limit how much drive space each user is allowed. Way back in 2003, we ran this hint which explained how to set up and use disk quotas. Back then, the process seemed a bit scary to me, given the complexity of some of the Terminal commands.

Fast-forward five years, though, and things have gotten much simpler. While reading some messages on a mailing list, I found a pointer to Eric Crist's write-up on HFS+ disk quotas, which makes things look much simpler. While working through the instructions, though, I had an issue early on -- the repquota command listed in the third step failed to run. I managed to get it working by taking one command from our prior hint; below is an executive summary version of Eric's instructions, with my fix to get repquota working:

1. Create a root shell session in Terminal with sudo -s, providing your admin password when asked.
2. Create an empty quota options file with touch /.quota.ops.user.
3. Run quotacheck -a to generate a list of drive space used by user. This is the step I had to add.
4. Run repquota -a to list the drive space used by each user. The previous command creates the list, and this command displays it. I don't know why this command alone didn't work on my system, but it didn't.
5. Enable quotas by typing quotaon /. (You can turn them off again with quotaoff /.)
6. Set quota limits for a given use by typing edquota -u username. This will put you in a vi editing session, where you can set both hard (cannot be exceeded) and soft (can be exceeded for a certain period of time) limits on drive space and inodes (files).

Eric's writeup goes into greater detail, including an explanation on how to change the default one week grace period on soft limits.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.