Operating System - HP-UX
1820227 Members
3494 Online
109620 Solutions
New Discussion юеВ

Limiting home directory size

 
mvr
Regular Advisor

Limiting home directory size

I would like to know how can I limit the size of a users home directory. Im using HP-UX 11i.
I would like to put the limit at the 200MB per user. How can I do that for the existing users (they don't have a limit at this point) as well as, what would be the best way to that for the new users.

Thank you,
6 REPLIES 6
Robert-Jan Goossens
Honored Contributor

Re: Limiting home directory size

Hi,

Take a look at the quota command the online manuel has it all.

Hope this helps,
Robert-Jan
Sundar_7
Honored Contributor

Re: Limiting home directory size


You need to implement quotas for the file system. quotas uses the userID to determine the usage. It would also be a good idea to implement a previleged group (without CHOWN) to prevent smart users from changing the ownership to a different user and abuse the quotas :-)
Learn What to do ,How to do and more importantly When to do ?
mvr
Regular Advisor

Re: Limiting home directory size

Thank you for direction.
What will happen with the users that have over 300MB data in their home directory and I want to limit their space to 300MB?
Robert-Jan Goossens
Honored Contributor

Re: Limiting home directory size

Hi again,

there are 2 limits (soft and hard limits). if you use a soft limit of 300 mb the user will be warned to cleanup his homedir, if you use the hard limit the user will get difficulties to logon, read his email etc.

Hope this helps,
Robert-Jan

generic_1
Respected Contributor

Re: Limiting home directory size

I have a question. Will the max limit affect a login if the user is say a programmer for example who has an app core dump and fill up to their max 100%?
Bill Hassell
Honored Contributor

Re: Limiting home directory size

A core file is like any other file and it's space will count in the user's quota limit. The programmer can avoid this situation in 3 ways:

1. write prorams that don't core dump (sorry about that)

2. Change the working directory to /var/tmp or /tmp

3. Change ulimit to prevent core dumps: ulimit -Sc 0 (then change it back if a core dump is desired)


Bill Hassell, sysadmin