I made a tar with a directory on a remote machine with:
tar -czvf
I scp it to my local machine, where I wanted to untar it:
tar -xzvf
But I get : Cannot open: File name too long
On my local machine on lubuntu 12.04 I have: tar (GNU tar) 1.26
.
The remote machine is not accessible right now, I'll check the version after if needed.
I would like to extract without having to make a new tar, especially since the remote machine is offline.
And by the way if you know a way to make proper archive despite long name, I'll take it.
Best Answer
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 bytar
may be extracted without error. So I suppose two causes:The tarball is corrupted, check it by:
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 calledfoo.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:
Anyway, try to trace it to get more information: