-   Linux - Server (
-   -   Zip file corrupted, works fine issuing remounts (

xzased 08-25-2011 04:59 PM

Zip file corrupted, works fine issuing remounts
Hi, Im trying to zip over 40,000 xml files into different zip archives. Everything goes ok until zip starts showing the following error:


  adding: 1435578.xml (deflated 62%)
        zip warning: extended local header not found for 1435578.xml

zip error: Zip file structure invalid

This starts happening to all files I input regardless of the zip archive they are going to, even if I move the corrupt archives and start with fresh ones. The command I use to zip them is:

zip -j /path/to/file.xml
The location of the files and the zip archives are in a samba share. My fstab looks like this:

//  /media/storage  cifs    user=admin,password=adM1n@33,noperms 0 0
What is strange about this is that when I unmount/remount the drive, everything works allright (I still have to move the corrupted zips to another location and start with a fresh archive). Can anyne help me find out what is going on? Both my machines are running red hat 5.3

metalhead201 08-25-2011 05:41 PM

Does it have to be zip? Can you use tar and then gzip?

tar -cf xmlarchive.tar /path/to/file.xml
gzip xmlarchive.tar

Try that and see if it works. I wonder if there's a bug in zip? I rarely use it and almost always use tar and gzip instead.

xzased 08-25-2011 06:00 PM

Unfortunately it has to since we have other users retrieving data who don't know anything but zip. My version of zip is 2.31, I've read on info-zip's site about it, but cant find an issue with it. I'll try to update to 3.0 and see if that takes care of it. I just find the unmount/remount part strange and wonder if it has anything to do with it

metalhead201 08-25-2011 06:17 PM

OK, try this. I'm no expert at zip, but am pretty good at debugging things.

Take that bad zip file out and move it elsewhere. There may be something wrong with 1435578.xml.

Then see if you can zip the rest up. Let's debug to see if it's the file itself that is bad.

xzased 08-25-2011 06:26 PM

I move the once that fail to a temporary directory, I can zip them ok once I remount the filesystem.

xzased 08-26-2011 06:30 PM

Ok, I think Im getting somewhere now. I was reading this article and mounted the share with forcedirectio option (the server I am connecting to has a around 400 MB/s of network output). The file errors disappeared but now it shows this:

zip warning: unexpected signature on disk 0 at 1773216

metalhead201 08-26-2011 06:37 PM

OK cool. That looks like just a warning.

Yeah, I think it was a hardware/mounting issue and not a software issue. Sorry I wasn't any help. :(

All times are GMT -5. The time now is 12:24 AM.