LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trying to tar 100GB worth of stuff. Halfway through tar always fails. Need help asap (https://www.linuxquestions.org/questions/linux-newbie-8/trying-to-tar-100gb-worth-of-stuff-halfway-through-tar-always-fails-need-help-asap-4175505887/)

muneer123 05-23-2014 10:35 AM

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

rigor 05-23-2014 10:44 AM

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?

rknichols 05-23-2014 10:56 AM

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.

jefro 05-23-2014 03:37 PM

Is the end destination . (dot)???? I'd agree that you should make the destination or output location out of the source location.

dillardml 06-01-2014 07:52 PM

Quote:

Originally Posted by muneer123 (Post 5175846)
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?

rtmistler 06-02-2014 07:15 AM

Quote:

Originally Posted by muneer123 (Post 5175846)
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.

rknichols 06-02-2014 08:11 AM

Quote:

Originally Posted by rtmistler (Post 5180788)
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.

rtmistler 06-02-2014 08:19 AM

Quote:

Originally Posted by rknichols (Post 5180824)
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.

chrism01 06-03-2014 05:09 AM

I guess its for nfs(?); the matching 'user id' for nfs shares is done by uid, not username.

jefro 06-03-2014 03:20 PM

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


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