Skip to content

DAR archives

Xitee edited this page Oct 11, 2026 · 6 revisions

DAR archives

DAR mode stores a directory as numbered archive slices. Each slice is packaged in a disc folder with checksums and, by default, PAR2 recovery. --iso selects ISO output instead. Use it for data that needs multiple discs, compression or incremental generations.

bd-archive create -m dar -s /data/photos -n Photos -o /data/photos-gen1

This creates generation 1. create scans the source, previews the estimated disc count and fill, then asks before building. Declining lets you adjust the command. -y skips this confirmation; --sample still performs sample compression before the preview.

Use a fresh output directory and a dedicated workdir. Keep both outside the source and keep the source stable. Raw mode enforces path separation; DAR mode does not provide the same overlap/source-change guards.

Multiple hardlink names within the selected source tree are rejected before DAR archive creation, for both folder and ISO output. External hardlinks and independent copies/reflinks are allowed. With auto-deferral, only names remaining in this run are checked; sample compression and deferral planning can therefore precede rejection. Incremental preview estimates do not exclude unchanged names from this validation: those paths still belong to the archive tree. The error lists conflicting relative paths. See Troubleshooting.

Compression and the preview

The default compression algorithm is zstd. Supported CLI choices are zstd, lzma, lz4, gzip, bzip2 and none; the installed DAR binary must support the chosen algorithm.

# Choose a level explicitly.
bd-archive create -m dar -s /data/photos -n Photos \
  -o /data/photos-gen1 -c zstd -l 3

# No compression.
bd-archive create -m dar -s /data/photos -n Photos \
  -o /data/photos-gen1 -c none

These are alternatives, not commands to run successively into the same output. DAR's documented levels are 1–22 for zstd and 1–9 for the other algorithms, with a default of 9. The CLI forwards --level to DAR; it does not validate the range itself. A level is ignored when DAR mode uses -c none.

The disc-count preview uses an output/input ratio. By default it is 1.0, even when compression is enabled. A preview of ten discs therefore does not mean compression has already been measured.

Choose one way to improve the estimate:

# Compress a representative sample directory with the selected algorithm/level.
bd-archive create -m dar -s /data/photos -n Photos \
  -o /data/photos-gen1 -c zstd -l 3 --sample /data/photo-sample

# Use a known ratio: 0.8 means output at 80% of input size.
bd-archive create -m dar -s /data/photos -n Photos \
  -o /data/photos-gen1 --ratio 0.8

--sample and --ratio are mutually exclusive. Small samples below 50 MiB trigger a warning because archive overhead distorts the measurement. Neither option changes the actual compression algorithm. With auto-deferral enabled, the estimate also influences which files are deferred.

Recovery and sizing

DAR defaults to -r 5. Recovery is generated separately for each data slice, so a damaged disc uses its own recovery files. Use a whole percentage from 1 through 100, a fixed size per slice such as -r 2G, or -r 0 / -r none for SHA-512 only. A fixed size applies to every slice including a smaller last one. It is written with explicit PAR2 block counts rounded down, so the amount stays within the request and falls short of it by less than one block.

During each slice's PAR2 creation one live line shows the current phase; Processing adds the average throughput and remaining time. All other PAR2 output stays visible. Without a terminal, progress is logged at most every 5 seconds.

--fill-recovery additionally fills each disc's free space with PAR2 data, as in raw mode; -r 0 --fill-recovery uses only the free space, and -r none --fill-recovery is rejected. The same rule applies to every slice: recovery data is created once, right after the slice is written, sized from the slice's actual size and the space the slice sizing gave it. Full discs usually have little free space, so filling is skipped there (less than 0.5% of the slice) with a notice; the last disc, holding a smaller slice, is filled. The space reserved for the catalog, README, filesystem and PAR2 packet copies stays unused, about 25 MB on a 25 GB disc depending on the catalog estimate. The preview shows Fill free space and an estimated Recovery (fill) for the last disc, based on the estimated archive size; each README records the actual recovery of an extended slice. Leave --fill-recovery off when you want to pack an unburned last disc with --pack-with later.

Slice sizing reserves space for the catalog, PAR2 and other metadata. The final folder is sized with mkisofs -print-size, including UDF/ISO9660 overhead, and must fit the selected byte capacity after rounding up to growisofs's 32-KiB write blocks. With --iso, the actual image size is checked after building with the same rounding. The preview remains an estimate; a larger-than-estimated catalog can make a build fail its final fit check. See Storage and layout.

What creation leaves behind

The default output contains discs/disc_0001/, discs/disc_0002/, etc., with an off-disc discs/manifest.json used by burn. Add --iso to write images/disc_0001.iso, images/disc_0002.iso, etc. instead. Both formats include an isolated Photos-gen1-catalog.*.dar and SHA-512 sidecars. The isolated catalog also goes on disc 1. DAR's last slice contains the embedded master catalog.

Keep all catalog slices and their sidecars in your regular backup. A catalog is useful for incrementals, but cannot replace the discs containing file data. Keep numbered disc folder/ISO names and the folder manifest intact for burn.

Creation has no resume option. If it fails after preparing some folders/ISOs, do not assume the output is a complete set; inspect the failure and retry in a fresh output/workdir. An incomplete folder set has no valid manifest and burn refuses it. Only proceed to Burning after creation succeeds.

Archive names

Names are 1–27 characters, begin with an ASCII letter or digit, and otherwise use only letters, digits, ., _, + and -. They may not contain -catalog or end with -gen followed by digits. These rules also apply to raw mode.

For incrementals, keep exactly the same name for every generation. Use different names for unrelated chains, and do not rename DAR files to change identity. Long names can be shortened in volume labels while staying intact in filenames.

Next: Incrementals and packing · Restoring

Clone this wiki locally