Turn off drive after "Safely Remove"?

6,286

Solution 1

In Windows XP, the "Safely Remove" feature would completely turn off power to the associated USB port. (If the device is self-powered, its behavior depends on the device itself, in response to the comments above.)

In Windows Vista and above, this feature has been intentionally removed:

Microsoft Support: The Safely Remove Hardware feature does not stop power from being provided to a USB device in Windows Vista

Cause: The Safely Remove Hardware feature does not stop power from being provided to a USB device in Windows Vista. By design, the port to which the device is attached is not suspended in Windows Vista when the device is soft removed.

This is how you can enable it per device VID&PID or globally:

Microsoft Support: USB Port Remains Active for Disabled or Safely Removed USB Device

Resolution: To work around this problem, a registry value can be set to cause Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 to revert to the Windows XP and Windows Server 2003 behavior of disabling the USB hub port to which a Soft Removed USB device is attached. This workaround can be applied on a per-device basis (for all instances of a specific device (Vendor ID, Product ID, and Revision), or globally (for all enumerated USB devices).

[...]

Global Setting

To apply the workaround globally for all enumerated USB devices, add a REG_DWORD value named DisableOnSoftRemove that has a value of 1 to the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub\HubG

Use the following command to add the global setting value:

reg add HKLM\SYSTEM\CurrentControlSet\Services\usbhub\HubG /v DisableOnSoftRemove /t REG_DWORD /d 1 /f

Solution 2

I've tested this on Firewire and eSATA drives (well, the same drive but using those 2 different connectors), and the behavior on my Seagate drive is to simply unmount the drive, causing the external drive to behave as if the data cable had been disconnected—the HDD's light begins to dim and then turns off.

However, the drive itself doesn't actually turn off, even though it may appear to be (no spinning, no sound, no lights). This is so that the standard re-mounting procedure in Windows (disconnecting and reconnecting the Firewire/eSATA cable) will allow the drive to be re-mounted.

I believe the procedure on Macs is slightly different, and you can just re-mount it in software. (You can probably do the same thing in Windows 7 by disabling/re-enabling the USB/FireWire/SATA device in Device Manager, but it's kind of a pain.) But this too would require that the drive doesn't get shut off when you eject the disk.

As a side note, many external HDDs, such as mine, do not have a power switch. The only way to actually turn off its power is to disconnect the power cable. And the way to turn it on is to simply plug the power cable in. Otherwise, the HDD just goes into standby or sleep mode.

Share:
6,286

Related videos on Youtube

user541686
Author by

user541686

Updated on September 18, 2022

Comments

  • user541686
    user541686 almost 2 years

    Possible Duplicate:
    USB hard drive doesn't graceful power off after eject on Windows 7

    When you click "Safely Remove Hardware" to disconnect an external hard drive, Windows XP flushes the drive's cache and turns it off.

    On the other hand, Windows 7 only flushes the cache, but doesn't turn off the drive.

    How can I make Windows 7 behave like Windows XP?

    • fluffy
      fluffy about 12 years
      By "turn it off" do you mean power the drive down, or just unmount it? Once the drive's cache is flushed you can just turn it off safely, and Windows should just unmount it at that point.
    • user541686
      user541686 about 12 years
      @fluffy: Maybe my English was ambiguous, but by "turn it off" I definitely meant "power it down" lol. I don't really believe in the "you can just turn it off safely" thing, because the drives still spin when I take them out, and -- because some drives don't flush their caches correctly -- I'd want to power them down before taking them out.
    • user541686
      user541686 about 12 years
      @fluffy: Huh? There's definitely an ATA/SCSI power command that turns off a drive. And XP definitely turns off my drive when I click "safely remove" (you can hear the click, which, in Windows 7, only happens when you disconnect the cable). I don't think it's a minority of the drives... it's just a Windows 7 thing... (And yes, I know it might be doing self-parking, but I don't like risking the cache contents getting discarded. Just being paranoid I guess.)
    • fluffy
      fluffy about 12 years
      I've never had an external USB drive respond to that command either. Every USB enclosure I've used has just done its own silly power management. For some reason this is considered a feature.
    • Daniel R Hicks
      Daniel R Hicks about 12 years
      How does cutting the power at the port differ from unplugging the cable? The effect on the drive would be identical in both cases. The only situation where cutting the power might be important is a drive that slides into a housing, where you might want to cut power before physically moving the drive. (In fact, if you pull the cable to cut power you're able to give the drive as much time as you feel it needs to shut down.)
    • Piskvor left the building
      Piskvor left the building about 12 years
      "How does cutting the power at the port differ from unplugging the cable?" - when "cutting the power" through software commands, the 5V power line remains on; whether that affects behavior is undefined in practice (I've seen devices where the software power-down had different effects than physically cutting off power after unmount - as long as the line was on, capacitors remained charged, behavior was based on that).
  • user541686
    user541686 about 12 years
    This is a freaking awesome answer! It worked perfectly, thanks! :D