LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-23-2014, 10:35 AM   #1
muneer123
LQ Newbie
 
Registered: May 2014
Posts: 3

Rep: Reputation: Disabled
Trying to tar 100GB worth of stuff. Halfway through tar always fails. Need help asap


Hello,

I am trying to tar 100gb worth of stuff, heres how my command looks. Mind you it is centos 6.4:

tar czvf /home/stuff . --numeric-owner

It always fails about halfway through for some reason. Its not an error it will just randomly freeze for a second on ssh and stop. it stops when the tar file size is around 6GB's

Last edited by muneer123; 05-23-2014 at 10:36 AM. Reason: whoopsie daisy
 
Old 05-23-2014, 10:44 AM   #2
rigor
Member
 
Registered: Sep 2011
Posts: 241

Rep: Reputation: Disabled
If it's not an error, and given that a running tar command, even with the verbose option, doesn't necessarily continuously produce output, by what measure are you concluding that it froze?
 
Old 05-23-2014, 10:56 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,441

Rep: Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508
I'm not sure this would cause the symptoms you are seeing, but by any chance is /home/stuff within the tree that is being archived? tar does try to reject attempts to include the archive within itself, but there are situations where it cannot detect that. It is best to put the archive elsewhere, or exclude it explicitly on the command line.
 
Old 05-23-2014, 03:37 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,551

Rep: Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429
Is the end destination . (dot)???? I'd agree that you should make the destination or output location out of the source location.
 
Old 06-01-2014, 07:52 PM   #5
dillardml
LQ Newbie
 
Registered: Jun 2014
Posts: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by muneer123 View Post
Hello,

I am trying to tar 100gb worth of stuff, heres how my command looks. Mind you it is centos 6.4:

tar czvf /home/stuff . --numeric-owner

It always fails about halfway through for some reason. Its not an error it will just randomly freeze for a second on ssh and stop. it stops when the tar file size is around 6GB's
Do you have enough free space on your harddrive for the .tar file?
 
Old 06-02-2014, 07:15 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,300
Blog Entries: 12

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Quote:
Originally Posted by muneer123 View Post
Hello,

I am trying to tar 100gb worth of stuff, heres how my command looks. Mind you it is centos 6.4:

tar czvf /home/stuff . --numeric-owner

It always fails about halfway through for some reason. Its not an error it will just randomly freeze for a second on ssh and stop. it stops when the tar file size is around 6GB's
There are a couple of problems here; I believe the argument for --numeric-owner needs to be just after the czvf options. Your destination tarfile is "stuff" in the /home tree. You are archiving all files from the directory level at which you have run this command. If the /home tree is included in this, then your archive file is circularly included in your archive and that's the main reason why it's hanging.

If your intention is to archive your /home/stuff tree, then the command should look something like:
Code:
tar czvf --numeric-owner /home/other-location/out-tar-file.tar.bz2 /home/stuff
However no one yet knows what your true archive intentions were, so you should state that information clearly if you're still stuck trying to get this working.
 
Old 06-02-2014, 08:11 AM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,441

Rep: Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508Reputation: 1508
Quote:
Originally Posted by rtmistler View Post
There are a couple of problems here; I believe the argument for --numeric-owner needs to be just after the czvf options.

If your intention is to archive your /home/stuff tree, then the command should look something like:
Code:
tar czvf --numeric-owner /home/other-location/out-tar-file.tar.bz2 /home/stuff
Mind your syntax! That command will create a file named "--numeric-owner", since that string will be taken as the argument for the "f" option.

FWIW, the original location of the "--numeric-owner" option was fine.
 
Old 06-02-2014, 08:19 AM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,300
Blog Entries: 12

Rep: Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866Reputation: 1866
Quote:
Originally Posted by rknichols View Post
Mind your syntax! That command will create a file named "--numeric-owner", since that string will be taken as the argument for the "f" option.

FWIW, the original location of the "--numeric-owner" option was fine.
Well corrected. FWIW I typically fall prey to stuff like that because I've never used the --numeric-owner argument; therefore I'd not have it in there; hence not used to playing around with fitting extra arguments like that in there. I do prefer to be more simple versus adding options like that, and just use the most common form of tar.

What in the world was that envisioned for anyways? Always use numbers for user/group names? So ... from system to system that does ... what? I.e. if a user or number doesn't exist on the other system, the result is the same, and typically when one de-archives it falls under the ownership of the userID extracting the archive, doesn't it? Worse, if the user doesn't exist on another system; however that user number is for a different user ... then? I never even thought to care, but you are correct to point out my syntax; I should've just omitted that argument totally.
 
Old 06-03-2014, 05:09 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,372

Rep: Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382Reputation: 2382
I guess its for nfs(?); the matching 'user id' for nfs shares is done by uid, not username.
 
Old 06-03-2014, 03:20 PM   #10
jefro
Moderator
 
Registered: Mar 2008
Posts: 16,551

Rep: Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429Reputation: 2429
I liked this.
"edited by muneer123; 05-23-14 at 10:36 AM. Reason: whoopsie daisy"

Ok, just for my reference and archival.

"‘--numeric-owner’

The ‘--numeric-owner’ option allows (ANSI) archives to be written without user/group name information or such information to be ignored when extracting. It effectively disables the generation and/or use of user/group name information. This option forces extraction using the numeric ids from the archive, ignoring the names.

This is useful in certain circumstances, when restoring a backup from an emergency floppy with different passwd/group files for example. It is otherwise impossible to extract files with the right ownerships if the password file in use during the extraction does not match the one belonging to the file system(s) being extracted. This occurs, for example, if you are restoring your files after a major crash and had booted from an emergency floppy with no password file or put your disk into another machine to do the restore.

The numeric ids are always saved into tar archives. The identifying names are added at create time when provided by the system, unless ‘--format=oldgnu’ is used. Numeric ids could be used when moving archives between a collection of machines using a centralized management for attribution of numeric ids to users and groups. This is often made through using the NIS capabilities.

When making a tar file for distribution to other sites, it is sometimes cleaner to use a single owner for all files in the distribution, and nicer to specify the write permission bits of the files as stored in the archive independently of their actual value on the file system. The way to prepare a clean distribution is usually to have some Makefile rule creating a directory, copying all needed files in that directory, then setting ownership and permissions as wanted (there are a lot of possible schemes), and only then making a tar archive out of this directory, before cleaning everything out. Of course, we could add a lot of options to GNU tar for fine tuning permissions and ownership. This is not the good way, I think. GNU tar is already crowded with options and moreover, the approach just explained gives you a great deal of control already. "

https://www.gnu.org/software/tar/man...ttributes.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
"Invalid tar magic" error msg. when I try to tar ldmud *.tar file in DSL pixxi451 Linux - Newbie 4 07-04-2010 08:32 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 06:30 AM


All times are GMT -5. The time now is 07:20 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration