tar file question

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers tar file question
# 1  
Old 07-17-2008
tar file question


I did this command to tar the files but I got an error.
tar -cvpf filename.tar pathname/

It did tar the file filename.tar but then it gave me this error "Reach end of file before expected". The new tar file is about 2GB. So does that mean my tar file limit is 2GB? Is there a max limit for the number of files in the directory to tar?

How do I get around this? Do I just zip the files and then tar, after that untar and unzip?

many thanks!
# 2  
Old 07-17-2008
you can't tar files > 2 GB in size and tar has a size limit of 2 GB
1. free up /tmp if its full. verify with df
2. change file limit to unlimted and relogin
3. An error occurred during reading/writing.
4. The maximum filesize for the output file in the target filesystem -
in case the target for tar is a file - has been reached. The maximum
fs for standard JFS is 2GB

Some hints
In case of reading:
do a
$ tar -tvf MyDevice
to verify that you can read all data

In case of writing try to write to /dev/null to verfiy that the
problem is related to the target device
$ tar -cvf - /myDir >/dev/null

Alternatively, just do a zip followed by compress
your output will be filename.zip.Z
uncompress and unzip .... try if it works...?Smilie
# 3  
Old 07-17-2008
I compressed the files using:
gzip *
and then tar the file
tar -cvpf myTarFile.tgz *

But when I untar it gave me this error

tar -xvvzf myTarFile.tgz
tar: Not a recognized flag: z
Usage: tar -{c|r|t|u|x} [-BdFhilmopsvw]
[-Number] [-fFile]
[-bBlocks] [-S [Feet] [Feet @Density] [Blocksb]]
[-LInputList] [-NBlocks] [-C Directory] File ...

The system doesn't support untar?
# 4  
Old 07-17-2008
You don't need the z flag. The files inside the tar are compressed not the tar.
Some versions of tar do support >2GB but it is non-standard extension.
# 5  
Old 07-17-2008
okay so compress and then tar work, but it still > 2GB Smilie
Can I do 2 different tar files? if so how do I know which one is already in the first tar file when tar the second file?

Is there a way to see the list of files in the directory and tell it to tar the first 100 files to filename1.tar and then the next 200 files to filename2.tar ... and so on?

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Tar - pre-checking before making the Tar file

Coming from this thread, just wondering if there is an option to check if the Tar of the files/directory will be without any file-errors without actually making the tar. Scenario: Let's say you have a directory of 20GB, but you don't have the space to make Tar file at the moment, and you want... (14 Replies)
Discussion started by: filosophizer
14 Replies

2. AIX

Making Tar of directory and tar file is going to be placed

Quick question, is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?) sample: /opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz will the tar file backup.tgz also include backup.tgz ? i tried... (5 Replies)
Discussion started by: filosophizer
5 Replies

3. UNIX for Dummies Questions & Answers

UNIX command to check if file name ends with .tar OR if the file is a tar file

Hello Team, Would you please help me with a UNIX command that would check if file is a tar file. if we dont have that , can you help me with UNIX command that would check if file ends with .tar Thanks in advance. (10 Replies)
Discussion started by: sanjaydubey2006
10 Replies

4. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

5. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

6. UNIX for Advanced & Expert Users

Tar utility (untar a .tar file) on VxWorks

Hi All Can someone pls guide me if there any utility to compress file on windows & uncompress on vxworks I tried as - - compressed some folders on windows ... i created .tar ( to maintain directory structure ) and compressed to .gz format. - on VxWorks i have uncompressed it to .tar... (1 Reply)
Discussion started by: uday_01
1 Replies

7. Shell Programming and Scripting

un-tar question

Hi all, My examples.tar has about 20 directories. I don't want to un-tar the entire examples.tar. Is there a way to un-tar just a directory named "java" from examples.tar? Please let me know JAK (2 Replies)
Discussion started by: jakSun8
2 Replies

8. Shell Programming and Scripting

extract one file form .tar.gz without uncompressing .tar.gz file

hi all, kindly help me how to extract one file form .tar.gz without uncompressing .tar.gz file. thanks in advance bali (2 Replies)
Discussion started by: balireddy_77
2 Replies

9. UNIX for Advanced & Expert Users

Does tar do crc checking on a tape or tar file?

Trying to answer a question about whether tar table-of-contents is a good tool for verifying tape data. (1 Reply)
Discussion started by: tjlst15
1 Replies

10. UNIX for Dummies Questions & Answers

tar question

Folks, I've created a tar file on tape using: tar xvf /dev/rmt0 The directory I was in was: \IMPULS\F50D01\temperik under temperik the tar command created subdirectories. I need too BACKUP these subdirectories again and restore them on another machine, But when i'm going to... (10 Replies)
Discussion started by: Erik Rooijmans
10 Replies
Login or Register to Ask a Question

Featured Tech Videos