LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-26-2006, 03:49 AM   #1
hardian_97
LQ Newbie
 
Registered: Jul 2005
Location: Indonesia
Posts: 23

Rep: Reputation: 15
untar a file more than 2 GB


Hi All,

I have a file in DLT tape from client and it has been tarred. When I want to untar it, it is complaining that exceeding the file size limit in unix/linux which is 2 GB. The file is around 23 GB.

Do you know how can I untar a 23 GB file to linux or unix system?

thank you for your time.

With kind regards,
Hardian Suprapto
System Engineer
 
Old 05-26-2006, 04:04 AM   #2
debulu
Member
 
Registered: May 2006
Location: India
Distribution: Redhat
Posts: 49

Rep: Reputation: 15
hi hardian_97

You can check whats the max file size limit by command 'ulimit -f'

And You can change the max file size limit to unlimited by

#ulimit -f unlimited


enjoy
 
Old 05-26-2006, 05:11 AM   #3
hardian_97
LQ Newbie
 
Registered: Jul 2005
Location: Indonesia
Posts: 23

Original Poster
Rep: Reputation: 15
Hi debulu,

I've tried your way but no luck. Apparently ulimit command is not exist in my red hat.

Do you have any other suggestion? or maybe some programs to untar this file?

Thank you for your time.

With kind regards,
Hardian Suprapto
 
Old 05-26-2006, 05:32 AM   #4
debulu
Member
 
Registered: May 2006
Location: India
Distribution: Redhat
Posts: 49

Rep: Reputation: 15
Hi
you can try to write a c- program which will increase ur file size limits.

#include <sys/resource.h>
#include <sys/time.h>
#include <unistd.h>

int main ()
{
struct rlimit rl;
int pid=fork();
if(pid==0){
/* Obtain the current limits. */
getrlimit (RLIMIT_FSIZE, &rl);
/* Set file limit in bytes */
rl.rlim_cur = RLIM_INFINITY;
setrlimit (RLIMIT_FSIZE, &rl);
***do some exec to extract from the tar here***
}
else
exit (0);
}

You must be super user to run this code.(gcc compiler i wish u have it)

But may be this modifications of resources are only applicable to the process who is doing it. So you can fork a child and exec the tar command. see what happens...
Refer man pages for setrlimit and getrlimit
hope it works

Last edited by debulu; 05-30-2006 at 06:12 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
massive tar file, can't untar dtra Linux - Software 3 09-08-2011 04:32 AM
'Read-only file system' when untar a tar.bz2 file yinglcs Linux - General 1 02-18-2006 09:12 PM
Getting problem when untar the .tar.gz file? ramakumard77 Linux - General 2 11-29-2004 11:15 AM
untar gzip file problem jmr0311 Linux - General 8 09-12-2004 04:32 PM
untar more than one file? Sammy2ooo Linux - Newbie 1 12-23-2003 02:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration