Skip to content

Instantly share code, notes, and snippets.

@joeypiccola
Created February 2, 2017 18:29
Show Gist options
  • Save joeypiccola/02dd1daa1b528c209a71be6bb351ebad to your computer and use it in GitHub Desktop.
Save joeypiccola/02dd1daa1b528c209a71be6bb351ebad to your computer and use it in GitHub Desktop.
Use diskpart to online, initialize, and format disks
diskpart
select disk 1
attributes disk clear readonly
online disk
select disk 1
clean
convert gpt
create partition primary
format quick fs=ntfs label="data" unit=64k
assign letter=“E"
@modernassist
Copy link

Thanks much; i am about to use this script right now...

Copy link

ghost commented Aug 30, 2020

ive been looking for this too long. thank you

@nicholasxng
Copy link

Kudos, my Data disk has been giving me fits and I don't want to keep rebooting. Hopefully, this is the cleaning it needs.

@alvonellos
Copy link

Thank you. This helped me to refer when I was cloning a disk using Acronis and needed to initialize it in recovery first.

@ziggywireless
Copy link

This helped me recover my disk - step 3 was the key

@Sarijen
Copy link

Sarijen commented Jun 11, 2025

Quick and simple, thanks for the cheatsheet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment