using diskpart clean

tSatoZi

Reputable
Aug 9, 2014
26
0
4,530
does diskpart clean function delete your mbr/gpt volume? Or do I need to use Gparted or other partitioning software.

Say that I have bad sectors as another user said
"There would be no other damage but a new mbr would have to be written and new format sectors would have to be written."

will

diskpart
select disk 0
clean

do the trick? Or is it
clean all
 
Solution
If you are doing a fresh install then just do what I said previously. Select Custom install. You will see your drive and it's partitions listed. Select each one and delete them one at a time until all the space is unallocated. Then select the unallocated space and then create a partition (presumably you'll want to use the entire drive), if you are using the entire drive, the installer will tell you that it needs to make a small system recovery partition (500MB for Windows 10) and it will create the partition(s). Once the installer creates the partitions, the installer will proceed to install Windows on the new partition. The MBR will be created with the new partition. There is no need to format as this is done as part of the...
Are you trying to delete and remake the partitions prior to re-installing Windows? If so, you can do this from inside the Windows installer. Just select Custom instead of Upgrade / Install. Then you can see and delete the existing partitions from there.
 

tSatoZi

Reputable
Aug 9, 2014
26
0
4,530


I want to know if it will rebuild mbr and sectors so that bad sectors from any damage (i.e. magnets)
At the windows 7 installation screen pressing shift+f10 brings up the command prompt, will running diskpart, clean, and installing windows rewrite the mbr? Or just reuse the unallocated partition
 
This is what the diskpart command (clean option does)

Removes any and all partition or volume formatting from the disk with focus. On master boot record (MBR) disks, only the MBR partitioning information and hidden sector information are overwritten. On GUID partition table (GPT) disks, the GPT partitioning information, including the Protective MBR, is overwritten; there is no hidden sector information.
all
Specifies that each and every sector on the disk is zeroed, which completely deletes all data contained on the disk.

However if you are trying to do this from your boot volume, Windows will not allow you to do this from inside it. If this is a secondary drive, then Windows will allow this from the Command prompt.

As far as mapping bad sectors, if they were mapped before this was attempted, they will already be re-mapped via the firmware on the drive. If they haven't been mapped already (ie the damage is new), then only a chkdsk /r (or similar) which forces a surface scan on the volume will map new bad sectors.
 

tSatoZi

Reputable
Aug 9, 2014
26
0
4,530


No, I mean when installing a fresh copy of windows with a hard drive that needs have a initialize a mbr
 
If you are doing a fresh install then just do what I said previously. Select Custom install. You will see your drive and it's partitions listed. Select each one and delete them one at a time until all the space is unallocated. Then select the unallocated space and then create a partition (presumably you'll want to use the entire drive), if you are using the entire drive, the installer will tell you that it needs to make a small system recovery partition (500MB for Windows 10) and it will create the partition(s). Once the installer creates the partitions, the installer will proceed to install Windows on the new partition. The MBR will be created with the new partition. There is no need to format as this is done as part of the install.

 
Solution