Troubleshoot boot error - disk read error occurred
Applies to: ✔️ Windows VMs
This article provides steps to resolve issues in which the disk can't be read in an Azure virtual machine (VM).
Symptoms
When you use Boot diagnostics to view the screenshot of the VM, you see that the screenshot displays a prompt that contains the message "A disk read error occurred. Press Ctrl+Alt+Del to restart."
Cause
This error message indicates that the disk structure is corrupted and unreadable. If you're using a Generation 1 VM, it's also possible that the disk partition containing the boot configuration data isn't set to Active.
Solution
Process overview
Tip
If you have a recent backup of the VM, you may try restoring the VM from the backup to fix the boot problem.
- Create and Access a Repair VM.
- Select a Solution:
- Enable serial console and memory dump collection.
- Rebuild the VM.
Note
When encountering this boot error, the Guest operating system (OS) is not operational. You'll be troubleshooting in offline mode to resolve this issue.
Create and access a repair VM
- Use steps 1-3 of the VM Repair Commands to prepare a Repair VM.
- Using Remote Desktop Connection, connect to the Repair VM.
Set partition status to active
Note
This mitigation applies only for Generation 1 VMs. Generation 2 VMs (using UEFI) don't use an active partition.
Delete the VM. Make sure that you select the Keep the disks option when you do this.
Attach the OS disk as a data disk to another VM (a troubleshooting VM). For more information, see How to attach a data disk to a Windows VM in the Azure portal.
Connect to the troubleshooting VM. Open Computer management > Disk management. Make sure that the OS disk is online and that its partitions have drive letters assigned.
Identify the Boot partition and Windows partition. If there's only one partition on the OS disk, this partition is both Boot partition and Windows partition.
If the OS disk contains more than one partition, you can identify the partitions by viewing the folders in them:
The Windows partition contains a folder that is named Windows, and this partition is larger than the others.
The Boot partition contains a folder that is named Boot. This folder is hidden by default. To see the folder, you must display the hidden files and folders and disable the Hide protected operating system files (Recommended) option. The boot partition is typically 300 MB~500 MB.
Run the following command as an administrator to create a boot record:
bcdboot <Windows partition>:\Windows /S <windows partition>:
Use the DISKPART tool to check whether the Windows partition is active:
Open an elevated command prompt and open the DISKPART tool.
diskpart
List the disks on the system and look for added disks and proceed to select the new disk. In this example, the new disk is Disk 1.
list disk sel disk 1
List all the partitions on that disk and then proceed to select the partition you want to check. Usually System Managed partitions are smaller and around 350 MB in size. In the following image, this partition is Partition 1.
list partition sel partition 1
Check the status of the partition. In our example, Partition 1 is not active.
detail partition
If the partition isn't active, change the Active flag and then recheck the change was done properly.
active detail partition
Exit the DISKPART tool.
exit
Fix the disk partition
Open an elevated command prompt (cmd.exe).
Use the following command to run CHKDSK on the disk(s) and perform error fixes:
chkdsk <DRIVE LETTER>: /f
Adding the /f command option fixes any errors on the disk. Make sure to replace < DRIVE LETTER > with the letter of the attached OS VHD.
Enable the serial console and memory dump collection
Important
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For protection, back up the registry before you modify it so that you can restore it if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.
Recommended: Before you rebuild the VM, enable the Serial Console and memory dump collection by following these steps:
Open an elevated command prompt session as an administrator.
Run the following BCDEdit commands using the /ems and /emssettings options:
Enable the serial console:
bcdedit /store <volume-letter-containing-the-bcd-folder>:\boot\bcd /ems {<boot-loader-identifier>} ON bcdedit /store <volume-letter-containing-the-bcd-folder>:\boot\bcd /emssettings EMSPORT:1 EMSBAUDRATE:115200
Verify that the free space on the OS disk is larger than the memory size (RAM) on the VM.
If there isn't enough space on the OS disk, change the location where the memory dump file is created, and refer that location to any data disk attached to the VM that has enough free space. To change the location, replace
%SystemRoot%
with the drive letter of the data disk, such asF:
, in the following commands.To enable the OS dump file, run the following load, add, and unload commands to implement the suggested configuration using the reg tool:
Load the registry hive from the broken OS disk:
reg load HKLM\<broken-system> <volume-letter-of-broken-os-disk>:\windows\system32\config\SYSTEM
Enable on ControlSet001:
reg add "HKLM\<broken-system>\ControlSet001\Control\CrashControl" /v CrashDumpEnabled /t REG_DWORD /d 1 /f reg add "HKLM\<broken-system>\ControlSet001\Control\CrashControl" /v DumpFile /t REG_EXPAND_SZ /d "%SystemRoot%\MEMORY.DMP" /f reg add "HKLM\<broken-system>\ControlSet001\Control\CrashControl" /v NMICrashDump /t REG_DWORD /d 1 /f
Enable on ControlSet002:
reg add "HKLM\<broken-system>\ControlSet002\Control\CrashControl" /v CrashDumpEnabled /t REG_DWORD /d 1 /f reg add "HKLM\<broken-system>\ControlSet002\Control\CrashControl" /v DumpFile /t REG_EXPAND_SZ /d "%SystemRoot%\MEMORY.DMP" /f reg add "HKLM\<broken-system>\ControlSet002\Control\CrashControl" /v NMICrashDump /t REG_DWORD /d 1 /f
Unload the broken OS disk:
reg unload HKLM\<broken-system>
Rebuild the VM
Use step 5 of the VM Repair Commands to rebuild the VM.
Contact us for help
If you have questions or need help, create a support request, or ask Azure community support. You can also submit product feedback to Azure feedback community.