Troubleshoot boot error - disk read error occurred

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."

Screenshot of A disk read error occurred message.

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.

  1. Create and Access a Repair VM.
  2. Select a Solution:
  3. Enable serial console and memory dump collection.
  4. 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

  1. Use steps 1-3 of the VM Repair Commands to prepare a Repair VM.
  2. Using Remote Desktop Connection, connect to the Repair VM.

Set partition status to active

Generation 1 VMs should first verify that the OS partition that holds the BCD store is marked as Active. If you have a Generation 2 VM, skip ahead to Fix the Disk Partition, as the Status flag was deprecated in the later generation.

  1. Open an elevated command prompt (cmd.exe).

  2. Enter diskpart to launch the DISKPART tool.

  3. Enter list disk to list the disks on the system and identify the attached OS virtual hard disk (VHD).

  4. Once the attached OS VHD is located, enter sel disk # to select the disk. See the following image for an example of where Disk 1 is the attached OS VHD.

    Screenshot of the diskpart window, which shows the result of listing and then selecting disk.

  5. Once the disk is selected, enter list partition to list the partitions of the selected disk.

  6. Once the boot partition is identified, enter sel partition # to select the partition. The boot partition is often approximately 350 MB in size. See the following image in which Partition 1 is the boot partition.

    Screenshot of the diskpart window, which shows the result of listing and then selecting partition.

  7. Enter detail partition to check the status of the partition. See the following screenshots for examples of the partition being set to Active: No or Active: Yes.

    Active: No

    Screenshot of the diskpart window with the output of the detail partition command, where Partition 1 is set to Active: No.

    Active: Yes

    Screenshot of the diskpart window with the output of the detail partition command, where partition 1 is set to Active: Yes.

  8. If the partition isn't set to Active, enter active to change the Active flag.

  9. Enter detail partition to check that the status change was completed properly, and verify that the output includes Active: Yes.

  10. Enter exit to close the DISKPART tool and save your configuration changes.

Fix the disk partition

  1. Open an elevated command prompt (cmd.exe).

  2. 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:

  1. Open an elevated command prompt session as an administrator.

  2. 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
    
  3. 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 as F:, 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.