Deployment error: Windows could not create a partition

I recently encountered problems when deploying Windows (using AutoUnattend.xml) on a test machine.

Installation failed with the message:

Windows_could_not_create_a_partition_on_disk_0

Windows could not create a partition on disk 0. The error occured while applying the unattend answer file’s <DiskConfiguration> setting. Error code: 0x80042565

 

I found these errors in: X:\Windows\Panther\setuperr.log

CreatePartition: Disk 0 doesn't support creation of partitions of the specified type
ApplyDiskOperationUsingService: Failed to correctly apply disk operation of type [0x7]; hr = 0x80042565
CallBack_DiskConfiguration_ApplyUnattend:An error occurred while applying unattend disk configuration; hr = 0x80042565

 

The situation occured because the computer booted in BIOS mode, while the DiskConfiguration specified in AutoUnattend.xml was for UEFI.

(I suspect that similar problems will occur in the opposite situation)

When actively choosing UEFI in the boot menu, it worked as expected.

 

In Windows PE the firmware type can examined by checking the registry key:

HKLM\System\CurrentControlSet\Control\PEFirmwareType

 

If booting in a particular mode is desired, the deployment media can be modified to achieve this:

  • UEFI, not BIOS: Remove bootmgr file from media root.
  • BIOS, not UEFI: Remove efi folder from media root.

 

Discovered the details about identifying firmware type and enforcing booting from a particular firmware type in the article: WinPE: Boot in UEFI or legacy BIOS mode

Alt Gr key not working normally

If you use a Lenovo Thinkpad computer running Windows 10 you may experience a situation where the Alt Gr key stops working normally and just works as the regular Alt key.

Ctrl + Alt can be used as a substitute, but that’s only a workaround.

The problem seems to be related to the Synaptics Pointing Device driver.

 

The problem can be resolved for some time by reinstalling, rolling back or updating the Synaptics Pointing Device driver and then restarting the computer.

The problem can reappear after some weeks. However it can be resolved again by repeating the above steps.

If I discover a permanent fix, I will update the article again.

 

The driver can be rolled back this way:

1. Open Device Manager

2. Open Properties for Synaptics Pointing Device

Synaptics_Pointing_Device_01

3. Click: Rollback driver

Synaptics_Pointing_Device_02_Roll_Back_Driver

4. Restart the computer.

Reseat and clean contacts on memory modules

Computer memory can fail and it usually causes reliability problems, unless ECC memory is used.

My preferred memory testing tool is: Memtest86+

 

Normal procedure is to test memory modules individually in different memory sockets, to identify the failing memory module or socket.

This entails reseating the memory modules. (Before handling memory modules please take anti-static precautions)

Modern memory buses use high frequency low voltage signals. They need a good electrical connection to work reliably.

Sometimes the process of reseating the memory modules can solve the problem, if it was caused by an electrical connection issue.

 

If memory tests continue to fail and the memory module is out of warranty, before replacing it you can try cleaning the contacts on the memory module for dust, dirt or corrosion.

I suggest using a piece of cloth with rubbing alcohol.

After cleaning, test the memory module again. If memory tests can run without errors for 24 hours, then the problem is likely fixed.

Run diskpart clean twice

When trying to clear a USB memory stick with diskpart I encountered this error:

DISKPART> clean

DiskPart has encountered an error: Access is denied.
See the System Event Log for more information.

 

The System event log contained this error from VDS Basic Provider:

Cannot zero sectors on disk \\?\PhysicalDrive2. Error code: 5@0101000F

 

The problem was solved simply by running clean again:

DISKPART> clean

DiskPart succeeded in cleaning the disk.

 

After that a partition could be created and formatted.

 

Warning: Always be very careful when using diskpart.

In order to avoid data loss make sure to list disks, select the correct disk and list disks again before running diskpart clean.

Windows file permissions: High Mandatory Level

I encountered a problem when following the guide: WinPE: Create a Boot CD, DVD, ISO, or VHD

 

I chose to create a new .vhdx file directly under C:\ for testing in Hyper-V

Later I moved the .vhdx file to C:\Hyper-V

I actually got this dialog when moving the file, but just went ahead with Continue without considering the implications.

00_Administrator_permission_to_move_this_file

 

When I tried to attach the .vhdx to a virtual machine I got this error message:

01_User_Account_does_not_have_permissions

Failed to modify device ‘Virtual Hard Disk’.

User Account does not have permission to open attachment.

 

I checked the file permissions and noticed:

02_High_Mandatory_Level

Integrity level: High Mandatory Level

 

I also checked the permissions with:

C:\>icacls c:\Hyper-V\WinPE_amd64_PS.vhdx
c:\Hyper-V\WinPE_amd64_PS.vhdx BUILTIN\Administrators:(I)(F)
NT AUTHORITY\SYSTEM:(I)(F)
BUILTIN\Users:(I)(RX)
NT AUTHORITY\Authenticated Users:(I)(M)
Mandatory Label\High Mandatory Level:(I)(NW)

Successfully processed 1 files; Failed processing 0 files

 

The high integrity level was causing the problem, but how to remove it?

The easiest solution was to lower the integrity level with:

icacls c:\Hyper-V\WinPE_amd64_PS.vhdx /setintegritylevel medium

After that the file could be attached and used.

 

Conclusion

If high integrity level on a file causes problems, it can be lowered with icacls.

Generally avoid creating files directly under C:\, because it can lead to problems like this.

Change Windows PE keyboard layout

I was experimenting with Windows PE for deployment and servicing.

The default keyboard layout is American. I wanted to use Danish keyboard layout instead.

The keyboard layout can be changed to Danish with:

wpeutil SetKeyboardLayout 0406:00000406

 

Be aware that the setting does not affect the initial cmd window.

It will however affect all other programs run hereafter.

Another cmd window (with the new keyboard layout) can be opened with:

start cmd

(Dont’t close the initial cmd window. That will make Windows PE restart)

 

Microsoft has a list of locale IDs: Locale IDs Assigned by Microsoft

As another example the locale ID for Swedish is 0x41d, so Swedish keyboard layout can be set with:

wpeutil SetKeyboardLayout 041d:0000041d

 

The same principle applies to other languages.

Replace default Windows 10 Intel graphics driver

After installing Windows 10 I experienced problems with screen corruption, (unwanted) screen cloning and occasional graphics driver crashes.

The graphics driver also seemed to cause performance and stability problems for some programs.

Intel Graphics driver version 10.18.15.4256 installed by Windows Update worked poorly for me.

 

Windows 10 forces particular driver updates as standard.

I wanted to use the latest Intel graphics driver to avoid the problems described above.

 

This was accomplished by:

1. Identfying the CPU using CPU-Z and finding the latest compatible graphics driver at: https://downloadcenter.intel.com/

2. Downloading and unpacking the .zip driver package.

3. Updating and choosing the driver using Device Manager.

4. Disabling driver updates.

 

I found a number of ways to disable driver updates here:

http://www.makeuseof.com/tag/take-back-control-driver-updates-windows-10/

The method that worked for me was changing the value of registry key SearchOrderConfig from 1 to 0.

Under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DriverSearching

Conclusion

The default graphics driver delivered by Windows Update may not be the most reliable version.

In some cases it can be relevant to install a different driver version and disabling driver updates.

Media driver error at Windows 10 setup

I experienced a strange problem when trying to install Windows 10 on an Asus K52J laptop from a Verbatim Store ‘n’ Go 16 GB USB drive.

After booting Windows 10 setup and clicking “Install now” I saw the message: Setup is starting

And then this error message:

A media driver your computer needs is missing. This could be a DVD, USB or Hard disk driver. If you have a CD, DVD, or USB flash drive with the driver on it, please insert it now.

Note: If the installation media for Windows is in the DVD drive or on a USB drive, you can safely remove it for this step.

 

Followed by this error message:

No device drivers were found. Make sure that the installation media contains the correct drivers, and then click OK.

 

Common explanations for this error

  • Corrupted ISO file.

(I checked the SHA1 checksum, which was correct)

  • Wrong AHCI/SATA/IDE setting in BIOS.

(I tried the available options, which had no effect)

  • Using a USB 3.0 port instead of a USB 2.0 port.

(The machine only has USB 2.0 ports. Tried all the ports anyway, which didn’t change the situation)

 

Solution

I eventually found and tried the solution suggested by 4TXTECH here:

http://www.tomshardware.co.uk/forum/id-2762791/win10-clean-install-fails-missing-media-drivers.html

Setup could continue after following this procedure:

1. Unplug the USB drive.

2. Plug the USB drive into a different USB port.

3. Go back to the initial setup screen (by clicking X).

4. Click “Install now” again

 

Thoughts

The problem seems to be caused by a USB compatibility issue somewhere between Windows 10, the laptop or the USB drive.

Further investigation could be relevant.

If Windows installation from a USB flash drive fails due to this or other problems, try the suggested workaround.

As an alternative, try installing from a DVD (if possible).

Drupal update.php may fail when certain modules are inactive

When running Drupal in a multi-site configuration, it’s possible to have a number of shared modules, which are only active on certain sites.

This can cause problems when updating Drupal. If certain modules are inactive running update.php may fail.

 

This has been observed with the:

Search API module:

PHP Fatal error:  Call to undefined function search_api_index_load_multiple() in /etc/drupal/7/sites/all/modules/search_api_attachments/search_api_attachments.install on line 93

Rules module:

PHP Fatal error:  Call to undefined function rules_set_cache() in /etc/drupal/7/sites/all/modules/rules/rules.install on line 517

 

The solution in both cases was to activate the modules in question and then it was possible to run update.php successfully.

After the update you can choose to deactivate the modules again or leave them active with relevant settings.

VirtualBox only running 32-bit VMs

Today I experienced that VirtualBox would only run 32-bit virtual machines on a laptop.

That was a problem for me, because I wanted to do try some things on a 64-bit Ubuntu Server.

Troubleshooting

I decided to reboot and check the BIOS virtualization settings.

There I discovered that both “Intel Virtualization Technology” and “Intel VT-d Feature” were disabled.

I enabled the settings, started Windows and after that 64-bit virtual machines could run again in VirtualBox.

I was convinced that the settings were enabled before, but I suspect that BIOS settings were reset the last time I updated to a new BIOS version.

Conclusion

If you can’t run 64-bit virtual machines in VirtualBox, check and adjust your virtualization settings in BIOS/UEFI.