criu

Irmap (Inode Reverse Mapping)

Irmap is CRIU’s engine for resolving an (inode, device) pair back into a filesystem path. This is primarily required for restoring fsnotify (inotify and fanotify) instances, which internally reference inodes but do not preserve the paths used to create them.

The Problem

When an application creates an inotify watch, the kernel resolves the path to an inode and attaches the watch to it. The original path string is then discarded by the kernel. During a checkpoint, CRIU can see which inode is being watched but needs a valid path to recreate that watch during restoration.

How Irmap Works

Irmap uses a combination of predefined hints and brute-force scanning to build a reverse mapping cache.

1. Heuristic Hints

CRIU starts by scanning “known” locations where applications typically place watches, such as:

2. User-Defined Scan Paths

Users can provide additional directories to scan via the command line to help CRIU find application-specific files more quickly:

criu dump --irmap-scan-path /path/to/my/app ...

These paths are prioritized and scanned before the default hints.

3. Caching and Pre-dump

Scanning large filesystems can be slow and resource-intensive. To mitigate this:

Support for Filesystems

See also