← Back to Recovery methods

Partition Table Recovery and Filesystem Discovery

A partition table records where partitions begin and end. What sits inside a partition — a filesystem, an APFS container, an LVM or RAID member, an encrypted volume — is described by that layer’s own metadata. When the table is lost or wrong, those structures can often be found and checked at their original offsets before any new table is written.

In short
  • A partition table maps partitions, not files; one partition may hold a filesystem, a container, a RAID or LVM member, or encryption.
  • Establish what the source presents — disk, member or assembled volume, logical sector size, capacity — before trusting any offset.
  • A valid GPT checksum shows an intact structure, not that it describes the current layout or the data you need.
  • A discovered filesystem is a candidate until its range, features and contents are consistent and the needed files check out.
  • Initializing, formatting, repairing or rewriting the table writes to the disk; none of them is a diagnostic step.
Diagram distinguishing partition-layout discovery, virtual filesystem reconstruction and file recovery as three separate operations.
Partition-layout discovery is one step in this stack. A partition can hold further layers — a container, a RAID or LVM member, encryption — before a filesystem appears, and each layer is discovered and checked on its own.

The partition map and what lives inside it

MBR and GPT entries describe partitions: a start, a size or end, and a type. They do not normally contain files. The partition holds whatever the next layer wrote there — often a filesystem, but equally an APFS container with several volumes, an LVM physical volume, a RAID member, or an encrypted volume whose filesystem only appears after unlock. One partition is not necessarily one filesystem, and a filesystem can occupy a whole device with no partition table at all, a layout common on removable media.

Losing the map is therefore a different event from losing what it pointed to. Boundaries are reconstructed from several kinds of evidence together: a backup table where the format has one, the boot sector or superblock of each candidate, its size fields, neighbouring partitions and the conventions of the tool that created the layout. No single boot sector tells you every boundary on the disk. See Understanding Storage Layers Before Recovery for the wider stack.

Check what the source presents before scanning

Partition structures count in logical blocks (LBAs), and the UEFI specification notes that a device may present a logical block size other than 512 bytes. The same GPT therefore sits at different byte offsets on a 512-byte and a 4096-byte presentation, and every offset found in a scan is only meaningful against the sector size it was read with. A USB bridge, an enclosure or a RAID controller can change the presented sector size or capacity, and a RAID member is not the assembled volume the table was written for.

Before a signature scan, record which object is being read (bare disk, one member, an assembled array, a decrypted view), its logical sector size, its reported capacity and anything in the path that translates them. A wrong capacity or a prompt to initialize is a symptom that any of these can produce; it is not on its own a diagnosis of a damaged GPT. See Drive Shows the Wrong Capacity and Drive Asks to Be Initialized.

A full scan also reads the whole device. On a failing drive that load is not free, so scanning belongs on a preserved copy, or inside an acquisition plan that decides what to read first.

GPT: two copies, two checksums, and what they prove

UEFI 2.10 places a protective MBR at LBA 0, the primary GPT header at LBA 1 followed by the primary partition-entry array, a backup entry array after the last usable LBA, and the backup header at the last LBA of the device. The header carries a CRC32 of itself and a CRC32 of the entry array. The specification’s validation checks the signature, the header CRC, that the header’s own LBA field points where it was read from, and the entry-array CRC, and tells software to check the last LBA when the primary is invalid.

A valid CRC shows that a structure is intact as written. It does not show that the table is current, that it belongs to this disk rather than one it was cloned from, or that the partitions it lists still hold intact files. Two copies can each validate and still disagree — after an interrupted repartition, or when a tool rewrote one copy and left the other. Compare them, then check disk identity, the listed ranges against the geometry, and filesystem evidence inside each range.

The specification also requires software to restore the primary from a valid backup (asking the user first where policy allows). That is an operational rule for keeping a working disk consistent. It is a write, not a prerequisite for reading data, and having a backup copy does not make blindly copying it over the primary safe on a disk whose data still matters.

When the reported capacity has changed

If the disk is now read through a different bridge or controller, or reports a different size for another reason, the backup structures written for the original layout may sit inside the current address space or beyond the end that can now be reached. The primary header records where its alternate header was expected and which range was usable; those values describe the old geometry, not necessarily the current one.

Moving the backup header to the newly reported last LBA is not a sensible first step: it is a write that commits to one hypothesis. Record both geometries — the one implied by the existing headers and the one presented now — and test each against the filesystem evidence on a copy.

MBR and the extended partition chain

Legacy MBR holds four 16-byte partition entries in sector 0, with no mandated backup elsewhere on the disk. That does not mean MBR disks have only four partitions or a single structure to recover. Microsoft’s description of basic disks documents an extended partition whose logical drives are each described by an extended boot record (EBR): the first entry points to that logical drive, the second to the next EBR. The EBRs form a linked list.

A damaged link can hide every logical drive after it while those drives themselves stay intact, so discovery follows and preserves the whole chain rather than reading sector 0 alone. Alignment conventions used by partitioning tools are a hint where to look for the next boundary, not evidence that one is there.

A discovered filesystem is a candidate

A useful discovery result has four parts: an offset, a size or range, a format with its features, and consistency between that format’s metadata and the data in the range. A signature at an offset supplies only the first. Reused and repartitioned disks often carry several historical signatures, and an old boot sector or superblock left by an earlier format can be structurally valid while describing a filesystem that is no longer the one needed.

Illustration: a recreated partition at the wrong offset

Observed

An NTFS volume originally began at sector X. A partition entry was later recreated by guesswork and begins at a different sector. Windows now shows an unknown or RAW volume.

Interpretation

The operating system is reading the wrong sector as the boot sector. The volume at X may be largely intact, or may have been partly overwritten since the mistake; only checking the structures at X shows which.

Next step

Model a boundary at X virtually, against a copy, and check the boot sector, MFT and needed files there before changing any table.

Limit

A conceptual example. Other formats and offsets fail differently, and a wrong offset does not always produce RAW.

Inspection, virtual mapping, extraction and rewriting

Four kinds of work are often blurred together:

  • Inspection reads tables, boot sectors and superblocks to build hypotheses.
  • Virtual mapping presents a candidate boundary as a volume over a copy or a read-only view, without writing a table.
  • Extraction copies the needed files from a validated mapping to a separate destination.
  • Partition-table rewrite changes the disk so that the operating system finds the volume again.

The first three do not need the fourth. Initialize, format and repair prompts are not diagnostics either. Microsoft documents disk initialization as initializing the disk and its partition table; it does not necessarily overwrite every payload sector, but it replaces the partitioning metadata that discovery depends on, and a format adds a new filesystem’s metadata on top. Writing a corrected table is a step for returning a disk to service, after the needed data has been extracted and the boundaries validated. See Partition Recovery vs. File Recovery, Hex Editors & Disk Structure Viewers and Filesystem Structure and Metadata Recovery Tools.

Validating the result

A list of found partitions does not confirm that the files in them are complete, and a volume that mounts does not either. The result is accepted when:

  • the needed directories and files open, and their content checks out by format, in the applications that use them, or against known hashes;
  • every accepted range lies within the device, fits its logical sector size and has no unexplained overlap with another range;
  • unread or skipped ranges are recorded, together with the files they touch;
  • the original addressing — sector size, capacity, offsets — is documented, so that the mapping can be reproduced.

Where several copies of partition or filesystem metadata disagree, Storage Metadata Generations and Consistency covers how to choose between them.

Practical rule

Treat each discovered filesystem as a candidate with an offset, a size and a format. Extract and validate what is needed through a virtual mapping on a copy before deciding whether a partition table should be written at all.

Technical references: UEFI 2.10, §5.2–5.3: GPT disk layout — locations, CRC32, validation and restore rules · Microsoft: How Basic Disks and Volumes Work — MBR entries, EBR chain · Microsoft: IOCTL_DISK_CREATE_DISK — what initialization does. UEFI 2.10 is the version checked; the EBR description comes from a Windows Server 2003 technical reference, and partitioning tools differ in their layout conventions.

Related: Drive Asks to Be Initialized · Partition Loss · Drive Shows as “RAW” · Drive Shows the Wrong Capacity · Computer Won’t Boot but the Drive May Still Be Healthy · NTFS MFT, Allocation and File Reconstruction · Partition Recovery vs. File Recovery · Hex Editors & Disk Structure Viewers