Raymond
Raymond

Reputation: 609

Is there any way to create a dynamic disk via code on windows?

We can use "convert dynamic" command in diskpart utility to change a disk to be dynamic on windows 2012. It there any way we can do it via code? I've checked the Storage Management powershell cmdlet, and Storage Management API. But none of them provide the capability.

Upvotes: 1

Views: 573

Answers (2)

Isso
Isso

Reputation: 1333

You can create dynamic disk via VDS. Get IVdsSwProvider, then create IVdsPack, call IVdsPack->AddDisk for each of the target disks, and finally call IVdsPack->CreateVolume.

Upvotes: 1

Philip Kyes
Philip Kyes

Reputation: 1

i have tried this before you can actually do it using command line;

Open a command prompt and type diskpart. At the DISKPART prompt, type list disk. Make note of the disk number you want to convert to dynamic. At the DISKPART prompt, type select disk . At the DISKPART prompt, type convert dynamic.

But be careful with disks that contain multiple installations of windows. Also try http://technet.microsoft.com/en-us/library/cc731274.aspx#BKMK_CMD Goodluck...

Upvotes: 0

Related Questions