Cannot unzip large zip file in Fedora (Source : Windows)

Fedora version : Fedora Workstation 35

I have a zip file (2021-YearEnd-Full-Bkp.zip shown below).

It is zipped in Windows 10 and it has several subdirectories and files inside. It is 6 GB in size. From Windows, I copied it to my portable HDD and then transferred it to my Fedora 35 laptop. I have done this before and it worked for smaller files. But, the unzip is not working for this one.

From GUI (Gnome Files), I right-click on the zip file > choose ‘Open with Archive Manager’ , I get the following error :
UnzipIssue

So, I run unzip command from the command-line and I get the following error.

$ ls -lh
total 12G
drwxr-xr-x. 4 sysadmin sysadmin 4.0K Oct  3 13:23 03-Oct-2021
drwxr-xr-x. 3 sysadmin sysadmin 4.0K Oct  4 00:08 03-Oct-2021-Delta
-rwxrwxrwx. 1 sysadmin sysadmin 2.7G Oct  3 13:11 03-Oct-2021.zip
drwxr-xr-x. 3 sysadmin sysadmin 4.0K Jul  4  2021 04-July-2021
-rwxrwxrwx. 1 sysadmin sysadmin 2.7G Aug 15 12:02 15-Aug-2021.zip
-rwxrwxrwx. 1 sysadmin sysadmin 6.0G Jan  3 21:33 2021-YearEnd-Full-Bkp.zip
$ 
$ unzip 2021-YearEnd-Full-Bkp.zip
Archive:  2021-YearEnd-Full-Bkp.zip
warning [2021-YearEnd-Full-Bkp.zip]:  2121100311 extra bytes at beginning or within zipfile
  (attempting to process anyway)
error [2021-YearEnd-Full-Bkp.zip]:  start of central directory not found;
  zipfile corrupt.
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
$ 
$ 
$ file 2021-YearEnd-Full-Bkp.zip
2021-YearEnd-Full-Bkp.zip: Zip archive data, at least v2.0 to extract, compression method=store
$

Any work around for this ? BTW, this file is unzipping fine in a Windows server.

Hi,

Have you tried extracting with 7zip?

7z x 2021-YearEnd-Full-Bkp.zip

You may need to install 7zip:

sudo dnf install -y -q p7zip p7zip-plugins

Thanks Tom.

3 Likes

@panjukadiyan92 Do you know what algorithms were used to compress it? If you use non-standardized algorithms (standard for zip is only the old Deflate algorithm) or functions (such as AES encryption with zip), any tool that only supports the traditional/original zip may crash with it. Maybe that is the case with unzip.

Generally, 7z is a tool that is very flexible and supports many algorithms, functions, formats (including non-standardized ones). So, you may try it with 7z as suggested by @tjdoyle.

However, if you do it with the command line anyway, I think it is sufficient to install dnf install p7zip. It is in the main Fedora repo.

4 Likes

Thank You Tom and Christopher for the advice.

7zip was already installed in my fedora system as shown below.

But, when I unzipped, I got the “Headers Error” message as shown below. It seemed to have unzipped the files though. Since, there are hundreds of files and sub-folders inside, I cannot verify everything.

[sysadmin@localhost ~]$ sudo dnf install p7zip
[sudo] password for sysadmin: 
Repository vivaldi is listed more than once in the configuration
Fedora 35 - x86_64 - Updates                    108 kB/s |  19 kB     00:00    
Fedora 35 - x86_64 - Updates                    1.2 MB/s | 1.8 MB     00:01    
Fedora Modular 35 - x86_64 - Updates                                                                                                         199 kB/s |  22 kB     00:00    
Package p7zip-16.02-21.fc35.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[sysadmin@localhost ~]$

---- Trying to unzip the .zip file

$ 7z x 2021-YearEnd-Full-Bkp.zip

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,12 CPUs Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (906EA),ASM,AES-NI)

Scanning the drive for archives:
1 file, 6418306167 bytes (6121 MiB)

Extracting archive: 2021-YearEnd-Full-Bkp.zip
               
ERRORS:
Headers Error

--
Path = 2021-YearEnd-Full-Bkp.zip
Type = zip
ERRORS:
Headers Error
Physical Size = 6418306167
64-bit = +

                                                                               

Archives with Errors: 1

Open Errors: 1

So, in my source windows laptop, I installed 7z Windows version and zipped the directory using 7z and I got 2021-YearEnd-Full-Bkp.7z file. I copied this .7z file to my Fedora server and unzipped it successfully as shown below.

---- Copied the newly zipped file with .7z extension

$ ls -lh
total 17G
drwxr-xr-x. 4 sysadmin sysadmin 4.0K Oct  3 13:23 03-Oct-2021
drwxr-xr-x. 3 sysadmin sysadmin 4.0K Oct  4 00:08 03-Oct-2021-Delta
-rwxrwxrwx. 1 sysadmin sysadmin 2.7G Oct  3 13:11 03-Oct-2021.zip
drwxr-xr-x. 3 sysadmin sysadmin 4.0K Jul  4  2021 04-July-2021
-rwxrwxrwx. 1 sysadmin sysadmin 2.7G Aug 15 12:02 15-Aug-2021.zip
-rwxrwxrwx. 1 sysadmin sysadmin 5.5G Jan  4 10:44 2021-YearEnd-Full-Bkp.7z
-rwxrwxrwx. 1 sysadmin sysadmin 6.0G Jan  3 21:33 2021-YearEnd-Full-Bkp.zip
$ 
$ 7z x 2021-YearEnd-Full-Bkp.7z

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,12 CPUs Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (906EA),ASM,AES-NI)

Scanning the drive for archives:
1 file, 5892472297 bytes (5620 MiB)

Extracting archive: 2021-YearEnd-Full-Bkp.7z
--
Path = 2021-YearEnd-Full-Bkp.7z
Type = 7z
Physical Size = 5892472297
Headers Size = 221944
Method = LZMA2:24 BCJ
Solid = +
Blocks = 3

Everything is Ok                                                               

Folders: 1596
Files: 10718
Size:       8141206186
Compressed: 5892472297
$

@panjukadiyan92
If you were working with two different copies of the same file (one copy on Windows, one on Linux), maybe one was damaged (you could check if this is the case using sha256sum on both files). This would explain why unzipping worked on Windows but not on Linux.

Another possibility is that maybe the Windows tool had the same unzip error as 7z on Linux but did not output it because the files could be unzipped properly (Linux tools tend to output more information than Windows ones, which can create sometimes a bit confusion).

I would say it is a minor error that does not interfere with the unzip process, and that has resulted in three different behaviors in three different applications: One unzipped it without mentioning the minor error, one unzipped but mentioned the error, one seems to be configured to stop any unzip process if there is any error. So I would assume it is the latter possibility.

But feel free to let us know if you can verify that it is actually the first one (using sha256sum or such).

3 Likes

Hello @panjukadiyan92 ,
Glad you solved this, could you mark the appropriate comment that was the solution, to what would seem to be a corrupt archive judging form the different file sizes.
Stephen

I think the file sizes are related to the format, not to the (potential) error. Originally, he used zip (likely to use the Deflate algorithm). Later, he used the 7z format (usually using lzma or lzma2 by default). The latter is far more efficient, explaining the difference in file size. However, the header error indicates a corruption, in one copy of the archive or in the archive in general.

It would be indicative for future issues to identify where the error actually was. Also, in the overall context, I am a bit wondering of the behavior of unzip (and the Windows tool, whatever it was).

1 Like