Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
1
votes
1
answers
45
views
How is compressed and how can be decompressed real core.img?
In GPT/BIOS, GRUB2 "installs" on BIOS boot partition "core.img" consiting of "diskboot.img", lzma decompressor (lzma_decompress.img) and core.img (IIUC). I assumed that skipping 512 B of diskboot.img, then skipping lzma decompressor (2880 B on SLES), I would get compressed "real" core.img (ending wh...
In GPT/BIOS, GRUB2 "installs" on BIOS boot partition "core.img" consiting of "diskboot.img", lzma decompressor (lzma_decompress.img) and core.img (IIUC). I assumed that skipping 512 B of diskboot.img, then skipping lzma decompressor (2880 B on SLES), I would get compressed "real" core.img (ending where '00 00' follows). But how to decompress this part?
Or, do I do anything wrong? BTW, I can't decompress even /boot/grub2/i386-pc/core.img (on SLES too) while skipping same parts...
The goal is to see real "core.img" data to detect a modification...
Jiri B
(559 rep)
Aug 6, 2025, 06:27 AM
• Last activity: Aug 6, 2025, 01:49 PM
1
votes
2
answers
700
views
Why is 7-zip much faster than other LZMA implementations in Linux?
Until now, I used to backup my data using `tar` with one of the LZMA compression options (`--lzma`, `--xz` or `--lzip`) I recently noticed that 7-Zip has been ported to Linux in 2021 (https://www.xda-developers.com/7-zip-linux-official-release/). I'm not talking about the older P7Zip (https://p7zip....
Until now, I used to backup my data using
tar
with one of the LZMA compression options (--lzma
, --xz
or --lzip
)
I recently noticed that 7-Zip has been ported to Linux in 2021 (https://www.xda-developers.com/7-zip-linux-official-release/) . I'm not talking about the older P7Zip (https://p7zip.sourceforge.net/) , that doesn't seem to be maintained anymore, but about the official 7-Zip.
So, I tested it, and was very surprised to discover that it's A LOT faster than all the others Linux LZMA implementations, for the same compression ratio.
Below my tests (Debian 11). Please not that I emptied the RAM cache between every test (sync && echo 3 > /proc/sys/vm/drop_caches
)
I am working on a 163M folder, containing several type of files, PDF, text, open office, and so on...
$ du -hs TEST/
163M TEST/
With 7-Zip it's compressed into a 127M file in 15 seconds :
$ time tar c -hp TEST/ | 7zz a -si test.tar.7z
real 0m14,565s
(...)
$ ll test.tar.7z
(...) 127M (...) test.tar.7z
Whereas with all the other implementations of LZMA, it takes almost 5 times longer (around 1'13"), for the same archive size !
$ time tar -chp --lzma -f test.tar.lzma TEST/
real 1m13,159s
$ time tar -chp --xz -f test.tar.xz TEST/
real 1m12,889s
$ time tar -chp --lzip -f test.tar.lz TEST/
real 1m12,525s
$ ll test.tar.{7z,lz*,xz}
(...) 127M (...) test.tar.7z
(...) 127M (...) test.tar.lz
(...) 127M (...) test.tar.lzma
(...) 127M (...) test.tar.xz
Just to be sure there's nothing wrong with tar
, I did the same tests but piped tar
's output to lzma|xz|lzip
, instead of using the --lzma
, --xz
and --lzip
switches. Same results.
So, basically, 7-Zip's Linux version makes all other LZMA implementations look rather bleak. I think 7-Zip doesn't support Linux owners and permissions, but that's irrelevant when compressing a .tar
file.
So, does anybody know why 7-Zip's Linux version is so much faster than other LZMA implementations ?
```
ChennyStar
(1969 rep)
Mar 17, 2024, 10:25 AM
• Last activity: Apr 14, 2024, 08:49 AM
3
votes
1
answers
440
views
tar lzma autocompression produces the error "This does not look like a tar archive"
The following script ```bash mkdir test && cd test mkdir files touch files/{1,2,3} tar --create --file "test.lzma" files/{1,2,3} --auto-compress mkdir extracted_files tar --extract --file "test.lzma" --directory extracted_files --auto-compress ``` produces the following error: > tar: This does not l...
The following script
mkdir test && cd test
mkdir files
touch files/{1,2,3}
tar --create --file "test.lzma" files/{1,2,3} --auto-compress
mkdir extracted_files
tar --extract --file "test.lzma" --directory extracted_files --auto-compress
produces the following error:
> tar: This does not look like a tar archive
but actually tar+compress and uncompress+untar do happen (files are in place). Why is this happening? Is it some kind of bug in tar
?
On my system:
xz --version
xz (XZ Utils) 5.2.7
liblzma 5.2.7
tar --version
tar (GNU tar) 1.34
file test/test.lzma
test/test.lzma: LZMA compressed data, streamed
ls test/extracted_files/
files
You can also reproduce it in https://replit.com/languages/bash (with xz (XZ Utils) 5.2.2
and tar (GNU tar) 1.34
). But not in https://www.onlinegdb.com/online_bash_shell (with xz (XZ Utils) 5.2.4
and tar (GNU tar) 1.30
).
cppbest
(193 rep)
Oct 21, 2022, 01:35 PM
• Last activity: Oct 22, 2022, 01:15 PM
0
votes
0
answers
54
views
help with the firmware file of the radio
help with the firmware file of the radio. I unpack the file with the 7zip program, with the same program I can not return the file back to its original state with the same file size. https://cloud.mail.ru/public/u68D/xpEJ56GWH
help with the firmware file of the radio. I unpack the file with the 7zip program, with the same program I can not return the file back to its original state with the same file size.
https://cloud.mail.ru/public/u68D/xpEJ56GWH
Ivanhr-v
(1 rep)
Jul 8, 2021, 12:58 PM
1
votes
1
answers
782
views
How to install recoll dependencies "djvutxt" and "python3:pylzma"?
I installed recoll on my Kubuntu 20.04. Now it says that external apps and commands are missing that are required for the indexing are missing, specifically: djvutxt (image/vnd.djvu) python3:pylzma (application/x-7z-compressed) but I have no idea how to install them. No such packages are shown in mu...
I installed recoll on my Kubuntu 20.04. Now it says that external apps and commands are missing that are required for the indexing are missing, specifically:
djvutxt (image/vnd.djvu)
python3:pylzma (application/x-7z-compressed)
but I have no idea how to install them. No such packages are shown in muon (my package manager GUI). How can I install them?
Make42
(739 rep)
Dec 16, 2020, 09:42 AM
• Last activity: Dec 16, 2020, 10:57 PM
4
votes
2
answers
6699
views
got "tar: /path/to/my/dir: Not found in archive" error while verifying created archive
I did compress a directory to `.tar.xz` archive format with this command: tar --create --verbose --file myArchive.tar.xz /path/to/my/dir then,I tried to check health of created archive with following command: tar --compare --file myArchive.tar.xz /path/to/my/dir and I got this error lines : tar: /pa...
I did compress a directory to
.tar.xz
archive format with this command:
tar --create --verbose --file myArchive.tar.xz /path/to/my/dir
then,I tried to check health of created archive with following command:
tar --compare --file myArchive.tar.xz /path/to/my/dir
and I got this error lines :
tar: /path/to/my/dir: Not found in archive
tar: Exiting with failure status due to previous error
I retried it but got same resault.what is the problem and how can I solve it?
mmj
(119 rep)
Dec 11, 2020, 06:33 PM
• Last activity: Dec 15, 2020, 11:12 AM
0
votes
1
answers
3136
views
"xz : (stdout) : Write error: File too large" while writing a tar archive
I wanted to compress a directory whit size of about 25 GB to `.tar.xz` format using following command: tar --xz --create --verbose --file myArchive.tar.xz /patch/to/my/dir but got these error lines: xz: (stdout): Write error: file too large tar: myArchive.tar.xz: wrote only 2048 of 10240 bytes tar:...
I wanted to compress a directory whit size of about 25 GB to
.tar.xz
format using following command:
tar --xz --create --verbose --file myArchive.tar.xz /patch/to/my/dir
but got these error lines:
xz: (stdout): Write error: file too large
tar: myArchive.tar.xz: wrote only 2048 of 10240 bytes
tar: Child returned status 1
tar: Error is not recoverable: exiting now
I tried it for .tar.gz
format too and got approximately same error lines.
I am using Fedora 32 and the destination file system is W95 FAT32(LBA). The file stopped writing at about 4.3 GB. What's strange is that my disk has more than 500GB free space.
What is the problem and how can I fix it?
mmj
(119 rep)
Nov 13, 2020, 02:22 PM
• Last activity: Nov 13, 2020, 04:50 PM
1
votes
1
answers
790
views
how to fix "tar: Cannot verify compressed archives" error?
I wanted to compress a directory into `.tar.xz` format and verify it after writing so I wrote a command like this: tar --xz --create --verbose --verify --file myArchive.tar.xz /patch/to/my/dir but it did not create archive and I got this two error lines: tar: Cannot verify compressed archives try 't...
I wanted to compress a directory into
.tar.xz
format and verify it after writing so I wrote a command like this:
tar --xz --create --verbose --verify --file myArchive.tar.xz /patch/to/my/dir
but it did not create archive and I got this two error lines:
tar: Cannot verify compressed archives
try 'tar --help' or 'tar --usage' for more information.
I tried tar.gz
format instead of tar.xz
but got exactly same resault, what is the problem and how can I solve it?
mmj
(119 rep)
Nov 10, 2020, 11:08 PM
• Last activity: Nov 10, 2020, 11:25 PM
1
votes
0
answers
490
views
The size of my lzma compressed file is different from one system to another using same compression ratio - why?
I have an lzma compressed file that I've extracted from a firmware image (via binwalk) that is X bytes uncompressed and Y bytes compressed. When I try to compress the extracted file again - without any modification and using the same compression ratio - on my machine (Ubuntu 18.04), I end up with a...
I have an lzma compressed file that I've extracted from a firmware image (via binwalk) that is X bytes uncompressed and Y bytes compressed.
When I try to compress the extracted file again - without any modification and using the same compression ratio - on my machine (Ubuntu 18.04), I end up with a compressed image that is Z bytes instead of Y bytes.
My guess is that is has to do with the version of
lzma
that I'm using vs the version that was originally used - is that correct? And if so, is there a way to tell which version of lzma
was used originally?
Also, the compressed file extracted from binwalk
has the .7z
extension, but running file orig_compressed.7z
says that it's an lzma file. I'm not sure if that's making a difference.
Edit: the firmware uses the MIPS architecture - I've tried using qemu-system-mipsel
to run the MIPS lzma and I still got a compressed file that was a different size than what I'm expecting it to be.
compression_help1234
(11 rep)
Sep 10, 2020, 03:34 PM
6
votes
2
answers
11915
views
What invocation will use LZMA to compress tar output on my Mac (OSX 10.12.x)?
I've tried several invocations of the OEM tar to create LZMA-compressed tarballs. More specifically, I tried: tar -c -f --lzma Windows\ 7.vmwarevm.tar.lzma Windows\ 7.vmwarevm My efforts created an archive with filename `--lzma`, and tar complained of `Windows 7.vmwarevm.tar.lzma`: `Cannot stat: No...
I've tried several invocations of the OEM tar to create LZMA-compressed tarballs. More specifically, I tried:
tar -c -f --lzma Windows\ 7.vmwarevm.tar.lzma Windows\ 7.vmwarevm
My efforts created an archive with filename
--lzma
, and tar complained of Windows 7.vmwarevm.tar.lzma
: Cannot stat: No such file or directory
, probably for the same reason: --lzma
was taken as the filename of the archive to be created, and consequently the actual intended archive name was taken to be the first in a list of arguments to include in the archive.
I thought after some searching that MacOS had not included it in the provided options, and built GNU tar from scratch, storing it under another name in /usr/local/bin
. However, my efforts to use the above invocation with the renamed and newly built tar
had the same effect: I was building an archive in --lzma
.
My computer has a seemingly working /usr/local/bin/lzma
.
What invocation(s) should I use, perhaps piping tar
to lzma
and perhaps in a script to do the work of "tar czf foo.tgz foo", but uses lzma
instead of gzip
for compression?
Christos Hayward
(529 rep)
Jul 28, 2017, 06:55 PM
• Last activity: May 1, 2019, 02:11 PM
0
votes
1
answers
4430
views
How to split a compressed file?
I have a 44GB 7z compressed file that I compressed with lzma2 and it took around 11 hours (original file is a text file of 285GB). 7z a -t7z Files.7z -m0=lzma2 -mx=9 -aoa So, what I want is to do is to split the file without re-compressing it, to be able to upload/download over simultaneous connecti...
I have a 44GB 7z compressed file that I compressed with lzma2 and it took around 11 hours (original file is a text file of 285GB).
7z a -t7z Files.7z -m0=lzma2 -mx=9 -aoa
So, what I want is to do is to split the file without re-compressing it, to be able to upload/download over simultaneous connections
How would I split and join such a file without going through the 7z recompress process again?
Local Host
(25 rep)
Sep 7, 2018, 10:59 AM
• Last activity: Sep 7, 2018, 07:41 PM
0
votes
1
answers
205
views
How to get trailing data of LZMA archive?
Similar to for GZIP archives I need a way to get the trailing data of an LZMA archives.
Similar to for GZIP archives I need a way to get the trailing data of an LZMA archives.
phk
(6083 rep)
Feb 3, 2017, 12:52 PM
• Last activity: Feb 3, 2017, 01:08 PM
Showing page 1 of 12 total questions