Operating System - HP-UX
1820714 Members
2831 Online
109627 Solutions
New Discussion юеВ

TAR cannot create file >2GB in background

 
Leon_17
Occasional Advisor

TAR cannot create file >2GB in background

Hi,
I get the following errors with tar, cpio and pax can someone please help?

1. With TAR:
CMD: tar cvf backup.tar /backup
ERROR: Can't open /dev/tty to prompt for more media.

2. With CPIO:
CMD: find /backup -depth -print | cpio -ov >backup.cpio
ERROR: write failed: File too large
Can't open /dev/tty.

3. With PAX:
CMD: pax -w -f backup.pax /backup
ERROR: pax: write : File too large
pax: A write error has occurred.

All of these commands run if I run them normally, but if I run them in the background or from cron, I get the errors. The size of the file it creates is 2147483136.
Thanks
Leon
20 REPLIES 20
T G Manikandan
Honored Contributor

Re: TAR cannot create file >2GB in background

All the commands you tried do not support large files i.e. files > 2GB.

you can use the GNU version of tar from

http://hpux.cs.utah.edu/hppd/hpux/Gnu/tar-1.13.25

Also make sure that your file system is largefiles enabled.


Thanks
Animesh Chakraborty
Honored Contributor

Re: TAR cannot create file >2GB in background

To work in cron u must give full path names like
/usr/bin/tar cvf ......
and tar/cpio does not support files more than 2GB.
Try fbackup instead.
Did you take a backup?
T G Manikandan
Honored Contributor

Re: TAR cannot create file >2GB in background

not sure whether the above site is accessible right now .you can use the hp porting center UK

http://hpux.connect.org.uk/hppd/hpux/Gnu/tar-1.13.25/
Trond Haugen
Honored Contributor

Re: TAR cannot create file >2GB in background

Unfortunately this is a feature and not a bug. The standard tar isn't designed to backup files as large as 2Gb. Back when tar was first written 2Gb was a ridiculous large file. Afterwards other and better backup programs has come.
You can use fbackup or get hold of GNUtar.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Leon_17
Occasional Advisor

Re: TAR cannot create file >2GB in background

I did try the GNU tar, it does the same. The people from GNU, said it is an OS thing(HP-UX 11.11).
My largefile support is set.
Another thing it works fine if I start it from the command-line.
Leon
Norman_21
Honored Contributor

Re: TAR cannot create file >2GB in background

Hello,

I understood your question. You are saying that you can run the tar command at the foreground with files >2 GB but you can not do it at the background.

Try this:

#nohup tar cvf backup.tar /backup &

And see what's gonna happen.

I'm sure some of the guys have better answer than me!!
Thanks.
"Attitudes are contagious, is yours worth catching"/ My first point was given by SEP on January 31, 2003
Trond Haugen
Honored Contributor

Re: TAR cannot create file >2GB in background

Has the filesystem you are backing up TO realy largefiles enabled? check with 'fsadm -F vxfs /mountpoint'.
And what do you mean by " it works fine if I start it from the command-line"? Do you have problems with a cron job. Noticed you don't have a path to the 'backup.tar'. If this is a cron job you realy should. Generally speaking I would advise it too. So you are sure where you put the file.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
T G Manikandan
Honored Contributor

Re: TAR cannot create file >2GB in background

"It works fine from command line"

What other ways you use?
Leon_17
Occasional Advisor

Re: TAR cannot create file >2GB in background

The fsadm command show "largefiles".
The full command I use is:
tar cvf /data/backup/backup.tar /app/oraapps.
The way it does not work is with "at" or from cron.
T G Manikandan
Honored Contributor

Re: TAR cannot create file >2GB in background

Try using the full path for the GNUtar executable.

Trond Haugen
Honored Contributor

Re: TAR cannot create file >2GB in background

The most obvious difference between commandline and at & cron is the PATH. Use the full path to the GNUtar in your at & cron jobs.
(I'm not sure it it's named tar too, but you could rename it to gtar too so you are sure which one you are running.)

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Frank Slootweg
Honored Contributor

Re: TAR cannot create file >2GB in background

From my response in your other thread (Sigh!) http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x8e4c28c64656d71190080090279cd0f9,00.html
:

Probably the ulimit settings are different.

ulimit can be tricky because it depends on things like cron, the shell used, etc..

I advise to put these commands in a script and put a ulimit command just before each (tar/cpio/pax) command in the script and look *very precisely* at what ulimit reports in each case.

ARUN_19
Advisor

Re: TAR cannot create file >2GB in background

i had faced similar problem that tar was not copying files greater than 2GB.But it did not copy on command line also.the man page for tar clearly says that limitation.I used fbackup and it is working fine!!!
Alexander M. Ermes
Honored Contributor

Re: TAR cannot create file >2GB in background

Hi there.
Possible to use gzip ?
Only problem will be gunzip, but that can be
done with command :

cat filename.gz | gunzip >> filename
.
We have done this with Oracle export files
and it works.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Chris Vail
Honored Contributor

Re: TAR cannot create file >2GB in background

If you install GNU tar, it goes into /usr/local/bin. You should move it to /bin, or put /usr/local/bin ahead of /bin in your path statement, else any time you use tar, you'll get the one in /bin instead of the one you want.


Chris
Patrick Wallek
Honored Contributor

Re: TAR cannot create file >2GB in background

First: tar CAN create a tar archive file that is larger than 2GB, regardless of whether it is to a file or to tape. Otherwise how could you use the whole DDS3, DDS4, DLT, etc. tape.

2nd: I think the problem you are running into may have to do with your 'ulimit' values. You must remember that when you run jobs via 'cron' and / or 'at' that you do NOT have the same environment that you do when you run it from your shell.

In your script put a 'ulimit -a' command in and compare the output there to the output of a 'ulimit -a' that you run from the command line. I think you will find that the "file" value is different and is not allowing you to create the 2GB file from cron / at.

To change this you can do 'ulimit unlimited' in your script to reset it for the duration of the script.
Tom Danzig
Honored Contributor

Re: TAR cannot create file >2GB in background

The latest pax patch allows support for > 2GB files. You could also use fbackup as well.
Leon_17
Occasional Advisor

Re: TAR cannot create file >2GB in background

Thanks to Alexander and Frank,
the problem is with ulimit(in sh "ulimit -f" and in ksh "ulimit n")

Trond Haugen
Honored Contributor

Re: TAR cannot create file >2GB in background

Don't just thank them Leon, give them points.
Yes tar can back up more than 2Gb of fileS. But not A file larger than 2Gb.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn
Sunil Sharma_1
Honored Contributor

Re: TAR cannot create file >2GB in background

Hi,

This problem is not looks like tar,pax or cpio problem.

when you are running the command in background it's throwing some messages it can be either error message or informative messages, which it's not able to display and your backup is getting fail this problem is related to kernal parameter maxpty.
just check the value of maxpty and increase it and try agin.
it should work.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***