Wednesday, 30 April 2014

AIX - Fun with the tar command

I hit an issue today with a fresh install of a number of IBM software products ( WAS, DB2, BPM etc. ) on AIX 7.1.

Whilst trying to unpack a file using the gunzip command ( the file was TAR'd and GZIP'd with a .tar.gz extension ), I was seeing issues such as this: -

tar: 0511-169 A directory checksum error on media; -252676160 not equal to 44916.

which suggested that the file was somehow corrupted.

This was the command I was using: -

gunzip < file.tar.gz | tar xvf -

However, I also did a quick Google search, which drew me to this Technote: -

which, in essence, says: -

When using AIX tar the package is not able to uncompress its contents. AIX TAR doesn't uncompress files with long names, and OP_6.0.1_Non_Embedded_DVD_1.tar.gz contains several files with long name patterns.

and provides a link from where the AIX Toolbox may be downloaded: -

I looked for, and downloaded, TAR: -

and installed the new RPM: -


which I then installed onto the AIX box: -

rpm -ivh tar-1.22-1.aix6.1.ppc.rpm

resulting in a new binary: -

-rwxr-xr-x    1 root     system       530022 Jan 21 2013  /opt/freeware/bin/tar

PS This page was also of use in getting me to the right version of GNU tar

This got me further forward, but I still saw similar exceptions during the tar process :-(

I re-downloaded the images, and compared the file sizes to those on the AIX box, and they were, as one might expect, different.

So I then uploaded some of the images to the AIX box: -

$ scp BPM_Adv_V85_AIX_* root@P710_05_LPAR1:/tmp/Downloads
root@p710_05_lpar1's password:
BPM_Adv_V85_AIX_1_of_2.tar.gz                 100% 1292MB  46.1MB/s   00:28  
scp: /tmp/Downloads/BPM_Adv_V85_AIX_1_of_2.tar.gz: File too large
BPM_Adv_V85_AIX_2_of_2.tar.gz                 100% 1361MB  48.6MB/s   00:28  
scp: /tmp/Downloads/BPM_Adv_V85_AIX_2_of_2.tar.gz: File too large

Can you spot the problem ?

Yes, I saw it as well :-)

Thankfully, as ever, Google had the answer, Google is my friend.

This developerWorks forum post: -

gzip: aix51ml9.tar: File too large ?

which states, in part: -

Could you have run into a user resource limit?

Check the fsize (maximum file size allowed) entry /etc/security/limits. Setting this to -1 will allow unlimited file sizes. You can also make changes via ulimit and possibly smit.

If you edit /etc/security/limits directly, you might have to reboot for the change to take effect; however, with ulimit you should not have to reboot.

Here's a link to the pubs for ulimit:

'ulimit -a' will print the current user resource limits.
'ulimit -f <num>' will set the file size limit, where <num> is the file size limit in blocks.

Well, the answer was there ....

This was what I did: -

$ cd /etc/security
$ cp limits limits.original
$ vi limits

- changing fsize = 2097151 to fsize = -1

$ diff limits limits.original
<       fsize = -1
>       fsize = 2097151

Once I rebooted, the upload worked perfectly, and GNU tar did the rest.

Nice :-)

No comments: