Is it safe to disconnect a SATA disk during sleep?

9

3

Is it safe to disconnect a SATA disk during sleep Windows 7? Is the disk powered off when the computer successfully have entered sleep mode? This is not my system disk, it's just a spinning disk for my photos.

MyAwsomeName

Posted 2013-07-24T15:28:52.277

Reputation: 91

Is it an external drive or do you mean the one on which your os is installed ? – Shekhar – 2013-07-24T15:29:50.620

Sleep mode saves all your data - files, open windows state, application running state to memory(ram) and your hard drive is powered off – Shekhar – 2013-07-24T15:34:50.640

2While you won't do physical damage removing the system disk in a sleep state will result in a system crash when the system resumes. – Ramhound – 2013-07-24T15:50:12.360

@Shakehar By default this is true, but depending on his power settings his disk may or may not sleep with the computer. I would first check your power settings, under advanced. As what Ramhound said however, if you attempted to resume your computer your OS will crash as it may have been using virtual memory space. Also you didn't mention this, but for the same reason I would not use the disk on another machine once it is removed if you plan on preserving your original session – Jason Bristol – 2013-07-24T15:54:05.273

I have set "never sleep" in power seettings. Note, this drive is not the system disk. I have updated the OP with that.. This is normal sleep, not hibarnation. – MyAwsomeName – 2013-07-24T16:05:55.883

I'm wondering why you felt the need to open up a pc and take out internal parts while electricity was still flowing through it – Simkill – 2013-07-24T16:21:09.153

@ThePhone / MyAwesomeName - to merge your accounts, please read the I accidentally created two accounts page on the help center.

– nhinkle – 2013-07-24T19:52:02.347

Maybe an interesting experiment but isn't this a purely academic question? Why would you ever want to risk data loss for this? In the time it took you to write the question you could have powered down and removed the disk. – Jan Doggen – 2013-07-25T12:54:28.787

possible duplicate of Is it safe to remove USB media when a computer is suspended?

– kinokijuf – 2014-02-16T18:08:35.923

Answers

8

Sleep mode in Windows saves your machines current state to memory and powers down your hard drive and monitor.

In case of external drives specially those that are connected through usb and are detected as external, Since you are using windows , the OS is smart enough to recognize that the external devices can be removed at any time and disables the write cache. This reduces the chances of data corruption.

So you can safely assume that you can remove your external drives without any data corruption. However as Ramhound pointed out - your system might crash if you remove your primary disk.

Systems have multiple power states from S-0 to S-4 and G-4.
S-0 is active work state and G-4 is full power down, where machine would need to reboot to power up.

S-1 to S-3 are successive states of Sleep and S-4 is hibernate state.
When the machine reaches state S-1 the processor shuts down.
At S-2 It loses hardware context and loses contents of cache ( this should also include all writing caches ). This should further protect you against any data corruption.
At S-3 (your default sleep mode) some more chips on the motherboard might be switched off.

So long story short, removing the hard drive while the machine is in sleep mode should not affect the health of the hardware as there are multiple checks built in to protect you against it.

Update marked S-3 as the default sleep mode - resource

Shekhar

Posted 2013-07-24T15:28:52.277

Reputation: 4 815

This was a internal SATA disk, not a usb connected disk. How do I know if the computer entered S1,S2 or S3? I clicked on the sleep button, not hibernation. – MyAwsomeName – 2013-07-24T16:10:51.420

you can check what you power setting for sleep mode are and determine what sleep mode is the machine is in. By default is should either be S2 or S3. I will update my answer once I have conclusive answer for this – Shekhar – 2013-07-24T16:19:10.730

@MyAwsomeName updated to answer your query – Shekhar – 2013-07-24T16:23:02.213

1

Another problem is that during the sleep state (and hibernate state too) there could be processes which have files open on the drive and the files content could be in inconsistent state which means that the data could be corrupted when you disconnect the disk.

Well written applications should do some cleanup before the system enters the sleep state and make the files consistent or even completely close them to prepare for possible drive removal during the sleep. See How can I know when Windows is going into/out of sleep or Hibernate mode?

The filesystem of the disk should be consistent as Windows flush the cache before entering sleep. See Does Windows flush drive caches on standby?

Closely related question: Is it safe to unplug a USB drive while Windows is in sleep/hibernate/off mode?

pabouk

Posted 2013-07-24T15:28:52.277

Reputation: 5 358