Email user and quota problem

9 posts / 0 new
Last post
#1 Fri, 03/20/2009 - 15:49
mdtiberi

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

Sat, 03/21/2009 - 00:27
Joe
Joe's picture

<div class='quote'>How is this calculated?</div>

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.

--

Check out the forum guidelines!

Sat, 03/21/2009 - 07:25
mdtiberi

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?

Sat, 03/21/2009 - 09:06
mdtiberi

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.

Sat, 03/21/2009 - 12:40 (Reply to #4)
Joe
Joe's picture

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 &quot;clean up the old deleted users crud&quot; 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 &quot;root&quot;? That's a huge no-no, and will break all sorts of things (and makes no sense, as &quot;root&quot; has access to everything already...). &quot;root&quot; (UID 0) probably would own about 7000 files, and they'd probably add up to about 1.6GB.

--

Check out the forum guidelines!

Sat, 03/21/2009 - 13:24
mdtiberi

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

Sat, 03/21/2009 - 18:28
mdtiberi

<div class='quote'>The issue is that you deleted a user without deleting the users files</div>

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

Sun, 03/22/2009 - 21:24 (Reply to #7)
Joe
Joe's picture

<div class='quote'>I expect Virtualmin to do this when a user is deleted. </div>

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.

--

Check out the forum guidelines!

Sun, 03/22/2009 - 21:27 (Reply to #8)
Joe
Joe's picture

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. ;-)

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 <i>long</i> 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?

--

Check out the forum guidelines!

Topic locked