Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

How fileset works

This page explains what a manifest holds, what a check compares, and what fileset cannot see. Commands and options are in the reference.

What a manifest records

fileset init walks the tree and records one entry for every file, directory, symlink and other item it finds. Each entry holds:

  • the path and the type: directory, regular file, symlink, fifo, socket, character device or block device;
  • for a regular file, a BLAKE3 checksum of its content;
  • for a symlink, its target; for a device, its device numbers;
  • permissions, owner and group, size, modification time and link count;
  • extended attributes, which are named values some file systems attach to a file.

The manifest is a SQLite file, .fileset.sqlite, at the top of the tree. A second backend, fjall, stores it as a directory. The default is the one to use unless you have a reason.

update keeps a stored checksum while a file’s size, modification time and inode are unchanged. That is what makes it fast, and why you check before you update.

Comparison tiers

check compares a tree with the manifest. How much it compares depends on the tier.

There are three tiers: relaxed (content only, plus type, symlink target and device numbers), the default (adds permissions, modification time and size) and paranoid (adds owner, group, link count and extended attributes). The table of exactly which fields each tier compares is in the reference.

Pick the tier by what the copy tool can keep. A plain cp or an rclone copy to a backend without permissions fits --relaxed. An rsync -a copy between machines that share user ids fits the default plus --require uid --require gid. --ignore and --require adjust any tier one field at a time.

The tier decides what counts as a difference. Content is compared in every tier, so changed bytes always show.

What fileset cannot catch

fileset reports differences in what it records. Some things it does not record, or does not compare, so a copy can differ from the original and still pass.

  • Holes in sparse files. fileset hashes the bytes a program reads. A hole reads as zeros, so a sparse file and a fully written copy of it have the same checksum. A check cannot tell whether a copy kept the holes.
  • Hard links. Only the link count is recorded, and it is compared only with --require nlink or --paranoid. fileset does not record which paths share a file, so a copy that turned hard links into separate files passes the default check.
  • ACLs on macOS. Access control lists are not recorded.
  • Anything it did not look at. Mount points are not crossed unless you pass --cross-mount-points. A tree with btrfs subvolumes is cut short by default. A warning names the directory. check reports what lies below as unverified, which counts as a difference. update drops it from the manifest.
  • Timestamp precision. Modification times are compared to the nanosecond. A file system with coarser timestamps shows mtime= changes on every file. Use --ignore mtime or --relaxed.
  • A manifest that is wrong from the start. fileset compares against what it recorded. If the tree was already damaged at init, the manifest records the damage.

The reference lists two more: symlink permission bits between Linux and macOS, and the sparse journal of the fjall backend.

fileset reports and repairs nothing, and it never changes the tree.