Ubuntu 7z error
When
7z 포멧으로 압축된 파일을 푸는 과정에서 에러가 발생함
(base) root@f129439cd489:~/DataSet# 7zr x Fashion-data.7z
7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=ko_KR.UTF-8,Utf16=on,HugeFiles=on,64 bits,32 CPUs AMD Ryzen Threadripper PRO 5955WX 16-Cores (A00F82),ASM,AES-NI)
Scanning the drive for archives:
1 file, 40049580020 bytes (38 GiB)
Extracting archive: Fashion-data.7z
ERROR: Fashion-data.7z
Fashion-data.7z
Open ERROR: Can not open the file as [7z] archive
What is problem
공식 사이트에 압축파일이 손상된 경우 발생하는 에러라고 명시돼 있음
There are some possible cases when archive is corrupted:
You can open archive and you can see the list of files, but when you press Extract or Test command, there are some errors: Data Error or CRC Error.
When you open archive, you get message "Can not open file 'a.7z' as archive"
아마도 윈도우에서 우분투 서버로 파일을 이동중에 서버가 꺼진게 원인인것 같다.
How to solve
공홈에 명시돼 있는 방법이 있으니 올려는 두겠지만 따로 시도하지는 않는다.
If you try to open or extract archive and you see the message "Can not open file 'a.7z' as archive", it means that 7-Zip can't open some header from the start or from the end of archive.
In that case you must open archive in hex editor and look to Start Header and End Header.
Possible cases:
Case: If start of archive is corrupted, then there is no link to End Header. But if the End Header is OK, and the size of archive is also correct, you can replace data in Start Header in hex editor to the following values:
0000000000: 37 7A BC AF 27 1C 00 04 00 00 00 00 00 00 00 00
0000000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Then try to open archive, if you can open and you see the list of files, try Test or Extract command. Look also "Data errors or CRC errors" section in this page.
Case: Start Header and End Header are OK, but total size of archive is not OK. You can calculate correct size of archive from values in Start Header. Then you must recover correct size. You can insert some data or remove some data somewhere in archive (for example, at offset of several MBs before the end of archive).
For example, if you have multi-volume archive: a.7z.001, ... , a.7z.009, but one part a.7z.008 is missing, just copy a.7z.007 to file a.7z.008, and 7-Zip will see correct size of archive. Or if some part was reduced, look the size of another parts and restore original (correct) size of "bad" part, so total size will be correct again, and 7-zip will be able to open headers.
Case: The end of archive is corrupted or missing. The following text describes that case.