In the future, you may want to use rsync instead of scp and tar. rsync can transfer in compressed format by setting the right flags.
–
BernhardNov 20 '12 at 11:45

I 'll consider that, even if in this case the tar was made because I need large files in the remote machine. Thanks Bernhard.
–
mthpvgNov 20 '12 at 13:55

Same problem might appear as tar: [...] Cannot mkdir: File name too long. Appeared on an encrypted filesystem when uncompressing a tar taken on a non-encrypted filesystem.
–
Nicolas RaoulMay 15 '13 at 10:47

1 Answer
1

tar limit file names to 256 bytes (with GNU extensions). Linux File Systems support at least 256 bytes per file name. It means any file packed by tar may be extracted without error. So I suppose two causes:

The tarball is corrupted, check it by:

$ tar -tvf tarball.tar

You will see some erros if any.

You use a "virtual" file system like fusecompress or ecryptfs (with selective file copmpression/encryption) and your file name is a bit shorter or equal to the file system limit. The trick is when you mount a directory with fusecompress (for example) and create a file name foo.bar the virtual filesystem creates a file called foo.bar.gz and compress it transparently, but hides the real file name from you. And if you create a file with 254 byte name long you get an error because it will try to append a suffix to it.

In this case simply extracting the tarball outside of the virtual file system should help:

It is not a virtual file system. I have like thousands of files, there is one which is 158 caracters long without the path to it (with it it's 219). It starting and ending with a "#". I do not know this file, I guess if I removed it before "taring" it will work. The "tar -tvf" shows nothing special... and I do not know how to read the trace files (which are pretty long). Thanks a lot Dmitry.
–
mthpvgNov 20 '12 at 13:53

1

Linux File Systems usually don't limit path length (see comparsion table). As for trace logs - if you're not aware with programming you could place files at pastebin.com for example, but first ensure files contain no private data. Also if you don't need this particular file then you could just try to exclude it on extraction: tar tar -xvf tarball.tar --exclude="copyFileNameHere" or even exclude all files starting with the sharp sign: tar -xvf tarball.tar --exclude="#*"
–
Dmitry VasilyanovNov 20 '12 at 14:17

I can't paste them unfortunately (it is not my data). Thanks for your answer and this comment, I'll use it !
–
mthpvgNov 20 '12 at 14:22