1830938 Members
1775 Online
110017 Solutions
New Discussion

HP-UX File Sizes

 
Neale Ainscow
Occasional Advisor

HP-UX File Sizes

Is it possible to place a limit on the maximum size of a file that a user can create in a filesystem?
e.g. If /tmp is 2 GB the user should be able to create 4 x 512MB files but not be allowed to create any file over that size.
8 REPLIES 8
Eugen Cocalea
Respected Contributor

Re: HP-UX File Sizes

Hi,

there is another thread on the exact same question going on at this time, take a peek at it.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x10b303bbece8d5118ff40090279cd0f9,00.html

E.
To Live Is To Learn
Vincent Farrugia
Honored Contributor

Re: HP-UX File Sizes

Hello,

As far as I can read, I think this question is different from the one Eugene has linked to, in that you want to be able to write 4x512Mb instead of 2Gb whole.

My question is, why do you need this? You won't win any space on your harddrive by doing this. Is there any application which requires you to do this?

Vince
Tape Drives RULE!!!
Thierry Poels_1
Honored Contributor

Re: HP-UX File Sizes

Hi,

"ulimit" should do the trick ;)
(please note that ulimit works with 512-byte blocks!)

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Uday_S_Ankolekar
Honored Contributor

Re: HP-UX File Sizes

Hi,

Try this,
ulimit -a shows all userlimits.
If [file] is not set to unlimited, this can be done additional with:
ulimit -f unlimited

If this is not set to unlimited, after the next reboot, it is recommended to insert
ulimit -f unlimited

into /etc/profile.

Check this link...
http://us-support.external.hp.com/cki/bin/doc.pl/sid=d6fbc2eb04dfd7af89/screen=ckiDisplayDocument?docId=200000054992493


-USA...
Good Luck..
Darrell Allen
Honored Contributor

Re: HP-UX File Sizes

Hi Neale,

The answer to your question is yes. Use ulimit (man ulimit).

ulimit will affect every file the user creates in any filesystem. If the user has access to the shell then he may re-run ulimit thus defeating what you are doing.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Darrell Allen
Honored Contributor

Re: HP-UX File Sizes

Hi again,

I wrote man ulimit before I thought. ulimit is actually a shell built-in command. Use man on:

sh-bourne(1) Bourne Shell (/usr/old/bin/sh) description.
ksh(1) Korn Shell (/usr/bin/ksh) description.
sh-posix(1) POSIX Shell (/usr/bin/sh) description.
csh(1) C Shell (/usr/bin/csh) description.
keysh(1) Key Shell (/usr/bin/keysh) description.

Oops!

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
G. Vrijhoeven
Honored Contributor

Re: HP-UX File Sizes

Hi,

Like others suggested ulimit.

I like to give some additiol information. The vxfs filesystems have a build in limit of 2 GB filesize, with can be overruled with the largefile option included in the mkfs command:
mkfs -F vxfs -o largefiles special size. Since your file system is 2 GB you do not need this.

Gideon

Frank Slootweg
Honored Contributor

Re: HP-UX File Sizes

The Question Author has not responded anymore, but it looks like he is more looking for Disk Quotas than for ulimit et al.

See the SysAdmin documentation or/and quota(5) and friends for details.