{
  "slug": "filesystem-defragmentation",
  "term": "Filesystem defragmentation",
  "aliases": [],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-16",
  "definition": "Reorganizing a file's storage extents to reduce fragmentation while preserving its logical contents.",
  "note": "Btrfs defragmentation can break extent sharing with reflink copies or snapshots, increasing data-space use. [btrfs-defrag]\n\nThe recursive command in btrfs-progs v6.16 skips nested subvolumes, mount points and directory symlinks; its requested extent size is only a target. Rewriting also needs space reservations. [btrfs-filesystem]",
  "related": [
    "file-extent",
    "free-space-fragmentation",
    "reflink",
    "copy-on-write",
    "transparent-compression"
  ],
  "citations": [
    {
      "id": "btrfs-defrag",
      "title": "Btrfs-progs v6.16: Defragmentation, extent sharing and compression",
      "url": "https://raw.githubusercontent.com/kdave/btrfs-progs/v6.16/Documentation/Defragmentation.rst",
      "accessed": "2026-10-16"
    },
    {
      "id": "btrfs-filesystem",
      "title": "Btrfs-progs v6.16: filesystem defragment, traversal, extent targets and reservations",
      "url": "https://raw.githubusercontent.com/kdave/btrfs-progs/v6.16/Documentation/btrfs-filesystem.rst",
      "accessed": "2026-10-16"
    },
    {
      "id": "hesela-clones",
      "title": "Hesela: Fast file clones and deferred copying costs",
      "url": "https://hesela.com/analyses/file-clones-deferred-copy-cost/",
      "accessed": "2026-10-16"
    }
  ],
  "provenance": [
    "Btrfs behavior follows pinned btrfs-progs v6.16 documentation; other filesystems can have different sharing and traversal contracts."
  ]
}
