Hello my name is Bob Golding and I would like to share information on a new error you may see in the system event log. It is Event ID 157 "Disk <n> has been surprise removed" with Source: disk. This error indicates that the CLASSPNP driver has received a “surprise removal” request from the plug and play manager (PNP) for a non-removable disk.
What does this error mean?
The PNP manager does what is called enumerations. An enumeration is a request sent to a driver that controls a bus, such as PCI, to take an inventory of devices on the bus and report back a list of the devices. The SCSI bus is enumerated in a similar manner, as are devices on the IDE bus.
These enumerations can happen for a number of reasons. For example, hardware can request an enumeration when it detects a change in configuration. Also a user can initiate an enumeration by selecting “scan for new devices” in device manager.
When an enumeration request is received, the bus driver will rescan the bus for all devices. It will issue commands to the existing devices as though it was looking for new ones. If these commands fail on an existing unit, the driver will mark the device as “missing”. When the device is marked “missing”, it will not be reported back to PNP in the inventory. When PNP determines that the device is not in the inventory it will send a surprise removal request to the bus driver so the bus driver can remove the device object.
Since the CLASSPNP driver sits in the device stack and receives requests that are destined for disks, it sees the surprise removal request and logs an event if the disk is supposed to be non-removable. An example of a non-removable disk is a hard drive on a SCSI or IDE bus. An example of a removable disk is a USB thumb drive.
Previously nothing was logged when a non-removable disk was removed, as a result disks would disappear from the system with no indication. The event id 157 error was implemented in Windows 8.1 and Windows Server 2012 R2 to log a record of a disk disappearing.
Why does this error happen?
These errors are most often caused when something disrupts the system’s communication with a disk, such as a SAN fabric error or a SCSI bus problem. The errors can also be caused by a disk that fails, or when a user unplugs a disk while the system is running. An administrator that sees these errors needs to verify the heath of the disk subsystem.
Event ID 157 Example:
This error is recorded even VHD/VHDX I mounted.
Why'm not removable.
[The VHD code does a surprise remove, but it does a dismount first. This error can be ignored in that scenario.]
I have started seeing this error just recently on my Dell laptop with an SSD drive. It seems to happen after I wake it from sleep mode. It comes out of sleep, then all of a sudden it reboots.
On a recently deployed 2012 R2 system it looks like these warnings were generated during (or immediately after) a "Windows Server Backup". I noticed that the backups are stored in VHD's. Also, the disk numbers the error refers to (2 and 3) do not exist when I examine the Disk Manager. I assume this is normal behavior and can be ignored, correct???
[This message may be generated with a VHD is removed. We are aware of customer feedback regarding this message and it's applicability for VHDs.]
I get this error multiple times every time a backup is run on my Windows Server 2012R2 Hyper-V host and it seems to be referencing a VSS drive (Disk 3 and my system only has three drives, 0, 1 and 2). About once every couple of weeks the system blue screens and reboots right after one of those errors.
[This occurs may occur when removing a VHD drive, however it is not expected when unmouning a VSS snapshot. If the system is blue screening immediately after an event 157 that may indicate a hardware problem with a disk.]
OK, so I'm a simple user (have been for nearly 30 years) and while I appreciate the non-explanation above, it only points out what "could cause" the problem.
My experience with this matter is that ever since I "upgraded" to WIN 8 my external HDs continuously surprise me (disconnects and immediately reconnects) and logs a 157 event - when it reconnects, it opens a window that will not allow any other action in other programs, so if I'm typing I must stop and close the window or click back onto my work.
It seems to happen randomly, with no action from me at all - I have 3 PCs, all running WIN 8.1 and all have the same issue. 2 PCs are upgrades from WIN 7 and one is a brand new (Xmas present) with native WIN 8.1. I have 3 external backup HDs (Seagate GoFlex, 2 WD MyBooks), all with latest drivers installed.
The dreaded SURPRISE REMOVE occurs an average of 20 times/HOUR - needless to say my backups can NOT be scheduled since my current operating mode is to disconnect the drives physically in order to do any work.
Bottom line for me: All external HDs surprise me constantly since the move to WIN 8.X (4 times since I have been typing this comment). I am heavily invested in MS/WIN/HP/Intel and really don't want to change, but I may have to - by the way, my MAC is rapidly becoming my "go to" computer. HELP!!!!!!
Please provide some real answers AND fix (not workarounds but FIX).
Thanks for your patience, mine's all but run out!
[As suggested in the article, this error indicates the drive was removed from the system. If this error is occurring with external hard drives then there is a problem with the hardware that is causing the drives to lose connection to the system.]
So I have noticed this too and there's no VHD being removed. The drive in question is my external usb drive, and it's plugged in all during the backup. This even occurs right as the backup begins.
There's no problem with the hardware, I've used this hardware with older operating systems with no issues.
How about I open a bug on this because I think you guys have a bug that's not been squashed.
[Most likely you are experiencing an intermittent hardware failure. This message is new, which is why you do not see it on older platforms. In older platforms the surprise remove would occur but the user was not informed of the problem.]
Ever since my upgrade to Server 2012 R2 I too am logging this error. It is always in the 0430AM time frame daily since the upgrade. I do not have a Disk 4 that the error keeps referencing. This is definitely a bug.
Log Name: System
Date: 3/31/2014 4:30:48 AM
Event ID: 157
Task Category: None
Disk 4 has been surprise removed.
<Event xmlns="" rel="nofollow" target="_new">schemas.microsoft.com/.../event">
<Provider Name="disk" />
<TimeCreated SystemTime="2014-03-31T08:30:48.613931100Z" />
[We are aware of a scenario where this error may be erroneously reported when a vhd drive is removed. Perhaps a vhd is being used by your backup software at 4:30.]