jamesstringerparsec / Easy-GPU-PV

A Project dedicated to making GPU Partitioning on Windows easier!
4.26k stars 430 forks source link

"Format-Volume: Invalid argument" when creating VHDX #263

Open Mystikal91 opened 1 year ago

Mystikal91 commented 1 year ago

I'm getting this errors when creating VHDX, I tried multiple iso and settings, but nothing change

INFO   : Opening ISO Win10_22H2_Italian_x64.iso...
INFO   : Looking for I:\sources\install.wim...
INFO   : Looking for the requested Windows image in the WIM file
INFO   : Image 6 selected (ProfessionalN)...
INFO   : Creating sparse disk...
INFO   : Mounting VHDX...
INFO   : Initializing disk...
INFO   : Creating EFI system partition...
INFO   : Formatting system volume...
Format-Volume : Invalid Parameter
Activity ID: {64edaf22-20e3-48e1-86c7-928ea3761dc1}
At D:\Moved\Download\Easy-GPU-PV-main\CopyFilesToVM.ps1:2132 char:41
+ ... temVolume = Format-Volume -Partition $systemPartition -FileSystem FAT ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Format-Volume], CimException
    + FullyQualifiedErrorId : StorageWMI 5,Format-Volume

INFO   : Setting system partition as ESP...
INFO   : Creating MSR partition...
INFO   : Creating windows partition...
INFO   : Formatting windows volume...
Format-Volume : Invalid Parameter
Activity ID: {5250d74f-45b9-4f2e-b09b-1f1dfa9eaba2}
At D:\Moved\Download\Easy-GPU-PV-main\CopyFilesToVM.ps1:2170 char:38
+ ... owsVolume = Format-Volume -Partition $windowsPartition -FileSystem NT ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Format-Volume], CimException
    + FullyQualifiedErrorId : StorageWMI 5,Format-Volume

ERROR  : Cannot validate argument on parameter 'Volume'. The argument is null. Provide a valid value for the argument, and then try running the command again.
INFO   : Log folder is C:\Users\M***\AppData\Local\Temp\Convert-WindowsImage\1c1725f0-2f64-4971-84f6-0579511aed0c
INFO   : Closing Windows image...
INFO   : Done.
Failed to create VHDX, stopping script
niuroubao commented 1 year ago

I'm getting the same issue.

Normal99 commented 1 year ago

Same issue here too Cant figure it out yet

Oguret2 commented 5 months ago

Since I found a couple of posts about this error on the Internet and none of them had a direct solution, I feel it is my duty to share here what helped me personally. I had the Automatic Mounting of New Disks and Drives service disabled. After enabling it with the command “diskpart” -> “automount enable” everything worked correctly. Read more in the article https://www.tenforums.com/tutorials/117336-enable-disable-automount-new-disks-drives-windows.html. I hope this will help some anon who wandered in here. @Normal99 @niuroubao @Mystikal91

juancmp92 commented 3 months ago

@Oguret2 this work for me. thanks. Bloque de código:

BenClementt commented 2 weeks ago

Vouch for @Oguret2's answer. Worked a treat for me! Thx <3