Stop Error 0x9F or hang occurs when you shut down or restart Windows Server

Applies to: Windows Server 2016Windows Server 2012 R2 DatacenterWindows Server 2012 R2 Essentials More

Symptoms


You may experience Stop error 0x9F or a hang when you shut down or restart Windows Server if the following condition is true:

  • You put a paging file on any drive other than the operating system (OS) drive. The OS drive is the drive on which the Windows folder resides. Usually it’s drive C.

In this case, Windows Server hangs at the “Shutting down” or “Restarting” message stage. You may also see Stop error 0x9F (DRIVER_POWER_STATE_FAILURE) after a timeout of 10 minutes.

Cause


If there is no paging file on the OS drive, NT Kernel Power Manager thinks that the OS drive can be powered down earlier than any other drives at shutdown. If the OS drive is powered down first, any page fault that requires reading data from the OS drive causes the shutdown procedure to hang.

Resolution


To avoid this issue, put a paging file on the OS drive. The size of the paging file is not important.

More information


If you do not have lots of free space on the OS drive, you can create the smallest (16 MB) paging file on the OS drive.

Note If you create a small paging file on the OS drive, the memory.dmp file may not be created when the system crashes. In this case, consider using one of the following methods.

Method 1: Put paging files on several drives and give them priority

  1. Start Registry Editor.
  2. Locate the following registry subkey:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management
  3. Double-click PagingFiles.
  4. Change the order of the paging files that are listed in the Value data box.

    For example: Say that you have drives C and E, and drive C has less free space, and drive E has lots of free space. You can give priority to the paging file on drive E, and keep the paging file on drive C smaller.

    E:\pagefile.sys 8492 8492
    C:\pagefile.sys 16 16
  5. Close Registry Editor and restart the system.

Method 2: Use DedicatedDumpFile on another drive that has lots of free space

Note Steps 6-8, below, are optional. Perform those steps if you want to set the dedicated dump file to a specific size. If you don’t have this registry key, the system will automatically create a dump file of the correct size.

  1. Start Registry Editor.
  2. Locate the following registry subkey:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControl
  3. On the Edit menu, point to New, and then select String Value.
  4. Change the value name to DedicatedDumpFile.
  5. Double-click DedicatedDumpFile, and then enter the file path.
  6. On the Edit menu, point to New and then select DWORD (32-bit) Value.
  7. Change the value name to DumpFileSize.
  8. Double-click DumpFileSize and enter the file size in MB. For example, if you want to capture a complete memory dump, specify it as the size of RAM+300 MB. If your system has 8 GB of RAM, you have to specify 8492 (MB).
  9. Close Registry Editor and restart the system.

References


For more information about DedicatedDumpFile, see the following article in the Microsoft Knowledge Base:

969028 How to generate a kernel or a complete memory dump file in Windows Server 2008 and Windows Server 2008 R2