Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tar

Status
Not open for further replies.
Apr 13, 2004
316
US
Does anyone know if/what the maximum overall size is for a tar file?

I know it is a 2GB limit for an individual file, but I want total tar file size.

Thanks.
 
Hi,

the 2GB limit is a limit to standard AIX filesystems. The filesize is limited by the ulimits (ulimit -a, /etc/security/limits) and on the other hand when you create a filesystem, you have the option to enable "Large File System".

There should be no limit for tar itself.

laters
zaxxon
 
i tried using tar to backup few GB of filesystems and still works. Anyways. if you really are looking at this limits specifically... try to consider the ff:
" I happened to bumped on this URL that describes this"
( need to pay respect to the good author for his nice thread)
The quick answer is: 2^63-1 for the archive, 68'719'476'735 (8^12-1)bytes for each file, if your environment permits that.

as I understand your question, you want to know if you can produce tar files that are biger than 2 GBytes (and how big you can really make them). The answer to this question depends on a few simple parameters:

1) Does your operating system support large files?
2) What version of tar are you using?
3) What is the underlying file system?

You can answer question 1) for yourself by verifying that your kernel supports 64bit file descriptors. For Linux this is the case for several years now. A quick look /usr/include/sys/features.h will tell you, if there is any line containing 'FILE_OFFSET_BITS'. If there
is, your OS very very probably has support for large files.

For Solaris, just check whether 'man largefile' works, or try 'getconf -a|grep LARGEFILE'. If it works, then you have support for large files in the operating system. Again, support for large files has been there for several years.

For other operating systems, try "man -k large file', and see what you get -- I'll be gladly providing help if you need to ask for clarification to this answer. Something like "cd /usr/include; grep 'FILE_OFFSET_BITS' * */*" should tell you quickly if there is standard
large file support.

2) What version of tar are you using? This is important. Obviously, older tar programs won't be able to handle files or archives that are larger than 2^31-1 bytes (2.1 Gigabytes). Try running 'tar --version'.
If the first line indicates you are using gnu tar, then any version newer than 1.12.64 will in principle be able to provide you with large files. Try to run this command: "strings `which tar`|grep 64", and you
should see some lines saying lseek64, creat64, fopen64. If yes, your tar contains support for large files.

If your tar program does not contain support for large files (most really do, but maybe you are working on a machine older than 1998?),
you can download the newest gnu tar from ftp://ftp.gnu.org/pub/gnu/tar
and compile it for yourself.

The size of files you put into a tar archive (not the archive itself) is limited to 11 octal digits, the max. size of a single file is thus ca. 68 GBytes.

3) Given that both your operating system (and C library), and tar application support large files, the only really limiting factor is the file system that you try to create the file in. The theoretical limit for the tar archive size is 2^63-1 (9'223'372 Terabytes), but you will reach more practical limits (disk or tape size) much quicker.
Also take into consideration what the file system is. DOS FAT 12 filesystems don't allow files as big as the Linux EXT2, or Sun UFS
file systems.


Thank to him! hihihihi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top