All these tests were performed on an HP-UX B.11.00 system.
01) The gzcat utility does not handle files > 2gb:
-----------------------------------------------------------------
The gzcat utility is provided by the HP product called Software
Distributor (SW-DIST). It does not handle large files as we can
see from the tusc output below:
# which gzcat
/usr/contrib/bin/gzcat
# /usr/contrib/bin/gzcat -V
gzcat 1.2.4 (18 Aug 93)
Compilation options:
DIRENT UTIME STDC_HEADERS HAVE_UNISTD_H
# ls -al OSarch.gz
-rw-rw-rw- 1 root sys 2278914411 Oct 11 16:26 OSarch.gz
# (tusc -o2 /usr/contrib/bin/gzcat OSarch.gz) 2>&1 | head | tail -1
stat("OSarch.gz", 0x400345a0) .................. ERR#72 EOVERFLOW
As you can see above, gzcat attempted to issue a "stat" system
call on the large file, and that (predictably) fails with errno=72
(EOVERFLOW) which basically means "Value too large to be stored in
data type".
02) The cat utility will handle files > 2gb:
------------------------------------------------------
The cat utility is provided by the HP product called Core
Operating System (OS-Core). It will handle files > 2gb as
can be seen from the following tusc output:
# which cat
/usr/bin/cat
# ident /usr/bin/cat
/usr/bin/cat:
$Revision: 1.13 $
$Revision: 1.13 $
# (tusc -o2 /usr/bin/cat OSarch.gz) 2>&1 | head -55 | tail -2
open("OSarch.gz", O_RDONLY|O_LARGEFILE, 0) ..... = 3
fstat64(3, 0x7a002fa8) ......................... = 0
As you can see from the above output, the cat utility first
opens the file with attribute "O_LARGEFILE" (thus enabling large
file access) and then does an fstat64 system call sucessfully.
03) The gzip utility works on a file > 2gb when used in a pipe:
-----------------------------------------------------------------------------------
Create a file bigger than the 2gb barrier (2,147,483,647 bytes):
# rm -f BigFile ; touch BigFile
# perl -e '$f="BigFile";syscall(129,$f,0x7fffffff)'
# ls / >> BigFile
# ls -la BigFile
-rwxrwxrwx 1 kole users 2147484058 Oct 11 14:47 BigFile
And we have the standard HP-UX gzip:
# which gzip
/usr/contrib/bin/gzip
# /usr/contrib/bin/gzip -V
gzip 1.2.4 (18 Aug 93)
Compilation options:
DIRENT UTIME STDC_HEADERS HAVE_UNISTD_H
And we try to gzip it from the command line:
# /usr/contrib/bin/gzip BigFile > /dev/null
BigFile: Unknown error
FAILURE!
But if we give gzip the same amount of data via a Unix pipe:
# /usr/bin/cat BigFile | gzip --fast > /dev/null
#
SUCCESS!
04) The gunzip utility works on a OS archive > 2gb when used in a pipe:
-------------------------------------------------------------------------------------------------
If we have an existing OS archive > 2gb:
# ls -al OSarch.gz
-rw-rw-rw- 1 root sys 2278914411 Oct 11 16:26 OSarch.gz
Then the gunzip utility command line option fails:
# /usr/contrib/bin/gunzip -c OSarch.gz | pax -vf -
OSarch.gz: Unknown error
pax: The archive is empty.
FAILURE!
But if we include gunzip as part of a Unix pipe, all is OK (and
this is how it is done within Ignite's archive extract):
# /usr/bin/cat OSarch.gz | /usr/contrib/bin/gunzip | pax -vf - | head -4
USTAR format archive
drwxr-xr-x 0 root root Oct 11 15:51 ./
drwxr-xr-x 0 root root Oct 5 09:36 lost+found/
dr-xr-xr-x 0 bin bin Oct 11 15:51 etc/
-r--r--r-- 0 bin bin 184 Mar 26 2004 etc/group
#
SUCCESS!
05) On a side note, gzip, gunzip and gzcat are identical:
---------------------------------------------------------------------------
By looking at the inode number and the link count for the 3
utilities (gzip, gunzip and gzcat) we can see they are all
actually the same executable (delivered by SW-DIST):
# ls -ali $(which gzip gunzip gzcat)
33844 -r-xr-xr-x 3 bin bin 139264 Aug 5 2003 /usr/contrib/bin/gunzip
33844 -r-xr-xr-x 3 bin bin 139264 Aug 5 2003 /usr/contrib/bin/gzcat
33844 -r-xr-xr-x 3 bin bin 139264 Aug 5 2003 /usr/contrib/bin/gzip
So I am not surprised they have common limitations.
06) The pax utility can not handle a file > 2gb without a patch:
-----------------------------------------------------------------------------------
First, be sure patch PHCO_30150 is NOT on the system:
# swremove PHCO_30150
Create a file bigger than the 2gb barrier (2,147,483,647 bytes):
# rm -f BigFile ; touch BigFile
# perl -e '$f="BigFile";syscall(129,$f,0x7fffffff)'
# ls / >> BigFile
# ls -la BigFile
-rwxrwxrwx 1 kole users 2147484058 Oct 11 14:47 BigFile
Try to pax the file which is now > 2gb:
# pax -wvf /dev/null BigFile
pax: BigFile : > 2GB. Not Dumped.
FAILURE!
Now install patch PHCO_30150 (this patch can be obtained from
ftp://hpatlse.atl.hp.com/hp-ux_patches/s700_800/11.X/PHCO_30150 ):
# vpatch -a PHCO_30150
Retry the pax command:
# pax -wvf /dev/null BigFile
BigFile
#
SUCCESS!
07) And please remember:
-------------------------------------
Please remove the BigFile (your sysadmin will thank you):
# rm BigFile
[end]
What could possibly go wrong?