LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SOLVED: tar error message: Cannot open: No such file or directory (https://www.linuxquestions.org/questions/linux-newbie-8/solved-tar-error-message-cannot-open-no-such-file-or-directory-770803/)

qajaq 11-22-2009 11:02 AM

SOLVED: tar error message: Cannot open: No such file or directory
 
Though I've used tar to extract files for software I've downloaded in the past, this is my first effort at creating a tar file and extracting it. I'm using openSuSE 11.1/KDE 4.1 on one machine (the source, as described below), and Kubuntu 9.04 on the other.

I have a directory on the source computer (/datalib) which I want to copy to the second machine. I made a tarball of the directory using
Code:

tar -cf datalib.tar /datalib/*
That appears to have completed successfully -- at least, I have a file named datalib.tar that is ~30GB, and I can see the names of the directories and files within the tarball.

Then I copied the .tar file to the other machine (named Kodiak) using
Code:

scp -p datalib.tar Kodiak:/datalib/
That process took about 40 minutes, and at the end of that time, I could see .tar file on the other machine.

Then I moved to the other machine to extract the files, and that's where I ran into trouble. I used
Code:

tar -xvf datalib.tar
and the entire contents of the .tar file scrolled down the screen, but each listing was followed by
Quote:

Cannot open: No such file or directory
The .tar file on the Kodiak machine is the same size as the original, and I am able to list the files using
Code:

tar -tvf datalib.tar
I am at a loss to know why I'm told there's no such file or directory.

I wrote the tarball in the /datalib directory on the original machine, and I copied it to the /datalib directory on the Kodiak machine. I do not find anything in the --help or man pages that appears to point in a direction helpful to me.

lwasserm 11-22-2009 11:18 AM

Do you have write permission in the directory where you are trying to extract the tarball?

qajaq 11-22-2009 11:25 AM

Duhhh...! That was it. I was so accustomed to using the /datalib directory on my primary machine that I simply overlooked the fact that I'd created the directory on the new machine as root, while doing other set-up chores.

Sure enough -- once I changed the ownership of the directory, the tarball extracted as expected.

Thanks!


All times are GMT -5. The time now is 08:40 AM.