XZ

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
m (Adjusted layout for where xz/lzma2 is used under Linux for legibility sake.)
(Added DWARFS as a user of XZ via liblzma.)
Line 16: Line 16:
 
* [[initramfs]]<ref>[https://github.com/dracut-ng/dracut-ng/blob/main/man/dracut.conf.5.adoc?plain=1#L119-L123 dracut.conf.5.adoc - dracut-ng manual pages - GitHub]</ref><ref>[https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/blob/master/mkinitcpio.conf?ref_type=heads#L61-67 mkinitcpio.conf (lines 61-67) - mkinitcpio - Arch Linux GitLab]</ref><ref>[https://github.com/anatol/booster/blob/master/docs/manpage.md?plain=1#L57 manpage.md (line 57) - booster - GitHub]</ref>,
 
* [[initramfs]]<ref>[https://github.com/dracut-ng/dracut-ng/blob/main/man/dracut.conf.5.adoc?plain=1#L119-L123 dracut.conf.5.adoc - dracut-ng manual pages - GitHub]</ref><ref>[https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/blob/master/mkinitcpio.conf?ref_type=heads#L61-67 mkinitcpio.conf (lines 61-67) - mkinitcpio - Arch Linux GitLab]</ref><ref>[https://github.com/anatol/booster/blob/master/docs/manpage.md?plain=1#L57 manpage.md (line 57) - booster - GitHub]</ref>,
 
* [[SquashFS|<code>squashfs-tools</code>]]<ref>[https://github.com/plougher/squashfs-tools/blob/master/squashfs-tools/compressor.c#L31-L77 compressor.c (lines 31-77) - squashfs-tools - GitHub]</ref>
 
* [[SquashFS|<code>squashfs-tools</code>]]<ref>[https://github.com/plougher/squashfs-tools/blob/master/squashfs-tools/compressor.c#L31-L77 compressor.c (lines 31-77) - squashfs-tools - GitHub]</ref>
* As a specific switch <code>-J</code> or <code>--xz</code> in GNU [[tar]]<ref>[https://www.gnu.org/software/tar/manual/tar.html#gzip 8.1.1 Creating and Reading Compressed Archives - GNU tar 1.35 online manual (single page) - gnu.org]</ref>  under [[Linux]].  
+
* As a specific switch <code>-J</code> or <code>--xz</code> in GNU [[tar]]<ref>[https://www.gnu.org/software/tar/manual/tar.html#gzip 8.1.1 Creating and Reading Compressed Archives - GNU tar 1.35 online manual (single page) - gnu.org]</ref>  under [[Linux]].
 +
* [[DWARFS]] - mainly via liblzma<ref>[https://github.com/mhx/dwarfs/blob/main/src/compression/lzma.cpp lzma.cpp - DWARFS - GitHub]</ref> which on modern Linux installations, only [[LZMA2]] is used in place of [[LZMA]].
  
 
== Identification ==
 
== Identification ==

Revision as of 10:46, 16 August 2025

File Format
Name XZ
Ontology
Extension(s) .xz
MIME Type(s) application/x-xz
PRONOM fmt/1098
Wikidata ID Q162839
Compression lossless, mandatory
Magic Bytes FD 37 7A 58 5A 00
Released 2009[1]

XZ is a stream compression format with built-in integrity checks. It uses LZMA2 compression. Compressed streams are able to be concatenated and still be decompressible like a single-stream file.

XZ is a successor to LZMA_Alone format, and an alternative to Lzip. The compression format is offered as an option among the likes of:

Contents

Identification

XZ files always have lengths that are multiples of 4 bytes, and they begin with a 6-byte "magic" sequence of (hex) FD 37 7A 58 5A 00 and end with footer "magic bytes" of 59 5A. (The ending bytes can be verified as a sign that the file has not been truncated in transmission.)

Software

Sample files

Links

References

  1. The .xz File Format - Version 1.0.0 (2009-01-14) - tukaani.org
  2. extract-vmlinux shell script (line 52) - Linus Torvalds' kernel - GitHub
  3. dracut.conf.5.adoc - dracut-ng manual pages - GitHub
  4. mkinitcpio.conf (lines 61-67) - mkinitcpio - Arch Linux GitLab
  5. manpage.md (line 57) - booster - GitHub
  6. compressor.c (lines 31-77) - squashfs-tools - GitHub
  7. 8.1.1 Creating and Reading Compressed Archives - GNU tar 1.35 online manual (single page) - gnu.org
  8. lzma.cpp - DWARFS - GitHub
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox