RSS

Scripting new storage using diskpart

24 May

To quickly provision new disks in your 2008R2 servers, you can use the following script and using “diskpart /s scriptname.txt” to provision new disks in 2008R2 servers. Of course you should always VERIFY the disk number and also modify it according to your needs. The script will online, initialize with MBR, create a single primary partition, assign drive letter and quick format the disk.

SELECT DISK 1
ATTRIBUTES DISK CLEAR READONLY
ONLINE DISK
CONVERT MBR
CREA PART PRIM
ASSIGN LETTER=D
FORMAT LABEL=”DataD” QUICK

 

Advertisements
 
2 Comments

Posted by on May 24, 2012 in Scripts, Windows, Windows CMD

 

Tags:

2 responses to “Scripting new storage using diskpart

  1. eve hotsyouth

    January 3, 2013 at 12:36 am

    how can we do it with vb scipt so that the script choose the uninitialized disk andassign drive letter and label the disk smartly

     
  2. Kelvin Wong

    January 3, 2013 at 10:18 pm

    It should not be that difficult, you will have to write a VBScript the runs a diskpart list disk command. The script will then read and figure out which disk has not been initialized and then you write all necessary commands into a text file and run diskpart with that text file.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: