← Back to Recovery methods

Allocation Metadata, Orphaned Files and Lost Space

Allocation metadata records which space is in use; namespace metadata records which objects can be reached by name. The two can disagree, and when they do, recovery can sometimes find file records with no directory link and export them to a separate destination. Neither allocated space nor a surviving record proves that a file’s content is complete, and unallocated space is not proof that it was erased.

In short
  • Used space and visible files come from different metadata, and how each is counted depends on the layer and the tool.
  • Used space without visible files often has an ordinary cause: hidden or system data, snapshots, reservations, shared extents, open files.
  • “Orphan” means different things: a tool’s record without a directory link, or ext4’s tracking of unfinished operations.
  • A surviving record or inode is a candidate; its extent map and its bytes are checked separately before export.
  • Repairing bitmaps, relinking or replaying changes ownership and free space; recover what is needed from a copy first.
Diagram contrasting allocated extents reachable from the directory tree with allocated extents that have no namespace reference.
Allocated extents can lack a namespace reference. Recovery reads such records and exports what checks out to a separate destination; it does not need to relink them in the original filesystem.

Allocated and reachable are two questions

Filesystems derive used-space accounting from allocation or reference metadata, and file visibility from directory or tree metadata. Space can be allocated without being reachable by any name; that is the core of “files missing, but the volume still reports space used.”

Two corollaries matter for recovery. Allocation does not prove that a complete file is present: allocated space can belong to a file that was only partly written, or have been reused. And unallocated space is not the same as lost or erased: deleted content often remains until the space is reused. The numbers themselves also depend on who is counting — a file manager, the operating system’s volume statistics, a container shared by several volumes, a thin pool or a quota system.

Check the ordinary explanations first

Much “missing” space has an explanation that needs no repair. Not every filesystem has every one of these features:

  • files hidden by attributes or permissions, protected system files, and folders the current account cannot list;
  • a recycle bin, snapshots or previous versions;
  • quotas, reservations and preallocated files;
  • sparse or compressed files, whose logical size differs from the space they occupy;
  • files that were deleted while a process still holds them open;
  • hard links, clones and deduplicated or shared extents, which make per-folder sizes add up wrongly;
  • accounting at the container level, where several volumes share one pool of space.

Microsoft’s older NTFS article on misreported disk space lists similar causes — attributes and permissions, alternate data streams, cluster size, grown metafiles, long or invalid paths — alongside genuine corruption. It was written for Windows Server 2003, so its procedures are not a guide to current systems, but its list of causes still shows how much of this is ordinary. See Files Missing but Storage Space Is Still Used for the symptom-level checklist.

NTFS: cluster bitmap, MFT records and indexes

NTFS keeps several distinct allocation records. The $Bitmap file records which clusters are in use; a separate bitmap attribute of $MFT records which MFT records are in use; directories are indexes that map names to records. Small files and folders can be held entirely inside their MFT record, with no separate data clusters, so a model in which every file is a list of extents is incomplete.

An MFT record can keep its run list after the file is unlinked, but the record or the clusters it lists may since have been reused. A valid record signature and plausible timestamps do not prove that the record still describes the clusters’ current owner. Microsoft’s KB also notes that in rare cases $MFT or $Bitmap corruption causes lost disk space, and that CHKDSK can report correcting free space marked as allocated. See NTFS MFT, Allocation and File Reconstruction.

ext4: inodes, directory entries and orphan tracking

An ext4 inode holds a file’s metadata and its extent tree; a directory entry only maps a name to an inode number. A directory entry can be lost while the inode and its extents survive, which is what metadata-aware recovery looks for.

ext4’s own “orphan” mechanism is something else. The kernel documentation describes it as tracking inodes that were removed from the directory hierarchy while still open, and files being truncated or extended in operations that do not fit in one journal transaction, so that after a crash their blocks can be cleaned up. The list is kept from the superblock or, with the orphan-file feature, in a dedicated inode, and is processed at mount. It is not an index of recoverable lost files and not a sign of corruption by itself. Mounting, journal replay or a filesystem check can process and change these entries, and an inode on the list may be one whose extra blocks were due to be truncated, not a complete file waiting for export. See ext4 Superblocks, Inodes, Extents and Journal.

APFS: snapshots, clones, hard links and shared space

On APFS, snapshots can retain blocks that the live filesystem no longer references. A clone, in Apple’s description, is a copy of a file that initially occupies no additional space: the two files share unmodified blocks and changes are written elsewhere. A hard link is a different thing again: several names for one object. None of these is corruption, and none is interchangeable with the others.

All volumes in an APFS container share its free space, and Apple notes that adding up the free space reported by each volume is not a reliable way to determine the total. For the same reason, adding up logical file or folder sizes does not give independent physical usage when clones and snapshots share blocks. See APFS Containers, Object Maps and Recovery States.

What “orphaned” means, and what it does not prove

In recovery-tool terminology, an orphan candidate may lack a valid directory link. In ext4, orphan tracking can also cover an inode whose truncate or extend operation is unfinished, even while it remains linked. Neither meaning establishes that the file is intact. Three things are checked separately:

  • the record itself: structurally valid, and not reused by a newer file;
  • its extent map: within the volume and consistent with the filesystem’s ownership and sharing rules; any overlap has to be explained by valid sharing, such as a clone or snapshot, or treated as a possibly stale or conflicting mapping;
  • the bytes: consistent with the file format and, where possible, with known content.

Names and paths may be partly or entirely lost. How often orphaned records yield usable files depends on the filesystem, how much has been written since and what happened to the volume; this page does not rank it as a reliable tier.

Metadata reconstruction and carving are not a fixed ladder

Directory traversal, alternate or redundant metadata, orphaned records, partial extent reconstruction and file carving are different techniques, not mandatory rungs. They can run in parallel on different areas or file types, and the order follows the state of the source, the structures that survive and the files that are needed. There is no requirement to finish every full metadata scan before carving a format that metadata cannot reach. Carving is also not limited to nameless fragments: some formats carry embedded names and timestamps, and format-aware tools can reassemble some fragmented files. See Metadata Recovery vs. Raw Recovery, File-System Recovery vs. File Carving, Filesystem Structure and Metadata Recovery Tools and File Carving, Explained.

Repair changes the evidence

Correcting a bitmap, relinking records into a lost-and-found directory, or replaying a journal all change ownership and free space. A repair can free clusters that still belonged to a not-yet-recovered file, after which new writes may reuse them, and it can discard orphaned metadata to make the filesystem consistent. A corrected free-space count shows that the volume is consistent again, not that recovery was maximised.

Preserve first, in the form the source’s health and the scope of the case allow — a full image, a copy of the volume, or a targeted export from a failing source — then recover from that copy. Repair belongs to returning the volume to use, after the needed data exists elsewhere. This page gives no CHKDSK or fsck procedure.

Validating recovered files

  • Identity. Which record or inode a file came from, and from which generation or snapshot.
  • Content. Extents and bytes consistent with the format; files open in the applications that use them.
  • Names and paths. Correct where they were restored, marked where they were reconstructed or lost.
  • Secondary data. Alternate data streams, extended attributes or attachments where they matter.
  • Gaps. Known missing or unreadable ranges and the files they touch.

Files that share extents, such as clones or hard links, are not independent recovered copies of each other. And a used-space total that now matches is not evidence of a complete result. See Storage Metadata Generations and Consistency for choosing between generations of metadata.

Practical rule

Treat used space and visible files as two separate questions. Rule out the ordinary explanations, preserve the volume, and export candidate files to a separate destination for validation before anything repairs or relinks the original filesystem.

Technical references: Linux kernel: ext4 orphan file — what orphan tracking records, cleanup at mount · Microsoft: Master File Table — $Bitmap vs. MFT record bitmap · Microsoft KB 814594 — causes of misreported NTFS space · Apple: About Apple File System — clones, shared free space. Small files held inside the MFT record are described in Microsoft’s File Systems reference for Windows 2000. KB 814594 and that reference describe older Windows versions; the ext4 page describes the current kernel, and the orphan-file feature depends on how the filesystem was created.

Related: NTFS MFT, Allocation and File Reconstruction · APFS Containers, Object Maps and Recovery States · ext4 Superblocks, Inodes, Extents and Journal · Files Missing but Storage Space Is Still Used · Metadata Recovery vs. Raw Recovery · File-System Recovery vs. File Carving