Partitioning and Formatting Blank Drives in Vista


October 23rd, 2008

Recently, I feared that one of my USB drives might be failing, so, after moving the data off of it, I ran it through the gamut of diagnostics, including writing zeros to the drive, which, of course, blew away the data and partition table.

When I went to the Computer Management -> Storage -> Disk Management console in Vista, the drive was there, sure enough, showing as “Unallocated”. I right-clicked and went to create a New Simple Volume.

Normally, this works. I followed the prompts which asked me for the partition’s size, drive letter, and filesystem format, but to no avail. “The operation cannot be completed because the disk is not initialized.”

On closer inspection of the Disk Management screen, sure enough, the drive says Not Initialized, instead of the typical “Online”.

I could find no way to initialize this disk via the GUI. Since I have a genetic aversion to GUIs anyway (especially the useless ones), I bailed out to an Administrator command prompt.

Update

[2008-Nov-18]: As Brian wisely pointed out in the comments, it is actually possible to initialize a disk from the GUI, by right-clicking the Disk Name (i.e., the column heading to the left, in the above picture). This will actually spare you from DiskPart (below). Thanks Brian!

DiskPart to the rescue

DiskPart allows free editing of partitions. Standard disclaimer, here: if you’re not 100% sure of what you’re doing, don’t do it. It is quite possible to mess up your system and/or lose data using this tool.

So, here’s how to rebuild a disk that has been overwritten with zeros, random bits, or worse.

Step 1: Load DiskPart, and find the desired disk

C:\>diskpart

Microsoft DiskPart version 6.0.6001
Copyright (C) 1999-2007 Microsoft Corporation.
On computer: VISTA-PC

DISKPART> LIST DISK

Disk ###  Status      Size     Free     Dyn  Gpt
--------  ----------  -------  -------  ---  ---
Disk 0    Online       233 GB      0 B
Disk 1    Online       932 GB      0 B
Disk 2    Online       466 GB   466 GB
Disk 3    No Media        0 B      0 B
Disk 4    No Media        0 B      0 B

Here, we see that Disk 2 is the one we want (it is also the only one with free space, which is reassuring).

Step 2: Select the disk

This tells diskpart that any operations we want to run will affect Disk 2.

DISKPART> SELECT DISK 2

Disk 2 is now the selected disk.

Step 3: Create a primary partition

DISKPART> CREATE PARTITION PRIMARY

DiskPart succeeded in creating the specified partition.

DISKPART> ASSIGN LETTER=I

DiskPart successfully assigned the drive letter or mount point.

DISKPART>

And, seconds later, a format prompt window popped up.

Success! After a full format, the drive is back in business.

Microsoft TechNet has a good article on DiskPart here: http://technet2.microsoft.com/WindowsServer/f/?en/Library/19a9ac4d-d151-4fde-b187-9f8dfa09cb351033.mspx

DiskPart itself has some decent online help, by typing “HELP” at the prompt.

Happy formatting!

6 Responses to “Partitioning and Formatting Blank Drives in Vista”

  1. Jason Says:

    Glad to see you blogging again.

  2. Najlepsze Programy, Recenzje, Informacje. » Blog Archive » Partitioning and Formatting Blank Drives in Vista Says:

    [...] Original post by Ryan Thompson [...]

  3. Ryan Thompson Says:

    Thanks Jason. It was not a good summer for blogging, unfortunately!

  4. Tuang Says:

    I just got a HDD with the same problem you posted here. Thanks, man.

  5. Tao la Duc Says:

    Thank you so much, bro

  6. Jordan Peacock Says:

    Thanks for the guide! The part about right-clicking the name to initialize the disk was the missing piece in my case.