Large tar file

Taking care of your Linux box.
Post Reply
Saadi
Lance Naik
Posts: 33
Joined: Thu Mar 06, 2003 11:06 pm
Location: Chicago, Il - USA

Large tar file

Post by Saadi »

I have a large tar file (approx. 4 gb). when I created it, it took a long time to tar the entire archive and gave no error messages after finishing. Now, I am having problem untarring it. It hangs on some large core files. I left it overnight and still was hung.

I used the following methods:

1. tar cpvf <filename.tar> <directory> (tarring the archive)

2. tar xvpf <filename> (untarring the archive)

I have made sure that the location I am untarring in has enough disk space to accomodate the archive.

Is there a way to (g)zip the files inside the tarball before untarring it? Or any other way to untar it?

Appreciate your help. Thanks
Aziz Khawaja
Chicago, Il.
Faraz.Fazil
Major General
Posts: 1024
Joined: Thu Jul 04, 2002 5:31 pm
Location: Karachi/Pakistan/Earth/Universe

Post by Faraz.Fazil »

Normally, such errors donot arise when untarring, provided the files were properly tarr'ed

Now the only reason for the error may be becoz you are untarring to a non linux partition.

Some tar files esp those that contain files with symlinks should only be untarred on linux ext2 or ext3 partitions.If you untar them on windows fat or fat32 drives, they will not be properly untarr'ed

So are you untarring the files on a linux partition or a mounted fat/fat32 partition?

If you are untarring them on a non linux partition, the untar them on a linux partition instead.

Also, use tar -xf filename.tar to untar tars instead.
Last edited by Faraz.Fazil on Sat Nov 22, 2003 6:06 am, edited 1 time in total.
Linux for Life!
zaeemarshad
Lieutenant Colonel
Posts: 660
Joined: Sat Jul 06, 2002 12:35 pm
Location: Islamabad
Contact:

Post by zaeemarshad »

correct me if i am wrong but if the file is in tar.gz format u need to add a z switch to the tar command i.e. tar xzf file.tar.gz . dunno if it works without that but i always used it that way. i have faced a somewhat similar problem myself. whenever i tried to uninstall openoffice or install a huge rpm file, my system would hang for no reason. a ps output would show that the rpm process is sleeping i.e. status is S . a restart corrected the problem. till date i dunno whats the reason behind that and yet another reason to move away from redhat.

now as far as my knowledge is i know that ext3 writes occur after every 5 seconds. it may be that the write process hangs somewhere in the middle.it could be stale data in the archive with corrupt metadata or bad sectors on the disk. now unless and until that process reports a write success back to the kernel its not going to write further data and which i think may be the cause of the problem. i suggest u try untarring the archive on another partition. maybe that could help.

Regards
Zaeem Arshad
outstream
Naib Subedar
Posts: 322
Joined: Wed Sep 24, 2003 10:04 pm
Location: islamabad

Post by outstream »

AoA

i believe the guy has his file in .tar format only, its not in .tar.gz form
correct me if i am wrong but if the file is in tar.gz format u need to add a z switch to the tar command i.e. tar xzf file.tar.gz .
secondly i dont understand why is it taking long time to untar a 4mb file?. i mean 4mb is nothing. i downloaded whole kernel source in .tar.bz format which was of about 28.1 mb but i didnt have any problems in untarring it. i dont use any super computer either. its just late p3 that i use.
Testing?What's that? If it compiles, its good, if it boots up it is perfect.
----------------------------------------------------
Imran
Registered Linux User # 334322
jargon
Lieutenant Colonel
Posts: 691
Joined: Mon Oct 13, 2003 9:40 am

Post by jargon »

original post says 4gb , not 4mb
jargon
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear
Salam,

Use 'tar cfvz filename dir' to create and 'tar xfvz filename' to extract and also try man tar

Best Regards.
Farrukh Ahmed
Faraz.Fazil
Major General
Posts: 1024
Joined: Thu Jul 04, 2002 5:31 pm
Location: Karachi/Pakistan/Earth/Universe

Post by Faraz.Fazil »

You are correct dude.
I have always used tar -xf for untarring .tar files and tar -xzf for untarring .tar.gz files.Know what?, i posted this message before going to bed...since i am so accustomed to posting .tar.gz in my posts, i by mistake posted .tar.gz instead of filename.tar :wink:

And yes, as he stated, his file is in .tar format.
zaeemarshad wrote:correct me if i am wrong but if the file is in tar.gz
format u need to add a z switch to the tar command i.e. tar xzf file.tar.gz . Regards
Zaeem Arshad
Make sure it is a linux partition...esp if the .tar file contains files with symlinks.
zaeemarshad wrote: i suggest u try untarring the archive on another partition. maybe that could help
Linux for Life!
Saadi
Lance Naik
Posts: 33
Joined: Thu Mar 06, 2003 11:06 pm
Location: Chicago, Il - USA

Large tar file

Post by Saadi »

folks,

thanks for all your replies.

The scenario is that i tarred 6 directories on Linux ext3 filesystem. each directory is about 2-3 gb in size. i did not gzip any of the directories. i used -cvpf because i wanted to preserve permissions also. i 've never had any problems with untarring any large file before but this one.

so, out of 6 directories, only one directory is unable to untar. all directories were tarred off of Linux ext3 filesystem, then ftp'd over to a solaris machine. then i rebuilt this Linux OS, then ftp'd all files back one by one to the linux ext3 machine for untarring. 5 directories were untarred successfully, however i am still stuck with one 4GB tar file that contains useful archives and that is unable to untar. it hangs on a core file that I believe is very large. i have lost all hopes after trying like..20 times, leaving the tar run for hours to see if for any reason a large tar file would take that much time, but to no avail.

thank you for your tips.
Aziz Khawaja
Chicago, Il.
Saadi
Lance Naik
Posts: 33
Joined: Thu Mar 06, 2003 11:06 pm
Location: Chicago, Il - USA

Large tar file

Post by Saadi »

yes, I can try untarring it on another filesystem, such as hp-ux, solaris or aix machine.

thanks for your help.
Aziz Khawaja
Chicago, Il.
Post Reply