ddr_lzma(1)
β¨ ddr_lzma β the XZ de/compression plugin for dd_rescue β¨
okay bestie, so this is the manual page for ddr_lzma(1) and it's literally the XZ de/compression plugin situation for dd_rescue, and I'm gonna walk you through every single crumb, no cap π
πΈ NAME πΈ
ddr_lzma β the Data de/compression plugin for dd_rescue. that's it, that's the name, she's serving exactly what it says on the tin π«Ά
π SYNOPSIS π
-L /path/to/libddr_lzma.so[=option[:option[:...]]]
-L lzma=[=option[:option[:...]]]
like, that's how you summon her. periodt.
π DESCRIPTION π
π About π
XZ is an archiving format that uses the LZMA2 compression algorithm, aka the Lempel-Ziv-Markov chain algorithm β say that five times fast, I dare you π
LZMA2 has fixed some quirks of the highly successful LZMA algo, which provides high compression ratios and is known for its superior decompression speeds. She's optimized for much better compression ratios at the cost of compression speed compared to, say, LZO. And her lowest preset levels tend to beat the highest gzip and lowest bzip2 levels for both compression ratio and speed. it's giving overachiever and we're obsessed π
This plugin has been written for dd_rescue and uses the plugin interface from it. See the dd_rescue(1) man page for more info on dd_rescue β go read it, bestie, it's important.
β¨ OPTIONS β¨
Options are passed using dd_rescue option passing syntax: the name of the plugin (lzma) is optionally followed by an equal sign (=) and options are separated by a colon (:). The lzma plugin also allows most of the common options from the xz util, plus some additional ones. See the EXAMPLES section below, I gotchu π
π¦ Compression or decompression π¦
The lzma dd_rescue plugin (from here on just called ddr_lzma, which reflects the variable parts of the filename libddr_lzma.so) chooses compression or decompression mode automatically if one of the input/output files has an [lt]xz suffix. Otherwise you can specify z or d parameters on the command line for compression and decompression respectively. easy peasy π
mtβ tellsddr_lzmato do de/compression in multithreaded mode. This might speed up processing of data by using all cores of the CPU. If the number of cores can not be detected, only one will be used. You can also passmt=Nto explicitly specify the number of threads to be used.
ngl, watch out: liblzma prior to 5.2.0 does not support multithreaded compression, while liblzma prior to 5.4.0 does not support multithreaded decompression. This parameter will be ignored then. π
bench[mark]β the plugin supports this parameter; if it's specified, it will output some information about CPU usage. cute lil stats moment πtestβ if you only want to make an integrity check of the xz-compressed file, use this. If data is corrupted, you will get a message in the console about it. Instead oftestyou can use justt. short queen βcheck=XXXβ whereXXXcan be one of these integrity checksum algos:CRC32,CRC64,SHA256,NONE. IfNONEis specified, the integrity checksum will not be calculated while compressing. By defaultCRC32will be calculated by the plugin.memlimit=XXXβ if you want to limit memory usage when decoding, use this, whereXXXis the memory limit for decoding. The usual sufficesk,M,Gare supported.
Values below 1M or above the machine's memory size will be rejected. she has standards π
π Compression presets π
preset=Xβ selects the compression ratio, whereXcan be an integer from0to9inclusively. The default value is3, which is lower than the default of6that xz uses, but provides much better bandwidth. The effect on compression speed and ratio is significant, see the xz documentation. Note that decompression speed is always very good with lzma, even without multithreading. You can append aneto the preset level to use more CPU (but not more memory), trying to compress the data better. This corresponds to the--extremeflag in xz. Use levels0,1,2if you want compression levels better than highest gzip (or low bzip2) with better speed. Multithreading may further speed things up, though you need to test it on your system, see below. Use the lzo plugin instead to achieve highest compression speeds (lowest CPU usage) and lowest memory consumption with very modest compression. pick your fighter π₯
π BUGS/LIMITATIONS π
π Maturity π
The plugin is new as of dd_rescue 1.99.17. Do not yet rely on data saved with ddr_lzma as the only backup for valuable data. The options may also still change in the future. After the events around xz/liblzma in March 2024, some additional reviews should be done on this code before passing untrusted compressed files to it.
bestie I am BEGGING you, keep a second backup. fr fr π
Compressed data is more sensitive to data corruption than plain data. Note that the checksums in the xz file format do NOT allow to correct for errors, because next bytes depends on previous ones. Checksums just allow a rather reliable detection of data corruption.
Unlike ddr_lzo, no work has been invested to recover well from corrupted compressed data. liblzma may recover in some cases, but don't count on it. π
When deciding which compressed storage format to use, please read https://www.nongnu.org/lzip/xz_inadequate.html. While not all reasons given there may be as serious as the author makes them sound, they are valid. Right now the lzma plugin is the one choice you have for high compression in dd_rescue; consider using tools like par2 to protect against corruption for long-time storage. The future may bring lzip, zstd or other plugins. For many purposes, the proven lzo plugin continues to be a reasonable choice.
When using multithreading, you may hit bugs. Missing function symbols on decoder initialization, memlimit for the decoder always set to 1 byte might be issues you hit (depends on the system which you use). Test the mt option before relying on it. π«Ά
π₯ EXAMPLES π₯
dd_rescue -L lzma=z:preset=9 infile outfile
compresses data from infile into outfile with compression preset == 9 (highest compression, lowest speed short of the extreme settings). she's going all out π
dd_rescue -L lzma=d:mt:memlimit=1234 infile infile2
will decompress infile to infile2 in multithreading mode with memory limit equal to 1234 Megabytes.
dd_rescue -L lzma infile.xz outfile
will decompress infile.xz into outfile. (The fact that the infile has an .xz extension makes ddr_lzma assume that it's compressed and you want to decompress.) auto-detect ate and left no crumbs β¨
π SEE ALSO π
dd_rescue(1)- liblzma documentation
π AUTHOR π
Dmitrii Ivanov <dsivanov_9@edu.hse.ru>
π§ CREDITS π§
The liblzma library and algorithm has been written by The Tukaani Project https://xz.tukaani.org/xz-utils/
π COPYRIGHT π
This plugin is under the same license as dd_rescue: The GNU General Public License (GPL) v2 or v3 β at your option.
β HISTORY β
ddr_lzma plugin was first introduced with dd_rescue 1.99.17 (Nov 2024). baby plugin, growing up so fast π₯Ή
okay that's the whole page bestie, and just so you know β this was Dmitrii Ivanov's work, dated 2024-03-10, and it's from the ddr_lzma(1) manual. go forth and compress responsibly, mwah πππ¦
π¦ where this page comes from
- arch rolling: dd_rescue 1.99.25-1 Β· GPL
- fedora 43: dd_rescue 1.99.21-2.fc43 Β· GPL-2.0-only OR GPL-3.0-only
- fedora 44: dd_rescue 1.99.22-3.fc44 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: dd_rescue 1.99.21
- nixpkgs unstable: dd_rescue 1.99.21
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms