{
  "aliases": [
    "dm-snapshot exception store"
  ],
  "status": "shipping",
  "advantages": [
    {
      "text": "Only chunks changed after creation consume space, so the COW device is often much smaller than the origin.",
      "citationIds": [
        "dm-snapshot"
      ]
    }
  ],
  "limitations": [
    {
      "text": "If the COW device fills up, the snapshot becomes useless, is disabled and returns errors, so free space has to be monitored and extended in advance.",
      "citationIds": [
        "dm-snapshot"
      ]
    },
    {
      "text": "An invalid snapshot cannot be recovered, and metadata with an on-disk version different from the kernel's is not usable because no compatibility is implemented.",
      "citationIds": [
        "dm-snap-persistent"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-23",
  "slug": "snapshot-exception-store",
  "term": "Snapshot exception store",
  "definition": "A snapshot exception store is the metadata on a copy-on-write device that maps changed origin chunks to their saved copies in a classic device-mapper snapshot.",
  "note": "A snapshot reads unchanged chunks from its origin and changed chunks from its copy-on-write (COW) device, and the exception records identify that correspondence. The COW device is therefore not a standalone full-volume image. Each on-disk exception is 16 bytes, an old_chunk and a new_chunk stored as little-endian 64-bit values, so one metadata chunk holds as many entries as its size in bytes divided by 16. [dm-snapshot] [dm-snap-persistent]\n\nIn the persistent format the first chunk holds a header with the magic value 0x70416e53, a valid flag, on-disk version 1 and the chunk size in sectors. A metadata chunk follows, then as many data chunks as it can describe, and the pattern repeats. An exception whose new_chunk is 0 ends the table, because chunk 0 is the header. Without a supplied chunk size the code uses 32 sectors, or 16 KiB, unless the logical block size is larger, which gives 1024 exceptions per metadata area. [dm-snap-persistent]\n\nPersistent stores of type P or PO retain the metadata across reboots, while the transient type N can keep it in kernel memory. The status line ends with sectors_allocated/total_sectors and metadata_sectors, and a merge back into the origin is complete when the allocated figure equals the metadata figure. [dm-snapshot]",
  "related": [
    "snapshot",
    "snapshot-merge",
    "copy-on-write",
    "lvm",
    "volume-manager"
  ],
  "citations": [
    {
      "id": "dm-snapshot",
      "title": "Linux device-mapper: snapshot targets and merge completion",
      "url": "https://docs.kernel.org/admin-guide/device-mapper/snapshot.html",
      "accessed": "2026-10-23"
    },
    {
      "id": "dm-snap-persistent",
      "title": "Linux v6.16 drivers/md/dm-snap-persistent.c: on-disk header, exception records and default chunk size",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.16/drivers/md/dm-snap-persistent.c",
      "accessed": "2026-10-23"
    }
  ],
  "provenance": [
    "Scope: classic Linux dm-snapshot, not dm-thin, filesystem snapshots or exception handling in a programming language.",
    "dm-snapshot is the kernel admin guide page, read for table arguments, store types, the full-device behaviour and the status line.",
    "dm-snap-persistent is the Linux v6.16 source file, read for the disk_header and disk_exception structures, the area layout and the default chunk size.",
    "The 1024 entries per area follow from 16 KiB divided by the 16-byte record and were not measured on a device."
  ]
}
