Individual file size limit on HP-UX

Thread Tools Search this Thread
Operating Systems HP-UX Individual file size limit on HP-UX
# 1  
Old 07-31-2011
Individual file size limit on HP-UX

I got a question on ulimit on HP-UX. I have a log file that gets more than 2 GB and the application crashes because it can not write to log. I browsed through the forum and found one very similar post on ulimit but that was not concluded. Did some analysis and below is some output.
[/home/user1]>getconf KERNEL_BITS
[/home/user1]>ulimit -a
time(seconds)        unlimited
file(blocks)         unlimited
data(kbytes)         2097152
stack(kbytes)        161792
memory(kbytes)       unlimited
coredump(blocks)     4194303
[/home/user1]>uname -s
[/home/user1]>uname -r
[/home/user1]>ulimit -f

What is controlling the file size here ? I thought file size is unlimited here. Is there any way to increase the individual max file size limit to some higher value say 8 GB?

# 2  
Old 07-31-2011
What version of HP-UX are you using?
# 3  
Old 07-31-2011
HP-UX 11i v1
# 4  
Old 08-01-2011
I belive you can compile your C program with this option to open files greater then 2GB

You will require ANSI C compiler.
Unfortunatly i cannot test this since i don't have v1 avalible, but same works on v2
[tst]>cat test.c ## Some code i found online...
#include <stdio.h>
#include <fcntl.h>
int main(int argc, char **argv){
      char *fname;
      int fd, hasread;
      if(argc > 1){
        fname = argv[1];
        fprintf(stdout, "Filename is %s\n", fname);
      fd = open(fname, O_RDONLY);
      if(fd == -1 ){
        perror("Could not open file");
        return 1;
      fprintf(stdout, "File %s was open successfully\n", fname);
      return 0;
[tst]>du -sk largefile
2099624 largefile
[tst]>cc test.c
[tst]>./a.out largefile
Filename is largefile
Could not open file: Value too large to be stored in data type
[tst]>rm a.out
[tst]>cc -D_FILE_OFFSET_BITS=64 test.c
[tst]>./a.out largefile
Filename is largefile
File largefile was open successfully

Hope that helps.

Last edited by Peasant; 08-01-2011 at 12:02 PM.. Reason: Left machine hostname :)
# 5  
Old 08-01-2011
Thanks for your quick response. I wanted to have a limit configured at OS level. It is not any specific C code in the application that writes to log but there are many Java, C++, reports that run to generate the log file. One question -
is the ulimit setting as shown in my first message correct to allow more than 2 GB file size ? I see file(blocks)=unlimited but data (kbytes) is about 2 GB.
# 6  
Old 08-01-2011
I believe that would be data(kbytes) 2097152
Kernel parameter would be maxdsiz/maxdsiz64

The ulimit value is represented in KB, while maxdsiz is in B.

# 7  
Old 08-02-2011
What filesystem are you using and what commands were used to create the filesystem? Is "largefiles" (i.e. >2Gb) enabled on the filesystem and mentioned in /etc/fstab? See for example "man fsadm_vxfs" (depends on what filesystem you have). Even if the filesystem allows files >2Gb it does not mean that the application has code which can create files larger than 2Gb.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

2GB file size limit

Greetings, I'm attempting to dump a filesystem from a RHEL5 Linux server to a VXFS filesystem on an HP-UX server. The VXFS filesystem is large file enabled and I've confirmed that I can copy/scp a file >2GB to the filesystem. # fsadm -F vxfs /os_dumps largefiles # mkfs -F vxfs -m... (12 Replies)
Discussion started by: bkimura
12 Replies

2. Shell Programming and Scripting

Limit on a File size.

Hi All, I want to store 32KB of file in Oracle DB into CLOB field. I am not able to insert more than 32KB of file into CLOB. So i want to put a limit on the file size. I am using k shell. My file size will dynamically increase its size, i want to check the file size if it is more than 32KB... (1 Reply)
Discussion started by: rajeshorpu
1 Replies

3. Shell Programming and Scripting

sftp file size limit

Hi, Can some one please tell me the file size limit (if any) while using sftp I am trying to transfer a file ( size is almost 350 MB ) but it fails as shown below. sftp> put file1 ./file1 Uploading file1 to /dir1/./file1 file1 25% 100MB 10.2MB/s 00:28 ETA Couldn't write to remote... (6 Replies)
Discussion started by: vikash_k
6 Replies

4. UNIX for Advanced & Expert Users

file size limit?

hi, how can I find out what the limit of a file size is on unix? thanks (6 Replies)
Discussion started by: JamesByars
6 Replies

5. UNIX for Dummies Questions & Answers

Size limit for FTPing file

Is there any size limit for FTPing file from one unix system to another? (6 Replies)
Discussion started by: swarup2008
6 Replies

6. UNIX for Advanced & Expert Users

File Size Limit

Hi, I have a problem writing or copying a file 2GB or larger to either the second or third disk on my C8000. I've searched this forum and found some good information on this but still nothing to solve the problem. I'm running hpux 11i, JFS3.3 and disk version 4 (from fstyp) on all 3 disks. ... (2 Replies)
Discussion started by: HaidoodFaulkauf
2 Replies

7. Programming

File size limit exceeded

When i run my C program which dynamically creates the output file, the program stops after sometime and gives the error "File size limit exceeded" even though my working directory has space.Can anyone plz help me out. (13 Replies)
Discussion started by: drshah
13 Replies

8. AIX

file size limit

Can anybody help me? How to increase file size limit in aix 5.2? I have already specified in /etc/security/limits file : default: fsize = -1 core = 2097151 cpu = -1 data = -1 rss = -1 stack = -1 nofiles = 2000 (2 Replies)
Discussion started by: vjm
2 Replies

9. Solaris

File size limit

I want to have a permanent file created - and limit the size that this file can grow.. I want a circular file.. ie max size of file is 10 mb.. and if any new data written to file the oldest data removed.. How can I do this? I am on solaris 9 x86 (3 Replies)
Discussion started by: frustrated1
3 Replies

10. UNIX for Dummies Questions & Answers

Limit size of the file

How do I limit size of a file to 1 MB or something like that under Linux? (4 Replies)
Discussion started by: _hp_
4 Replies
Login or Register to Ask a Question