Is it safe to replace hardware while a PC is suspended to RAM?

1

1

Is it safe to replace hardware while a PC is suspended to RAM?

Specifically:

  • Can you unplug an external hard disk without losing data?
  • Can you replace components like a drive or a PCI-express card? (I don't know why one would require this, but I'm curious)

I'm especially interested in Linux, but I don't know if the OS matters.

Bart van Heukelom

Posted 2013-12-24T09:14:08.360

Reputation: 1 958

1Really, don't. No benefit, high risks – mveroone – 2013-12-24T10:28:40.080

Answers

4

No, it's a really bad idea to start fiddling around inside the case while the PC is still powered on (which it is when in sleep mode). At best, the PC will fail to wake from sleep, at worst you can actually damage the components you're replacing.

A specific exception to this is in the case of hot-swappable components in servers, such as hard drives, PSUs, etc.

(You can of course still connect/disconnect anything that you normally would while the PC is powered on, such as USB devices. Just take the same level of care as you would during normal operation).

toryan

Posted 2013-12-24T09:14:08.360

Reputation: 726

4

Is it safe to replace hardware while a PC is suspended to RAM?

No, as Toryan already wrote, a PC in sleep mode is still powered on.

Specifically: Can you unplug an external hard disk without losing data?

If the OS flushed the disk cache prior to dropping to sleep mode: Probably yes.
If is was not done and you still are halfway though a change on the disk: No.

Can you replace components like a drive or a PCI-express card?

Replacing a PCI-e card on a powered-on consumer motherboard is a really bad idea. Even ignoring the risk of shorting things when plugging and unplugging cards on a powered on computer, you also run into initialisation problems. Normally a computer boots, detects hardware and configures it for usage. When the OS is already booted then the all devices are already configured. Adding new hardware will require this new device to catch up.

This is possible, but your OS needs to support it. (e.g. this is why you can plug in express-card, thunderbolt or USB devices). I have serious doubt about comsumer OS's and support for adding, let alone removing PCI-e cards.

SATA and SCSI drives are an exception to this. SCSI support hotplugging. As does SATA in AHCI mode (AHCI is normal SATA mode, as opposed to ancient IDE emulation mode).

(I don't know why one would require this, but I'm curious)

For disks the answer is easy. A failed drive can be replaced without bringing the server down. This works perfectly in combination with RAID. For SoHO tasks: Just power it down.

I'm especially interested in Linux, but I don't know if the OS matters.

The OS matter because it needs support to actually use the new devices. Or support to remove them. Which is something you would need to do before sleep mode. (Much akin to how you need to use safe removal for USB pen drives before unplugging them). If your PC is already in sleep mode then you are to late for this.

Hennes

Posted 2013-12-24T09:14:08.360

Reputation: 60 739

"If the OS flushed the disk cache prior to dropping to sleep mode: Probably yes." And do they do that? – Bart van Heukelom – 2013-12-24T15:08:00.047

I assume they do, but it will depend on the OS. For the Open source ones we can check it, for windows it will stay a guess. (A safe guess since going somewhat slower into sleep mode is a lot safer than getting corrupted filesystems, but still a guess). – Hennes – 2013-12-24T15:18:13.387