Email user and quota problem

So I created a new email user and selected unlimited Home Directory Quota. Realizing this was a mistake I went back to set a modest limit and saw that over 1.6GB was being used by this new user and over 7,000 files! I thought I would just delete and start over but no way. I set the limit and it was right back to where it was when I first created the user. This doesn’t seem right, what am I missing?

How is this calculated?<br><br>Post edited by: mdtiberi, at: 2009/03/20 16:03

How is this calculated?

Quotas are system disk quotas. Virtualmin isn’t doing any calculating (well, technically, it could be, if databases are involved).

My guess is you have some temp files or some old files from a user that was deleted, and the new user got the same UID. Just a thought. Obviously a new user wouldn’t have 1.6GB of files.

Can I just change this users UID manually? It seems that one particular UID is the problem. If I add additional users there is no problem. Also where would these temp file be located? Can I just delete them?

I have confirmed that it is one particular UID that is the problem. Had to create a dummy user for that UID, add the others then delete it to ignore the problem UID. There must be a better way.

You’re coming at it from the wrong angle. The UID isn’t the problem…it’s just a number.

The issue is that you deleted a user without deleting the users files. You don’t want unknown files strewn about your system that belong to an old user (because they’ll be readable by any new user that has that ID). So, use find to figure out where and what those files are, and get rid of them:

find / -uid $UID

Where $UID should be the actual user ID in question. It could also be the GID. Quotas can apply to both users and groups.

The other option would be to put a user with no login on that UID and just never use it. This would simply leave the mess of files laying around, but they would probably be safe from prying eyes, and the UID would never be re-used as long as the user still exists.

Oh, and a third option (still on the theme of coming at it from the UID angle rather than the "clean up the old deleted users crud" angle) would be to configure the Users and Groups module to create users starting with a higher UID and GID.

Oh, wait a minute…something just hit me. Did you, by chance, set the owner of this virtual server to “root”? That’s a huge no-no, and will break all sorts of things (and makes no sense, as “root” has access to everything already…). “root” (UID 0) probably would own about 7000 files, and they’d probably add up to about 1.6GB.

The domains are not owned by root. I just created them with the default settings from virtual min. The files are owned by themselves (domain name = group and owner name) and user in the group is apache.

I did the find UID command as you suggested and the strange thing was that the UID that keeps getting messed up is somehow cross-linked to my shared Samba directory and all of its files. That’s where the 7000 files are coming from. There’s no conflict I can see with UID GID using the same.

Thanks again for your help

The issue is that you deleted a user without deleting the users files

I expect Virtualmin to do this when a user is deleted.

I expect Virtualmin to do this when a user is deleted.

That’s a reasonable expectation…it does. (Though you can tell it not to in some circumstances.)

If it didn’t do so, and didn’t give you a good reason in an error message, then it would be a bug.

But you definitely wouldn’t want Virtualmin to delete files in a random location…like your Samba shared directory. So, that’s not actually a bug at all. That’s Virtualmin being nice. :wink:

That’d be a misconfiguration of Samba, if it’s using a user that you didn’t expect to write files. It’s been a long time since I’ve setup or used Samba, but I’m guessing there’s some sort of issue where it is mixing up UIDs. Maybe it’s authenticating via some other system that has UIDs that are different than the box it runs on?