python - After partition was created using IOCTL_DISK_SET_DRIVE_LAYOUT, how do I create new volume in this newly created partition? -


After

I can create a new partition, format and use it using Dragon ctypes to assign a new drive letter , Am trying to My initial coding attempt was to use this SO page:. You can see the definition of class DeviceIoControl

 successfully created

.. but Again, how can I make new amounts in the newly created partition of the disk?

Try to use the format method of but when in my case, that drive letter is not yet assigned Win32_Volume only to return the letter attached to all existing N current drives.

Any advice?

"itemprop =" text ">

short story short (this is actually a long story!), Turn out, I mistake Choose one wrong from Before that I use PARTITION_EXTENDED 0x05, after experimenting with any other value: PARTITION_IFS 0x07, Windows asked me to format the partition directly. And to avoid it, as has been said, we have to wait several seconds for the new drive letter to be available, and then call to check the new drive (you have to call it before creating the partition, And compare two, get a new drive letter). As the drive letter is available, we can easily call the format to format.

This is a low level kernel 32 call + WMI mix that brings successful solutions to this problem. If all our works are available in WMI then it will be easy for us, but yes, we are not here to encounter.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -