Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recovering files from .gz ???

Status
Not open for further replies.

heeeep72

Programmer
Dec 15, 2004
33
CH
Hi Archiving Gurus,

I have a problem, please help if You can. I was working on a linux machine for some days, and I created several files there in a directory structure (some documents, etc). Finishing my work I wanted to archive all this for continuing work on an other PC, which has Windows 2K on it. (i am a newbie in this archiving-on-linux-stuff) I went to the root of my dir structure and i used the command:

gzip -cr * > filename.gz

On the windows machine I could extract only ONE huge file from my 'filename.gz' archive (using PowerArchiver or Win-GZ). Now i learned i made a big mistake, because gzip is for archiving ONE file at a time...

But, i know also, that this only one extracted file contains all my other archived files as well, because i opened it in an editor, and i have recognized fractions of them. How could i get them out from there now? Should i look for 'end of file' -s now with an editor (what ascii code is that?), or is there an easier/better solution for this? (i can not go back to that linux machine). Any help appreciated. I need those files very much...

thx
heeeep72
 
why not used tar?

tar cvf you_file.tar *
gzip your_file

and the gunzip and tar -xvf in your windows?

 
gzip is not an archiving program like "zip" in DOS, all it does is compress data. Chacalinc suggests using tar because it *is* a file archiving program.

If you need to recover your files from the original gzip you did, you're screwed, you probably don't have the skillz to do it. If you still have access to the original files, then you can use tar.

If "tar --version" says you have GNU tar, then you can compress and archive at the same time with "tar -czvf yourarchive.tgz *".
 
Sorry, I just read your original post, and you state that you don't have access to the original files...

After a quick test on my machine, gzipping the original files has concatenated them together, so there is no end of file marker between them. Your only hope would be to edit the file and cut it up into pieces saving them individually, or inserting markers and writing a script to split on them and create files.

I know that sucks, but that's the only way.
 
I think Eric's correct, but if these files aren't plain text (I see you only recognise 'fractions' of them), I don't hold out much hope even for his suggested method. If it's that important, perhaps a data-recovery specialist might be able to help. Good luck.
 
Thanks for your invaluable posts. The only thing I can do now is to cut out some parts of texts using an editor.

heeeep72
 
If you have at hand a listing of the files with their size (kinda ls -l) you may consider dd playing with ibs, seek and count.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top