Share via

Diskpart question on cleaning and restore MBR/VBR/GPT

Anonymous
2024-11-11T02:48:18+00:00

virused hard drive. Reset recovery did not work. The virus is in the MBR. Now getting prepared to clean the HDD partiton for the OS, and also need to clean the MBR, restore the MBR/VBR/GPT.

I am not finding what I need in a youtube video. Is there a good tutorial someone can steer me to?

Lets say that my boot sector is in 0.

DISKPART> selct disk 0

DISKPART> clean

DISKPART> this is where I'm not clear. How does the good copy

of the MBR / VBR/ GPT get introduced to the tool?

Windows 10.

Windows for home | Windows 10 | Windows update

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-11-12T09:03:58+00:00

    Hello Steve Klein1 and welcome to the Microsoft Community!

    Based on your feedback that you are experiencing problems cleaning and recovering Diskpart from MBR/VBR/GPT

    First of all, I noticed that the hard disk is infected with a virus.

    Therefore, I would recommend that you format it if possible.

    If you have a lot of files to keep and don't want to format it

    I recommend you to run a full disk scan with antivirus software or windows defender first

    to avoid virus infection on your whole computer

    Then when it comes to cleaning and recovering MBR (Master Boot Record), VBR (Volume Boot Record) and GPT (GUID Partition Table)

    please follow the steps and instructions below.

    This process will erase all data on the disk, so make sure you have backed up your important data.

    1)Steps to Clean and Recover MBR/VBR/GPT

    1. intend
      • Using Windows 10 installation media (USB or DVD), you can download and create a boot disk from Microsoft's website.
      • download link:Download Windows 10
      • Navigate to the installation media and select “Repair Computer”.
    2. Enter the command prompt
      • In the Recovery menu, select Troubleshooting > Advanced Options > Command Prompt.
    3. Use Diskpart to clean up the disk:
      • Once at the command prompt, enter the following command to start Diskpart:

    cmd

    diskpart 

      4.Then select the destination disk (assuming disk 0):
    

    cmd

    select disk 0 

       5.Clean up the disk:
    

    cmd

    clean 

       6.这将删除所有分区和数据,并清除 MBR/GPT。
    
       **2)Rebuild MBR/VBR/GPT:**
    

    Click on the windows key + R key, click on CMD, and enter the following command

    1. For MBR:

    Enter the following command to rebuild the MBR:

    convert mbr 

    1. For GPT:

    Enter the following command to rebuild the GPT:

    convert gpt 

    1. Creating partitions and formatting:

    After cleanup and conversion, you need to create new partitions:

    create partition primary 

    1. Then format the partition (assuming the newly created partition is the first):

    format fs=ntfs quick 

    1. Assign drive letters to partitions:

    assign letter=C 

    1. Recovering VBR (Volume Boot Record):

    VBRs are automatically cleaned up when the disk is cleaned up, and after rebuilding a partition, formatting the partition creates an appropriate VBR.

    7.Loading Windows:

    If you already have Windows installed, you can use the following command to install the boot manager:

    bcdboot C:\Windows /l en-us /s C: /f ALL 

    1. Reboot your computer:

    Type exit to exit the command prompt, reboot the computer, and check that the new operating system boots properly.

    take note of

    • When doing so, make sure you understand the risk of data loss that may result.
    • After recovering MBR/VBR/GPT, make sure you reinstall the operating system to prevent any remaining viruses.

    If you encounter any problems while executing these commands, please feel free to ask and I'll be happy to help you!

    We hope you find the above information helpful

    Kirito|Microsoft Community Support Specialist

    1 person found this answer helpful.
    0 comments No comments