Disk Quotas

Date August 11, 2008

Strangely enough, for someone who complains so much about storage space, I’ve never setup disk quotas in Linux.

I guess it’s because I’ve never had a large installed user base in Linux, and didn’t feel the need to provide hard limits for the users. I would occasionally run “du -h -s *” in the volume root and send a reminder to people with unnecessarily large directories, but never any mandatory requirement.

I believe that’s going to change. I’ve been thinking about it, and since our space is finite, there’s no reason that the user home directories should be allowed to inexorably fill up the entire partition. To make sure it doesn’t happen, I’ll use disk quotas.

Nikesh Jauhari over at Linux Poison wrote a quick little introduction to disk quotas in Linux. It’s about the simplest explanation I’ve seen, and I like simple. For the Windows reliant, Microsoft published an article entitled Managing Disk Quotas in Windows Server 2003 and Windows XP, which should cover most of the installs out there.

Anyone else been looking at this for a while? And while I’m asking, how much storage is enough storage for your users?



9 Responses to “Disk Quotas”

  1. Ben C said:

    At my U, everyone gets a whopping 500 MB of storage. Of course, that doesn’t really work very well when you’re dealing with model data files of 1 GB or more, so my department set up a file server. We vary the quota based on role (faculty, staff, student, etc) but we don’t put a hard enforcement on it. Instead, I hacked together a Perl script that runs once a week and checks to see if the user is over quota. An e-mail gets sent if they are, and I also get a full status report when the job completes, which gives me a list of each directory and usage, as well as the disk utilization.

    Depending on how many users you have (and how much wiggle room you have on your disks), you might find hard quotas to be a bit of a pain. Nearly half of the Linux support tickets I get are fixed by reducing quota usage — especially login problems and Open Office errors.

  2. Matt said:

    @ben

    That’s interesting. I’d be nervous about that in this instance, just because the entire partition isn’t dedicated to the user directories. I think that might be the sticking point. Ideally I should make the home directories their own partition, but I’ve got them on a /mnt/data that also has some general storage stuff on it.

    I’ll have to reconsider how I’m doing it, I suspect.

    Do you ever have issues with users blitzing you with huge runs on diskspace in short amounts of time?

  3. Ryan Nedeff said:

    We don’t do disc space limits on file storage. Everyone in the company gets a “personal drive,” which is just a drive mapping to a personal folder on the file server.

    However, we do limit mail box sizes. Alloted size depends on job title, IE: CE_, VP, RVP, Director, Manger, “everyone else” and ranges from 150mb to 500mb, IIRC. All mail over 90 days old is deleted from the server, allthough it does get stored off the server for a longer period of time, depending on government regulations and such, in the case of a legal situation.

  4. Matt said:

    If ONLY I could put a 500MB limit on email. I wish. Lots of my users still receive files with client data over email, and I can’t dictate how long they can keep their email, which leads to something like this:

    # ls -d Accounts/* | wc -l
    27

    # du -hs Accounts/
    46G Accounts/

    That’s just email.

    /sigh

  5. Michael Janke said:

    I set up a quota system on Netware servers a long time ago.

    Each directory at the root level had a hard quota smaller than the volume, with some overlap in cases where there was more than one directory at the root of the volume. That quota existed only to prevent userland from filling the volume and making a mess out of the volume.

    Then we still had normal per users/per volume quotas, but we were fairly liberal about the quotas.

    –Mike

  6. Matt said:

    @Michael

    That’s a cool concept. Locking down the partition before the users can thrash it.

    I’ve got nagios alerts triggering at 90% (typically) with a warning, but it would be nice to not worry about the emergency run-n-dump when the partition fills up

  7. Michael Janke said:

    One more trick from an old timer.

    (I actually presented this at a tech conference once – got the slides somewhere).

    Never allocate all your disk. Keep a fraction (10-20%) unallocated. When disk grows unexpectedly & creates a crisis, do the following:

    (1) Go to your boss with an emergency request for $10k to add on to the disk pool. A blank PO is best, you never know where you'll have to go to find lots of disk on short notice.

    (2) After you get the money, extend your disk into the unallocated space and resolve the crisis.

    (3) Take the money & buy a big monitor and a cool new laptop.

    ;)

    Of course I'm the boss now so that won't work in my shop.

    –Mike

  8. Kenny said:

    When I monitored the mail server at my old job, all I did was modify a pearl script that showed the size of home directories to give me the size of people’s mail directories. I think the quota for people was something like 50MB, and I had someone who would get 300MB in less than a day.

  9. David said:

    This is an old post, but whatever. This is what you get when someone goes through your archives. :)

    What we traditionally do is apply a quota, but make it absurdly high — back in the day of 500GB filers, everyone had a 32GB quota. Why? Because quotas are updated in near-time, so you can see who is filling up disk space by just running a repquota -a (or equivalent) and you get a fast summary of who’s using what. Wait five minutes, then do it again, and compare the results.

    This falls down in a development environment, where people can write to their home directories as other people — one company I have lets root on development nodes write to home directories, which means that “nobody” (or “nobody4″) owns a lot of files that we can’t see that way, so your milage may vary…

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Easy AdSense by Unreal

Switch to our mobile site