Diskpart Command and how to use it

There are lots of powerful command built in Windows and “DiskPart” is one of the most powerful tool to manage partitions like creating, deleting, formatting, extending partitions etc. Recommended tutorial: How to resize Windows 7/vista/XP partition with freeware Partition Wizard Home ; To resize server partitions, we recommend tutorial: resize server partition with Partition Wizard Server Edition

What exactly can we do with “Diskpart”?

1, Convert.

There are many converts we could do with “Diskpart”. 1, We can convert a basic disk to a dynamic disk without data loss. 2, We can convert a dynamic disk back to a basic disk. At this situation, all the existing volumes shall be deleted at first and then we can perform “diskpart” to convert the dynamic disk back to a basic disk. 3, Convert MBR disk to GPT. 4, Convert GPT back to MBR. Why should we perform the above convert? We shall know the benefits.

A basic disk VS a dynamic disk

Dynamic disk can construct dynamic volumes like simple volume, stripped volumes, mirrored volume, spanned volume, raid 5 volume. To convert a dynamic disk to a basic disk. You must delete any dynamic volumes before the conversion process. It is not recommended that you delete partitions on a dynamic disk except in emergency situations. It is recommended that you delete all volumes on the drive, and then convert the disk to basic. You must delete all dynamic data partitions. Also, never mix the basic primary and dynamic partitions on the same drive. If you do so, the computer may be unable to restart. Fortunately Paragon Partition Manager can convert dynamic disk to basic disk without data loss.

If you are running Windows 7, XP/VISTA/2000, you can try freeware Partition Wizard Home.

If you are running Windows Server 2000/2003/2008, you can try Partition Wizard Server Edition.

MBR disk VS GPT disk

Usually we use MBR disk which can hold at most 2 T. However if larger disk is needed like more than 2 TB, then we shall convert MBR disk to GPT disk since GPT disk could hold more TBs.

With Diskpart, you can convert a disk from basic to dynamic. Go to “Start”—“Run”—type “diskpart”—type “list disk”—type “select disk #”(#is the number of your disk which you want to convert)—type “convert dynamic”, “convert basic”, “convert GPT”, “convert MBR” according to your own requirements. In fact you may also perform the above changes under disk management. Go to “My Computer”, right click and go to “Manage”. Go to “Disk Management” and select the basic disk and right click, and then there is a choice to convert it to dynamic disk. Then done, no data loss. With Diskpart, you may do it as following:

There are a few rules you need to keep in mind. The basic disk can be a data disk or system or boot drive. The basic disk can either be empty or contain either primary partitions or logical drives. The basic disk cannot have fault-tolerant disk driver (FtDisk) sets such as stripes or mirrors. To convert basic disks that have FtDisk driver sets, use Disk Management on Windows 2000 or convert the disk before you upgrade to Windows XP.

2. Creat/delete a partition

You can use Diskpart to create a partition at an explicit disk offset. The Disk Management snap-in places the partition at the end of any occupied area or on the first sufficiently large area. On master boot record (MBR) disks, the partition offset and the size are rounded to preserve the required cylinder alignment. Offsets are rounded to the closest valid value, and the size is always rounded up to the next valid value. Diskpart does not assign a drive letter to a newly created partition. Use the assign command to assign either a mount point or a drive letter.

You can use Diskpart to delete missing dynamic disks. Dynamic disks contain a shared database; all of the dynamic disks on a computer have knowledge of all other dynamic disks on that computer. When dynamic disks are moved, the original computer considers theses disks as "missing".

3, extend partition size

We can use diskpart to resize partition without data loss. By “resize partition”, it means to extend partition. However there are many rules for extending partition.

  • It is not the system partition
  • It is NTFS partition not FAT
  • There is free space right besides the partition
  • If it is the dynamic disk, it should be only simple volume and spanned volume.

You can perform the diskpart to extend partition on both Windows OS for home and Server. The steps are as the following:

  • Start—Run—diskpart
  • type “list volume”
  • type “select volume #” (select the number which partition you want to extend), for example: select volume 2
  • type “extend”

If it is the system partition usually c drive you want to resize to extend the space or there is no free space on the same disk or it is RAID5, Stripped volume, mirrored volume, here are the solutions:

If you are running Windows 7, XP/VISTA/2000, you can try freeware Partition Wizard Home.

If you are running Windows Server 2000/2003/2008, you can try Partition Wizard Server Edition.

 

Related articles