Monday, July 18, 2011

How to use DiskPart.exe

I had to increase my SharePoint VM, know why?

Need to restore a production site backup. A personal opinion, it is not advisable to restore production backups which are larger in size say more than 10GB. In my case it was a nightmare with 2 days of effort, all gone in vain. If you have SQL Server 2005 Express, then forget about restore, the DB will only allow not more than 4gb of data, heck!!!!

 

Getting back to the topic, the options I exercised is to increase the size of the disk space. I increased the volume D:

The DiskPart.exe is an efficient tool to increase the volume size

 

Steps to get this done:

1.     Go to command prompt and write diskpart.exe

 

Microsoft Windows [Version 5.2.3790]

(C) Copyright 1985-2003 Microsoft Corp.

 

C:\Documents and Settings\sp_admin>diskpart.exe

 

Microsoft DiskPart version 5.2.3790.3959

Copyright (C) 1999-2001 Microsoft Corporation.

On computer: ALCVMSPD004

 

2.       If you need to see the what all activity we can perform with diskpart.exe then, just make a mistake and it will let you know all it can do for you. I wrote a wrong command and all options were displayed, see easy option to know more he he he Smile

DISKPART> slect volume

 

Microsoft DiskPart version 5.2.3790.3959

 

ADD         - Add a mirror to a simple volume.

ACTIVE      - Marks the current basic partition as active.

ASSIGN      - Assign a drive letter or mount point to the selected volume.

AUTOMOUNT   - Enables and disables automatic mounting of basic volumes.

BREAK       - Break a mirror set.

CLEAN       - Clear the configuration information, or all information, off the disk.

CONVERT     - Converts between different disk formats.

CREATE      - Create a volume or partition.

DELETE      - Delete an object.

DETAIL      - Provide details about an object.

ATTRIBUTES  - Manipulate volume attributes.

EXIT        - Exit DiskPart

EXTEND      - Extend a volume.

GPT         - Assigns attributes to the selected GPT partition.

HELP        - Prints a list of commands.

IMPORT      - Imports a disk group.

INACTIVE    - Marks the current basic partition as inactive.

LIST        - Prints out a list of objects.

ONLINE      - Online a disk that is currently marked as offline.

REM         - Does nothing. Used to comment scripts.

REMOVE      - Remove a drive letter or mount point assignment.

REPAIR      - Repairs a RAID-5 volume with a failed member.

RESCAN      - Rescan the computer looking for disks and volumes.

RETAIN      - Place a retained partition under a simple volume.

SELECT      - Move the focus to an object.

 

3.       To start from beginning, let us do it once more

 

DISKPART> exit

 

Leaving DiskPart...

 

C:\Documents and Settings\sp_admin>diskpart.exe

 

Microsoft DiskPart version 5.2.3790.3959

Copyright (C) 1999-2001 Microsoft Corporation.

On computer: ALCVMSPD004

 

4.       See the listing of the volumes available

 

DISKPART> list volume

 

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info

  ----------  ---  -----------  -----  ----------  -------  ---------  --------

  Volume 0     E   VSSD1        UDF    CD-ROM       103 MB  Healthy

  Volume 1     C                NTFS   Partition     40 GB  Healthy    System

  Volume 2     D   DATA         NTFS   Partition     80 GB  Healthy

 

5.       In my case I have increase the D: so select the appropriate volume you want.

DISKPART> select volume 2

 

Volume 2 is the selected volume.

6.       Now is the time to extend it,  give the size you want to allocate.

DISKPART> extend size = 100

 

DiskPart successfully extended the volume.

 

DISKPART>

 

 

Please post a comment if you have other ways of doing this same thing… I’ll be happy to hear.
If this helps...... then please share......

HaPpY CoDiNg... (Aurum)

No comments:

Post a Comment