← Windows boot error index

Fix "Invalid Partition Table" on Windows 10/11 (Exact Commands)

The fast answer. "Invalid partition table" is printed by the master boot code in a disk’s MBR before Windows even starts. It means that code couldn’t find a single valid active partition to boot. Most often the BIOS is booting the wrong disk — unplug every USB drive and external disk and reboot first. If the error stays, boot into Windows Recovery (WinRE), open Command Prompt, and confirm exactly one partition is marked active on the Windows disk:
diskpart
list disk
sel disk 0
list partition
sel partition 1
detail partition
active
exit
Select the small System Reserved partition (or the Windows partition if there is no System Reserved), not partition 1 blindly. Then reboot.

Why this happens

Step-by-step fix

Step 1 — Remove external media and check boot order

Unplug every USB drive, external disk, SD card, and disc, then reboot. If Windows starts, the firmware was booting the wrong device. Enter BIOS/UEFI setup (usually Del, F2, or Esc at power-on) and put the Windows drive first in the boot order. If you see the error while booting a Windows install USB, use the one-time boot menu (often F12) and pick the USB’s UEFI entry instead of the legacy one.

Step 2 — Confirm the drive is detected

In BIOS setup, check that the Windows drive is listed with its correct model and size. If it’s missing or shows a wrong size, power off, reseat the SATA/M.2 connection and cable, and check again. A drive the firmware can’t read properly will not be fixed by any command below.

Step 3 — Get into Windows Recovery (WinRE)

This error appears before Windows loads, so forced restarts usually won’t open Automatic Repair. Boot from a Windows 10/11 install USB, choose Next → Repair your computer, then Troubleshoot → Advanced options. Try Startup Repair first and reboot. If it fails, return to Advanced options → Command Prompt.

Step 4 — Check the partition style and the active flag

Run diskpart, then list disk. A * in the Gpt column means the disk is GPT — GPT disks have no active flag, so the firmware should be booting it in UEFI mode; set UEFI boot mode in BIOS and see the bcdboot rebuild rather than continuing here. For an MBR disk:

sel disk 0
list partition
sel partition 1
detail partition

Run sel partition and detail partition for each partition and note the Active line. The System Reserved partition (typically 100–500 MB) should be the only one showing Yes; if there is no System Reserved partition, the Windows partition should be. To fix it, select the correct partition and run active. If a second partition also shows Active: Yes, select it and run inactive. Then exit and reboot.

Step 5 — Rewrite the MBR boot code and boot sector

If the active flag is correct and the error persists, rewrite the boot code from the same Command Prompt:

bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd

Type Y if /rebuildbcd offers to add a Windows installation. Know the limit: bootrec /fixmbr overwrites only the master boot code, not the partition table. If the partition table itself is damaged, this step won’t fix it.

Step 6 — If partitions are missing or RAW, stop and suspect the disk

If list partition shows no partitions or unallocated space where Windows used to be, or list volume shows the Windows volume as RAW, the partition table is damaged or the drive is failing. Do not create, delete, clean, or convert anything. Run the drive maker’s diagnostic, image the disk to a healthy drive, and work on the image with a partition-recovery tool such as TestDisk or hand it to a recovery service. If a volume is still visible, you can check it with chkdsk C: /f (use the Windows drive letter shown in WinRE) — but only after you have an image.

Data safety: This error lives in the first sector of the disk, and a failing drive is a leading cause. If the files matter and you have no backup, image the whole drive to a known-good external disk before running bootrec or chkdsk. Some guides tell you to run clean and convert gpt in diskpart — that erases every partition. Never do it on a disk holding data you need, and never run repairs on the only copy of irreplaceable data.
GRAM tip: The repairs above run from Windows Recovery on a Windows install USB. Once the machine boots again, plug in GRAM — a free portable repair toolkit that runs from a USB inside Windows — to check the drive’s SMART health and event logs for disk errors, and let its AI agent confirm whether this was a boot-order slip, a bad active flag, or a dying drive so the error doesn’t come back.
Download GRAM free See AI pricing →

FAQ

Can I fix this without a second working computer?

Yes, as long as you have a Windows install USB. WinRE normally lives on the broken PC itself, but because this error stops the boot before Windows loads, you will usually reach it by booting any Windows 10/11 install USB and choosing Repair your computer. Every command on this page runs there. No second computer is needed for the repair. (GRAM runs inside Windows rather than from boot media — use it once the machine boots to verify disk health and confirm the root cause.)

Will marking a partition active or running bootrec erase my files?

No. active and inactive change only the boot flag in the partition table, and bootrec rewrites boot code and boot configuration, not your files. The risk is marking the wrong partition active, which can stop the PC from starting until you correct it. Image the drive first if the data is irreplaceable.

Why does this happen on UEFI computers?

The message comes from MBR boot code, which only runs when the firmware boots a disk in Legacy/CSM mode. On a UEFI PC it usually means the firmware fell back to legacy booting of a USB stick or a second disk. Unplug extra drives, set the Windows drive first in the boot order, and boot install media through its UEFI entry.

bootrec /fixmbr didn’t work — is the drive dead?

Not necessarily, but it’s a warning sign. bootrec /fixmbr replaces only the boot code; if the partition table itself is damaged, it can’t help. Check whether diskpart still lists your partitions and run the drive maker’s diagnostic. Missing or RAW partitions mean you should image the disk and use partition-recovery tools on the copy.

Related: BOOTMGR is missing · Operating system not found · All Windows boot error codes