Fix Invalid Partition Table Error in Windows 10
In this article
Yes, you can fix the Invalid Partition Table error on Windows 10 by using DiskPart or a third‑party tool like TestDisk. The steps below will restore the partition table and make the drive usable again.
What You’ll Need
- A second computer or an external drive for backups.
- Administrative access to the Windows 10 system.
- Windows 10 installation media (USB or DVD) if the system cannot boot.
- Optional: TestDisk, a free open‑source recovery tool.
Step‑by‑Step
- Back up any recoverable data. If the drive is still readable, copy important files to another storage device. If the drive is inaccessible, skip to step 4 but keep the backup plan ready.
- Open an elevated Command Prompt. Press Win + X and choose Command Prompt (Admin) or Windows PowerShell (Admin). If the menu shows “Windows Terminal”, click the down arrow and select “Run as administrator”.
- Launch DiskPart. In the prompt type
diskpartand press Enter. The DiskPart utility will start and the prompt will change toDISKPART>. - List all disks. Type
list diskand press Enter. Note the number of the disk that shows the error (e.g., Disk 1). - Select the problematic disk. Type
select disk 1(replace 1 with your disk number) and press Enter. DiskPart will confirm the selection. - Clear read‑only attributes. Some drives, especially SSDs, may be marked read‑only. Type
attributes disk clear readonlyand press Enter. Ignore any warning if the attribute is already cleared. - Re‑create the partition table. If you are willing to lose the current data, type
cleanand press Enter. This removes all partitions and the corrupted table. - Choose a partition style. For a modern Windows 10 system use GPT: type
convert gptand press Enter. For legacy systems or if you need a bootable MBR, typeconvert mbr. - Create a primary partition. Type
create partition primaryand press Enter. DiskPart will allocate the entire disk to this partition. - Format the new partition. Type
format fs=ntfs quickand press Enter. Wait for the quick format to finish. - Assign a drive letter. Type
assign letter=E(or any unused letter) and press Enter. The drive should now appear in File Explorer. - Exit DiskPart. Type
exitand press Enter twice to close the Command Prompt. - Reboot the system. Restart Windows 10 normally. If the drive was a system or boot partition, follow the next subsection.
- Repair boot files (if needed). If the drive was the OS disk, boot from the Windows 10 installation USB/DVD. Choose Language > Next > Repair your computer > Troubleshoot > Advanced options > Command Prompt. Run the following commands:
bootrec /fixmbrbootrec /fixbootbootrec /scanosbootrec /rebuildbcd
Common Mistakes
- Running DiskPart on the wrong disk. Always double‑check the disk number after
list disk. - Skipping the
attributes disk clear readonlystep on an SSD, which can preventcleanfrom succeeding. - Choosing
convert mbron a Windows 10 system that requires GPT for UEFI boot. - Forgetting to set the partition as active when repairing a boot disk. In DiskPart, after
select disk 0typeselect partition 1thenactive. - Running
cleanon a drive that still holds essential data without a backup.
Tips
- Use a script file to automate DiskPart commands: create a text file with the commands, then run
diskpart /s script.txtto avoid typing errors. - If the disk is external, disconnect all other USB devices before running DiskPart to avoid confusing the tool.
- For data‑critical drives, try TestDisk first. It can rebuild the partition table without deleting data.
- Keep the Windows 10 installation media handy; many repair steps require booting from it.
- After formatting, run
sfc /scannowin an elevated Command Prompt to verify system file integrity.
Troubleshooting
- DiskPart refuses to clean the disk. The drive may be write‑protected or have a hardware fault. Try
attributes disk clear readonlyagain or use a different USB port. If the problem persists, the drive may need replacement. - After formatting, the drive is still missing in File Explorer. Open Disk Management (Win + X > Disk Management) and look for the disk. If it shows as Offline, right‑click and choose Online. If it shows Unallocated, right‑click and create a new simple volume.
- Boot error persists after
bootreccommands. The BCD store may be corrupted. Usebcdboot C:\Windows /l en-us /s C: /f ALL(replace C: with your system partition) to rebuild it. - The drive is not recognized after a reboot. Check the BIOS/UEFI settings to ensure the SATA mode matches the drive type (AHCI vs IDE). Enable or disable Legacy USB support as needed.
- File system errors appear after the fix. Run
chkdsk E: /f /r(replace E: with the drive letter) to repair bad sectors and file system inconsistencies.
Frequently Asked Questions
Can I recover data after running clean?
Only if you use specialized recovery software before the clean operation. After clean the partition table is removed, so recovery is difficult and not guaranteed.
What if the drive is an SSD?
Use the same DiskPart steps. SSDs often have a read‑only attribute that must be cleared before cleaning.
Will this fix the error on a UEFI system?
Yes, but you must convert to GPT and set the partition active if it is the boot disk. The bootrec commands rebuild UEFI boot entries.
Is TestDisk safer than DiskPart?
TestDisk attempts to rebuild the partition table without deleting data, but success depends on the corruption level. Use it before resorting to clean if data is valuable.
What if the drive still shows as Offline in Disk Management?
Right‑click the disk and choose Online. If that fails, try reconnecting the drive or using a different cable/port.
Can I use Windows 11 tools to fix a Windows 10 partition?
Yes, the same DiskPart and bootrec commands work on Windows 11. The steps are identical.