Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors on creating VHDX #95

Open
detox4you opened this issue Oct 22, 2024 · 13 comments
Open

errors on creating VHDX #95

detox4you opened this issue Oct 22, 2024 · 13 comments

Comments

@detox4you
Copy link

I keep getting fatal errors on the creating VHDX and I cannot pinpoint the cause of it. Hyper-V is installed, and I can create and run VMs with no problem.

My command line is:
.\BuildFFUVM.ps1 -make 'Dell' -model '3440' -WindowsSKU 'Pro' -FFUDevelopmentPath "C:\FFUDevelopment" -VMLocation "D:\HyperV\VMs" -Installapps $false -InstallOffice $false -InstallDrivers $true -VMSwitchName 'External' -VMHostIPAddress '192.168.0.76' -CreateDeploymentMedia $true -CreateCaptureMedia $true -BuildUSBDrive $true -UpdateLatestCU $true -UpdateLatestNet $true -UpdateLatestDefender $true -UpdateEdge $true -UpdateOneDrive $true -RemoveFFU $true -WindowsRelease 11 -WindowsLang 'nl-nl' -Verbose

Part of the log highlighting the errors:

VERBOSE: Download succeeded
VERBOSE: Cleanup cab and xml file
VERBOSE: Cleanup done
VERBOSE: Creating new Scratch VHDX...
Initialize-Disk : Access denied
Activity ID: {a96c9121-2497-0001-f4b6-6ca99724db01}
At D:\FFU-main\FFUDevelopment\BuildFFUVM.ps1:2625 char:50

  • ... | Mount-VHD -Passthru | Initialize-Disk -PassThru -PartitionStyle GPT
  •                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : PermissionDenied: (StorageWMI:ROOT/Microsoft/Windows/Storage/MSFT_Disk) [Initialize-Disk], CimException
    • FullyQualifiedErrorId : StorageWMI 40001,Initialize-Disk

Creating VHDX Failed
VERBOSE: Creating VHDX Failed with error Cannot validate argument on parameter 'DiskNumber'. The argument is null. Provide a valid value for the argument, and then try running the command again.
VERBOSE: Dismounting D:\HyperV\VMs_FFU-1101724783_FFU-1101724783.vhdx
VERBOSE: Dismounting scratch VHDX...
VERBOSE: Done.
VERBOSE: Removing D:\HyperV\VMs_FFU-1101724783
VERBOSE: Removal complete
VERBOSE: Deleting ESD file
VERBOSE: ESD File deleted
New-ScratchVhdx : Cannot validate argument on parameter 'DiskNumber'. The argument is null. Provide a valid value for the argument, and then try running the command again.
At D:\FFU-main\FFUDevelopment\BuildFFUVM.ps1:4158 char:17

  • ... $vhdxDisk = New-ScratchVhdx -VhdxPath $VHDXPath -SizeBytes $disksize ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [New-ScratchVhdx], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,New-ScratchVhdx
@rbalsleyMSFT
Copy link
Owner

rbalsleyMSFT commented Oct 22, 2024

This is the code you're failing on


    $newVHDX = New-VHD -Path $VhdxPath -SizeBytes $disksize -LogicalSectorSizeBytes $LogicalSectorSizeBytes -Dynamic:($Dynamic.IsPresent)
    $toReturn = $newVHDX | Mount-VHD -Passthru | Initialize-Disk -PassThru -PartitionStyle GPT

    #Remove auto-created partition so we can create the correct partition layout
    remove-partition $toreturn.DiskNumber -PartitionNumber 1 -Confirm:$False

Initialize-Disk is throwing an Access Denied.

Are you running as Administrator? The script requires this and will fail immediately if you're running as a standard user, but if you've modified the script and removed the check, then that check wouldn't happen.

Do you have any AV/EDR/XDR software that could be putting a lock on the VHDX? We create the VHDX and then immediately initialize it, so it's possible a file lock could be happening while we try to initialize.

I also notice that you have different paths for the FFUDevelopment folder and the VMLocation. You may want to just try having everything in the FFUDevelopment folder (no need to set the VMLocation parameter).

@detox4you
Copy link
Author

I have moved everything into one folder. Still got the same error. I've set a breakpoint in the BuildFFUVM.ps1 script at line 2624. I can observe that the new-vhd command works, the mount-vhd also works and I receive a disk number. It seems to fail on the Initialize-Disk command. If I execute this part manually it throws the same error, but I can see in disk manager that the disk has been initialized though no partition was created.
Everything is run elevated, I have tried VScode, PowerShell ISE and normal PowerShell. Same result. I am at a loss why this fails.

@rbalsleyMSFT
Copy link
Owner

That's odd. Did you also create a new VHD manually using powershell, or just debug the script and then execute the initialize disk step via the console? If not, I'd be curious if you could just create a new VHD manually as well and try to initialize it and see if that works or you see the same issue.

@detox4you
Copy link
Author

Tried again including disabling real time AV scanning on drives. After some more testing it seems that the line:
Initialize-Disk $toReturn.DiskNumber -PartitionStyle GPT
will give an access denied error, but does execute the initialize disk part since it shows up in disk manager as initialized with GPT style after the error message is displayed and I set a break point there to stop execution.

So I changed the line to:
Initialize-Disk $toReturn.DiskNumber -PartitionStyle GPT -ErrorAction SilentlyContinue
and then the script continues.

Unfortunately it then fails on the line:
$systemPartitionDriveLetter = New-SystemPartition -VhdxDisk $vhdxDisk
on line number 4163 (in the #Create VHDX part). Error message:

$systemPartitionDriveLetter = New-SystemPartition -VhdxDisk $vhdxDisk
New-SystemPartition : Cannot process argument transformation on parameter 'VhdxDisk'. Cannot convert the "Microsoft.Vhd.PowerShell.VirtualHardDisk" value of type "Microsoft.Vhd
.PowerShell.VirtualHardDisk" to type "Microsoft.Management.Infrastructure.CimInstance".
At line:1 char:61
+ $systemPartitionDriveLetter = New-SystemPartition -VhdxDisk $vhdxDisk
+                                                             ~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-SystemPartition], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,New-SystemPartition

The line just before it
$vhdxDisk = New-ScratchVhdx -VhdxPath $VHDXPath -SizeBytes $disksize -LogicalSectorSizeBytes $LogicalSectorSizeBytes
is exectuted with no error and does create a mounted disk visible in disk manager.

@rbalsleyMSFT
Copy link
Owner

Is it possible to try this on a different machine?

@detox4you
Copy link
Author

I have tried on another machine with similar results. The step on line 2626
Initialize-Disk $toReturn.DiskNumber -PartitionStyle GPT
now works without error, but still the script stops at line 4160
$systemPartitionDriveLetter = New-SystemPartition -VhdxDisk $vhdxDisk

Included logfile:
FFUDevelopment.log

@rbalsleyMSFT
Copy link
Owner

rbalsleyMSFT commented Nov 5, 2024 via email

@detox4you
Copy link
Author

detox4you commented Nov 5, 2024

Same when running outside the ISE but I might be onto something: I downloaded the ZIP with the files again, deleted everything except my calling scripts and ISO files and ran it again. It does not give errors now. Nothing else changed except downloading from the source again. Running it now and it passed the point of error I had before. I think this was the 2409.1 version and now running the 2409.2 version.

@rbalsleyMSFT
Copy link
Owner

rbalsleyMSFT commented Nov 5, 2024 via email

@detox4you
Copy link
Author

First part now resolved it seems. It does get stuck on this error:

VERBOSE: FFU Capture complete
VERBOSE: Dismounting scratch VHDX...
VERBOSE: Done.
VERBOSE: Sleeping 2 minutes to prevent file handle lock
VERBOSE: Adding drivers
VERBOSE: Creating D:\FFU-main\FFUDevelopment\Mount directory
VERBOSE: Created D:\FFU-main\FFUDevelopment\Mount directory
VERBOSE: Mounting D:\FFU-main\FFUDevelopment\FFU\Win11_23H2_Pro_nov2024.ffu to D:\FFU-main\FFUDevelopment\Mount
Capturing FFU file failed
VERBOSE: Capturing FFU file failed with error Toegang geweigerd.
VERBOSE: Cleaning up VHDX
VERBOSE: Removing D:\FFU-main\FFUDevelopment\VM\_FFU-1050251366
VERBOSE: Removal complete
VERBOSE: Remove D:\FFU-main\FFUDevelopment\Mount folder
VERBOSE: Folder removed
VERBOSE: Remove unused mountpoints
VERBOSE: Removal complete
Mount-WindowsImage : Toegang geweigerd.
At D:\FFU-main\FFUDevelopment\BuildFFUVM.ps1:3102 char:9
+         Mount-WindowsImage -ImagePath $FFUFile -Index 1 -Path "$FFUDe ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Mount-WindowsImage], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.MountWindowsImageCommand

I resolved this by checking if the mount folder is created and if not create an empty one by inserting this before the command that failed (mount folder does not exist in the downloaded ZIP file of the code and it also gets deleted automatically):

        #Check if Folder exists
        If(!(Test-Path -Path "$FFUDevelopmentPath\Mount"))
        {
          #powershell create directory
          New-Item -ItemType Directory -Path "$FFUDevelopmentPath\Mount"
          Write-Host "New folder created successfully!" -f Green
        }
        Else
        {
          Write-Host "Folder already exists!" -f Yellow
        }

This now works. But I end up at an error I can't find the solution for. It now stops here:

VERBOSE: Dismount D:\FFU-main\FFUDevelopment\Mount
VERBOSE: Dismount complete
VERBOSE: Remove D:\FFU-main\FFUDevelopment\Mount folder
VERBOSE: Folder removed
VERBOSE: Optimizing FFU - This will take a few minutes, please be patient
VERBOSE: Deployment Image Servicing and Management tool
Version: 10.0.26100.1

Mounting image
[==========================100.0%==========================] 

Error: 5

Toegang geweigerd.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log
Script failed - D:\FFU-main\FFUDevelopment\FFUDevelopment.log for more info
Capturing FFU file failed
VERBOSE: Capturing FFU file failed with error Deployment Image Servicing and Management tool
Version: 10.0.26100.1

Mounting image
[==========================100.0%==========================] 

Error: 5

Toegang geweigerd.

The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log
VERBOSE: Cleaning up VHDX
VERBOSE: Removing D:\FFU-main\FFUDevelopment\VM\_FFU-1200674899
VERBOSE: Removal complete
VERBOSE: Remove unused mountpoints
VERBOSE: Removal complete
Deployment Image Servicing and Management tool
Version: 10.0.26100.1
Mounting image
[==========================100.0%==========================] 
Error: 5
Toegang geweigerd.
The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log
At D:\FFU-main\FFUDevelopment\BuildFFUVM.ps1:472 char:21
+                     throw $cmdOutput.Trim()
+                     ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Deployment Imag...s\DISM\dism.log:String) [], RuntimeException
    + FullyQualifiedErrorId : Deployment Image Servicing and Management tool
Version: 10.0.26100.1
Mounting image
[==========================100.0%==========================] 
Error: 5
Toegang geweigerd.
The DISM log file can be found at C:\WINDOWS\Logs\DISM\dism.log


@rbalsleyMSFT
Copy link
Owner

rbalsleyMSFT commented Nov 6, 2024

Error 5 is typically access denied. Do you have the dism.log file?

@detox4you
Copy link
Author

dism.zip

@rbalsleyMSFT
Copy link
Owner

rbalsleyMSFT commented Nov 7, 2024

Your log

2024-11-06 23:58:40, Info                  DISM   DISM.EXE: Executing command line: dism  /optimize-ffu /imagefile:D:\FFU-main\FFUDevelopment\FFU\Win11_24H2_Pro_nov2024.ffu /scratchdir:D:\FFU-main\FFUDevelopment\Scratchdir 
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: CFfuMiscHelpersT<class CEmptyType>::GetSignerInfoFromCatalog#998 failed with 0x80091008.
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: -------- Security Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                     Size = 32
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                Signature = SignedImage 
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:            ChunkSizeInKB = 128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:              AlgorithmId = 32780
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:              CatalogSize = 306
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:            HashTableSize = 2012128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ----------- Image Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                     Size = 24
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                Signature = ImageFlash  
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:           ManifestLength = 1645
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                ChunkSize = 128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ----------- Store Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:               UpdateType = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:             MajorVersion = 1
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:             MinorVersion = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    FullFlashMajorVersion = 3
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    FullFlashMinorVersion = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:               PlatformId = 
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                BlockSize = 131072
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:     WriteDescriptorCount = 62868
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    WriteDescriptorLength = 1257360
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:  ValidateDescriptorCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ValidateDescriptorLength = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:        InitialTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:        InitialTableCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:      FlashOnlyTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:      FlashOnlyTableCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:          FinalTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:          FinalTableCount = 62868
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:     CompressionAlgorithm = 3
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: CFfuMiscHelpersT<class CEmptyType>::GetSignerInfoFromCatalog#998 failed with 0x80091008.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: CFfuMiscHelpersT<class CEmptyType>::GetSignerInfoFromCatalog#998 failed with 0x80091008.
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: -------- Security Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                     Size = 32
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                Signature = SignedImage 
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:            ChunkSizeInKB = 128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:              AlgorithmId = 32780
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:              CatalogSize = 306
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:            HashTableSize = 2012128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ----------- Image Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                     Size = 24
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                Signature = ImageFlash  
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:           ManifestLength = 1645
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                ChunkSize = 128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ----------- Store Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:               UpdateType = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:             MajorVersion = 1
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:             MinorVersion = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    FullFlashMajorVersion = 3
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    FullFlashMinorVersion = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:               PlatformId = 
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                BlockSize = 131072
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:     WriteDescriptorCount = 62868
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    WriteDescriptorLength = 1257360
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:  ValidateDescriptorCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ValidateDescriptorLength = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:        InitialTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:        InitialTableCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:      FlashOnlyTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:      FlashOnlyTableCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:          FinalTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:          FinalTableCount = 62868
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:     CompressionAlgorithm = 3
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: Successfully created a virtual disk file at C:\Users\detou\AppData\Local\Temp\_ffumount856094852.vhd.
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: Successfully set surface cache policy.
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: Successfully attached the virtual at \\.\PhysicalDrive4.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: CFfuMiscHelpersT<class CEmptyType>::GetSignerInfoFromCatalog#998 failed with 0x80091008.
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: -------- Security Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                     Size = 32
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                Signature = SignedImage 
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:            ChunkSizeInKB = 128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:              AlgorithmId = 32780
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:              CatalogSize = 306
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:            HashTableSize = 2012128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ----------- Image Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                     Size = 24
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                Signature = ImageFlash  
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:           ManifestLength = 1645
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                ChunkSize = 128
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ----------- Store Header ----------------------------------
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:               UpdateType = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:             MajorVersion = 1
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:             MinorVersion = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    FullFlashMajorVersion = 3
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    FullFlashMinorVersion = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:               PlatformId = 
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:                BlockSize = 131072
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:     WriteDescriptorCount = 62868
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:    WriteDescriptorLength = 1257360
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:  ValidateDescriptorCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: ValidateDescriptorLength = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:        InitialTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:        InitialTableCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:      FlashOnlyTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:      FlashOnlyTableCount = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:          FinalTableIndex = 0
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:          FinalTableCount = 62868
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider:     CompressionAlgorithm = 3
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: Disk size = 32212254720, Ffu disk size = 32212254720.
2024-11-06 23:58:40, Info                  DISM   DISM FFU Provider: Number of worker threads = 16
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: IOWorkerCallback#277 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: FfuApplyInternal#531 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: FfuMountInternal#242 failed with 0x80070005.
2024-11-06 23:58:40, Warning               DISM   DISM FFU Provider: Failed to delete backing VHD/X file C:\Users\detou\AppData\Local\Temp\_ffumount856094852.vhd (0x80070020).
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: FfuMountImage#206 failed with 0x80070005.
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: PID=28276 TID=1332 onecore\base\ntsetup\opktools\dism\providers\ffuprovider\dll\ffuimageinfo.cpp:347 - CFfuImageInfo::Mount(hr:0x80070005)
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: PID=28276 TID=1332 onecore\base\ntsetup\opktools\dism\providers\ffuprovider\dll\ffumanager.cpp:885 - CFfuManager::Optimize(hr:0x80070005)
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: PID=28276 TID=1332 Failed to optimize the FFU image 'D:\FFU-main\FFUDevelopment\FFU\Win11_24H2_Pro_nov2024.ffu'. - CFfuManager::InternalCmdOptimize(hr:0x80070005)
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: PID=28276 TID=1332 "Error executing command" - CFfuManager::InternalExecuteCmd(hr:0x80070005)
2024-11-06 23:58:40, Error                 DISM   DISM FFU Provider: PID=28276 TID=1332 onecore\base\ntsetup\opktools\dism\providers\ffuprovider\dll\ffumanager.cpp:225 - CFfuManager::ExecuteCmdLine(hr:0x80070005)
2024-11-06 23:58:40, Info                  DISM   DISM.EXE: Image session has been closed. Reboot required=no.
2024-11-06 23:58:40, Info                  DISM   DISM.EXE: 
2024-11-06 23:58:40, Info                  DISM   DISM.EXE: <----- Ending Dism.exe session ----->

Good log from my machine

2024-10-21 12:22:30, Info                  DISM   DISM.EXE: Executing command line: dism  /optimize-ffu /imagefile:C:\FFUDevelopment\FFU\Win11_24H2_Pro_Apps_Oct2024.ffu 
2024-10-21 12:22:30, Error                 DISM   DISM FFU Provider: CFfuMiscHelpersT<class CEmptyType>::GetSignerInfoFromCatalog#998 failed with 0x80091008.
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: -------- Security Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                     Size = 32
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                Signature = SignedImage 
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:            ChunkSizeInKB = 128
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:              AlgorithmId = 32780
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:              CatalogSize = 306
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:            HashTableSize = 6069632
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ----------- Image Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                     Size = 24
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                Signature = ImageFlash  
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:           ManifestLength = 1659
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                ChunkSize = 128
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ----------- Store Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:               UpdateType = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:             MajorVersion = 1
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:             MinorVersion = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    FullFlashMajorVersion = 3
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    FullFlashMinorVersion = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:               PlatformId = 
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                BlockSize = 131072
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:     WriteDescriptorCount = 189646
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    WriteDescriptorLength = 3792920
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:  ValidateDescriptorCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ValidateDescriptorLength = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:        InitialTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:        InitialTableCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:      FlashOnlyTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:      FlashOnlyTableCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:          FinalTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:          FinalTableCount = 189646
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:     CompressionAlgorithm = 3
2024-10-21 12:22:30, Error                 DISM   DISM FFU Provider: CFfuMiscHelpersT<class CEmptyType>::GetSignerInfoFromCatalog#998 failed with 0x80091008.
2024-10-21 12:22:30, Error                 DISM   DISM FFU Provider: CFfuMiscHelpersT<class CEmptyType>::GetSignerInfoFromCatalog#998 failed with 0x80091008.
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: -------- Security Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                     Size = 32
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                Signature = SignedImage 
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:            ChunkSizeInKB = 128
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:              AlgorithmId = 32780
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:              CatalogSize = 306
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:            HashTableSize = 6069632
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ----------- Image Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                     Size = 24
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                Signature = ImageFlash  
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:           ManifestLength = 1659
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                ChunkSize = 128
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ----------- Store Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:               UpdateType = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:             MajorVersion = 1
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:             MinorVersion = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    FullFlashMajorVersion = 3
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    FullFlashMinorVersion = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:               PlatformId = 
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                BlockSize = 131072
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:     WriteDescriptorCount = 189646
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    WriteDescriptorLength = 3792920
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:  ValidateDescriptorCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ValidateDescriptorLength = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:        InitialTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:        InitialTableCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:      FlashOnlyTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:      FlashOnlyTableCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:          FinalTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:          FinalTableCount = 189646
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:     CompressionAlgorithm = 3
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: Successfully created a virtual disk file at C:\Users\admin\AppData\Local\Temp\_ffumount-6715816.vhd.
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: Successfully set surface cache policy.
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: Successfully attached the virtual at \\.\PhysicalDrive4.
2024-10-21 12:22:30, Error                 DISM   DISM FFU Provider: CFfuMiscHelpersT<class CEmptyType>::GetSignerInfoFromCatalog#998 failed with 0x80091008.
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: -------- Security Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                     Size = 32
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                Signature = SignedImage 
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:            ChunkSizeInKB = 128
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:              AlgorithmId = 32780
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:              CatalogSize = 306
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:            HashTableSize = 6069632
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ----------- Image Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                     Size = 24
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                Signature = ImageFlash  
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:           ManifestLength = 1659
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                ChunkSize = 128
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ----------- Store Header ----------------------------------
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:               UpdateType = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:             MajorVersion = 1
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:             MinorVersion = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    FullFlashMajorVersion = 3
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    FullFlashMinorVersion = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:               PlatformId = 
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:                BlockSize = 131072
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:     WriteDescriptorCount = 189646
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:    WriteDescriptorLength = 3792920
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:  ValidateDescriptorCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: ValidateDescriptorLength = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:        InitialTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:        InitialTableCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:      FlashOnlyTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:      FlashOnlyTableCount = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:          FinalTableIndex = 0
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:          FinalTableCount = 189646
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider:     CompressionAlgorithm = 3
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: Disk size = 32212254720, Ffu disk size = 32212254720.
2024-10-21 12:22:30, Info                  DISM   DISM FFU Provider: Number of worker threads = 24
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Decompression time = 31009 ms, Hash time = 70718 ms, Disk I/O time = 1971964 ms, File I/O time = 43951 ms
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Successfully applied the FFU at \\.\PhysicalDrive4.
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Drive path = \\.\PhysicalDrive4
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider:   Disk size = 32212254720 Bytes (30.00 Gb)
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Partition Style = GPT
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Partition Count = 4
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Successfully written the session info to HKEY\SOFTWARE\Microsoft\DISM\Mounted FFUs\__?_Volume{e628e3c9-0693-4c0a-8140-ebf156cae5e9}__2124225880_1638400_1296621.
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Total time: 45360 ms
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Partition for optimization: #3
2024-10-21 12:23:15, Warning               DISM   DISM FFU Provider: Skipped \\?\Volume{16ec6031-0bc2-48c8-9c3c-9136df0d796d}\\$ntfs.log for deletion (0x80070002).
2024-10-21 12:23:15, Warning               DISM   DISM FFU Provider: Skipped \\?\Volume{16ec6031-0bc2-48c8-9c3c-9136df0d796d}\\hiberfil.sys for deletion (0x80070002).
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Deleted \\?\Volume{16ec6031-0bc2-48c8-9c3c-9136df0d796d}\\pagefile.sys successfully.
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Deleted \\?\Volume{16ec6031-0bc2-48c8-9c3c-9136df0d796d}\\swapfile.sys successfully.
2024-10-21 12:23:15, Warning               DISM   DISM FFU Provider: Skipped \\?\Volume{16ec6031-0bc2-48c8-9c3c-9136df0d796d}\\RECYCLER for deletion (0x80070003).
2024-10-21 12:23:15, Info                  DISM   DISM FFU Provider: Deleted \\?\Volume{16ec6031-0bc2-48c8-9c3c-9136df0d796d}\\$Recycle.Bin successfully.
2024-10-21 12:23:15, Warning               DISM   DISM FFU Provider: Skipped \\?\Volume{16ec6031-0bc2-48c8-9c3c-9136df0d796d}\\Windows\CSC for deletion (0x80070003).
2024-10-21 12:23:17, Info                  DISM   DISM FFU Provider: Volume can be resized anywhere between 24701845504 and 31091326976. Resizing to 25239224320.
2024-10-21 12:23:17, Info                  DISM   DISM FFU Provider: Resizing volume (\\?\HARDDISK4PARTITION3) to 25239224320 bytes.
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: Total time: 3311 ms

2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: Drive path = \\.\PhysicalDrive4
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Disk size = 32212254720 Bytes (30.00 Gb)
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: Partition Style = GPT
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: Partition Count = 4
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: Drive path = \\.\PhysicalDrive4
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Disk size = 32212254720 Bytes (30.00 Gb)
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: Partition Style = GPT
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: Partition Count = 4
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: [Partition 1]
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Starting Offset = 1048576
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Partition Length = 272629760
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Volume Name = \\?\Volume{ce6368ee-f331-49de-8b50-9b57ae2a003a}
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   File System = FAT32
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Volume Snapshots = Not present
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: [Partition 2]
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Starting Offset = 273678336
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Partition Length = 16777216
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   No associated volume
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: [Partition 3]
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Starting Offset = 290455552
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Partition Length = 25239224320
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Volume Name = \\?\Volume{16ec6031-0bc2-48c8-9c3c-9136df0d796d}
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   File System = NTFS
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Volume Snapshots = Not present
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: [Partition 4]
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Starting Offset = 31381782528
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Partition Length = 829423616
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Volume Name = \\?\Volume{57177dc8-9d01-4896-b6fd-a3613ae0f841}
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   File System = NTFS
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider:   Volume Snapshots = Not present
2024-10-21 12:23:19, Info                  DISM   DISM FFU Provider: Payload block count = 176335
2024-10-21 12:23:20, Info                  DISM   DISM FFU Provider: Number of worker threads = 24
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Number of big blocks = 29641 (438455547 bytes)
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Compression time = 59786 ms
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Write-descriptor length = 3526700
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Initial catalog length = 306, Final catalog length = 306
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Catalog length = 306, Hashtable length = 5643616
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Hash time: 18127 ms
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Disk I/O time = 406077 ms, File I/O time = 932215 ms
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Virtual disk detached successfully.
2024-10-21 12:23:43, Info                  DISM   DISM FFU Provider: Total time: 24933 ms
2024-10-21 12:23:43, Info                  DISM   DISM.EXE: Image session has been closed. Reboot required=no.
2024-10-21 12:23:43, Info                  DISM   DISM.EXE: 
2024-10-21 12:23:43, Info                  DISM   DISM.EXE: <----- Ending Dism.exe session ----->

Looks like the issue is with mounting the FFU to a VHD in order to optimize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants