How Unrar Extracts Split Archives from Usenet
This article explains how the unrar utility detects,
processes, and extracts split RAR archives downloaded from Usenet.
Multi-part RAR files are standard on Usenet to accommodate post size
limits and facilitate error recovery. When processing these files,
unrar reads internal volume headers to determine file
order, sequentially reconstructs the compressed data stream across file
boundaries, and verifies payload integrity using built-in checksums.
Volume Identification and Naming Schemes
Usenet posts traditionally package large binaries across multiple smaller files using one of two RAR naming conventions:
- New format:
filename.part01.rar,filename.part02.rar, and so forth. - Old format:
filename.rar,filename.r00,filename.r01, up tofilename.r99.
When you point unrar to the first archive in a set—such
as unrar x filename.part01.rar—the utility inspects the
working directory to index the remaining parts automatically. It relies
on the filename patterns to locate the subsequent volumes required to
complete extraction.
Header Parsing and Sequencing
The actual extraction order does not depend solely on file names. Each RAR file contains a structured binary header containing metadata about the archive:
- Volume Attributes: The main archive header includes flags that identify whether the file is part of a multi-volume set, whether it is the first volume, and whether the volume is encrypted.
- File Continuation Flags: Individual file headers
inside each split file contain flags (
SPLIT_BEFOREandSPLIT_AFTER). These flags signal tounrarwhether a compressed file begins in a prior volume or continues into the next volume. - Volume Numbering: Modern RAR formats encode the explicit volume sequence number directly inside the header, preventing parts from being processed out of sequence even if files are improperly sorted.
Stream Processing Across File Boundaries
unrar treats multi-volume sets as a continuous
compressed data stream:
- Decompression Pipeline: The tool begins
decompressing data from the first volume. When it reaches the end of the
current split file, it encounters the
SPLIT_AFTERflag. - Volume Handoff: Instead of terminating,
unrarpauses decompression, opens the next numerical volume in the sequence, verifies its header matches the archive set ID, and immediately feeds the remaining bytes into the decompression pipeline. - Seamless Assembly: The output file is written continuously to disk. From the operating system's perspective, a single large target file is created, even though the source data is drawn sequentially across dozens of separate RAR segments.
Integrity Verification and Usenet Integration
Usenet transfers frequently encounter missing or corrupted data
chunks. unrar incorporates two layers of integrity checks
during split extraction:
- Header CRC: Every volume has its own Cyclic Redundancy Check (CRC) to ensure the metadata itself has not been altered.
- Payload CRC32 / BLAKE2sp: During extraction,
unrarcomputes a running hash of the unpacked target file. Once extraction completes, this hash is verified against the master checksum embedded in the original archive metadata. If a corrupted Usenet block slips through,unraraborts or flags the corrupted output.
In automated Usenet workflows (such as SABnzbd or NZBGet), repair
tools like PAR2 run before unrar. Once PAR2 verifies that
all split parts are intact, unrar is triggered on the root
archive to execute the extraction pipeline start-to-finish without
manual intervention.