Windows 10 Sleep mode causes unsafe shutdown

Recently, when I leave my computer (desktop, not laptop) alone for half an hour or so, I will come back to find that rather than enter sleep or hibernate, the computer has shut down completely. While Windows 10 normally reuses boot information to make the Windows logo breeze past during startup, I'm usually staring at it for 2 minutes or more, even though the system OS is on a Solid State Drive.

What's more, when I start up the computer, a few programs offer clues that it was an unsafe shutdown. Firefox says it couldn't open the tabs I had up, and Steam asks me for my password (normally remembered).

I've looked in the Windows event logs, but nothing of interest appears at the time of the shutdown; there is one recurring event that stands out; a warning that says "The IO operation at logical block address 0x13f9b8 for Disk 0 (PDO name: \Device\00000031) was retried." It happens every few minutes, not just during a power event, so I'm not sure it's related.

EDIT: Assuming I ran smartctl (smartmontools) correctly, here is its output for C:.

SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   098   098   000    Old_age   Always       -       6863
 12 Power_Cycle_Count       0x0032   097   097   000    Old_age   Always       -       2181
177 Wear_Leveling_Count     0x0013   087   087   000    Pre-fail  Always       -       469
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0
181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0
183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0032   063   047   000    Old_age   Always       -       37
195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   001   001   000    Old_age   Always       -       529334
235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       134
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       56049724571

Solution 1:

Stop Windows 10 shutdown during sleep mode

After upgrading to Windows 10 I was dismayed to find my computer shutdown after I had left it in sleep mode. I finally stumbled across a solution to the problem.

  1. Click the icon in the lower left corner. Is this still called Start?

  2. Click Settings.

  3. Click System (Display, notifications, apps, power).

  4. Click Power & sleep.

  5. Scroll down to view Related Settings.

  6. Click Additional power settings.

  7. Click Change plan settings.

  8. Click Change advanced power settings.

  9. Click Hard disk plus sign to expand.

  10. Click Turn off hard disk after plus sign to expand.

  11. Click the number to engage adjustment.

  12. Click, or hold, the increase value arrow until you reach the number of minutes you desire.

    I ran mine up to 2180 and have not had an unexpected shutdown since.

Sorry I could not include my screenshots on this site.