Switch to full style
Data recovery and disk repair questions and discussions related to old-fashioned SATA, SAS, SCSI, IDE, MFM hard drives - any type of storage device that has moving parts
Post a reply

Does "Safely Reove Hardware" park R/W heads?

September 20th, 2015, 9:32

I have advised using Safely Remove Hardware (SRH) with 2.5" drives to minimize the risk of the stiction, but have been unable to verify that SRH causes the heads to park on the ramp any sooner than not using it. I found one thread where the OP cured a stiction problem that appeared after just unplugging an eSATA-connected external drive, even with power still applied form an auxiliary power source, but that's not definitive.

Does anyone have a citation to a description of exactly what SRH does (aside from flushing cache)?

Re: Does "Safely Reove Hardware" park R/W heads?

September 20th, 2015, 10:30

I always thought this was to make sure all delayed writes were finished / files were closed etc. I don't know what it does if anything with conventional drives (the hardware and parking etc), but thinking about it, parking would be logical. (no pun intended!)

Re: Does "Safely Reove Hardware" park R/W heads?

September 25th, 2015, 4:11

I've certainly had a few 2.5" drives in no-name USB enclosures where using the 'safely remove hardware' function will not cause the heads to park, so unplugging the drive causes an emergency head park.

As I am a Linux user, what I do now after unmounting the file system is to use 'hdparm -Y' to send the drive to sleep (which parks the heads and spins it down), and then unplug the drive. This also allows the drive to flush its write cache, which it might not necessarily have done if you rip the USB cable from the drive while it is still running.

I think hdparm is available for Windows too but I have no experience of using it there.

Re: Does "Safely Reove Hardware" park R/W heads?

September 25th, 2015, 8:57

@taffer, thanks for your reply. I always thought Safely Remove Hardware flushed cache and checked for locked files, as Brian mentioned, but unless one gets notification that the drive can now be safely removed, some process is still locking it. Of course disconnecting it at that time would risk heads still being over the platters. But if that notification is received, I guess there is a chance that the drive could be engaged in background processes on its own and still be at risk for stiction.

When you put it to sleep, do you have to awaken it when it is reconnected, i.e., does it go into PUIS?

Re: Does "Safely Reove Hardware" park R/W heads?

September 25th, 2015, 10:24

LarrySabo wrote:When you put it to sleep, do you have to awaken it when it is reconnected, i.e., does it go into PUIS?

no

Re: Does "Safely Reove Hardware" park R/W heads?

September 29th, 2015, 8:01

Hey there LarrySabo,

Safely removing a drive ensures all pending and ongoing processes from and to the targeted device are completed so no data is lost or corrupted. When everything is completed, the OS writes a small amount of data on the external drive indicating that everything was completed safely so the next time the drive is plugged, the OS (the same or different one) knows everything on the drive is as it should be. If the drive is unplugged without the safe eject option and that small amount of data is not there, there's a chance that the next time drive is plugged in, the OS wouldn't fine this piece of information and recognize the drive as corrupted or bad and may require a format before being able to work with it.
Regarding the parking, the drive should park its head short after it has completed all tasks and requests towards it and since the safe eject stops new ones it should mean that the drive will park the head after a short while (not immediately). :)

Captain_WD.

Re: Does "Safely Reove Hardware" park R/W heads?

September 29th, 2015, 16:08

Captain_WD wrote:Regarding the parking, the drive should park its head short after it has completed all tasks and requests towards it and since the safe eject stops new ones it should mean that the drive will park the head after a short while (not immediately). :)

Captain_WD.

My drive never parks its heads ... until I switch off the power.

Re: Does "Safely Reove Hardware" park R/W heads?

September 30th, 2015, 9:02

fzabkar wrote:
Captain_WD wrote:Regarding the parking, the drive should park its head short after it has completed all tasks and requests towards it and since the safe eject stops new ones it should mean that the drive will park the head after a short while (not immediately). :)

Captain_WD.

My drive never parks its heads ... until I switch off the power.


Do you have any specific features of the drive or settings that prevents it? What's the drive's brand and model? Some software programs do prevent the drive from going into sleep/standby mode by writing a small amount of data on the drive every minute or so, but not always (sometimes those amounts are small enough to be stored in the cache). There are commands that can prevent the head from parking in Linux (and not only) but generally each drive has a built-in parking function in its firmware.

Captain_WD.

Re: Does "Safely Reove Hardware" park R/W heads?

October 1st, 2015, 23:00

Captain_WD wrote:
fzabkar wrote:
Captain_WD wrote:Regarding the parking, the drive should park its head short after it has completed all tasks and requests towards it and since the safe eject stops new ones it should mean that the drive will park the head after a short while (not immediately). :)

Captain_WD.

My drive never parks its heads ... until I switch off the power.


Do you have any specific features of the drive or settings that prevents it?

Before I can answer your question it first needs to be phrased correctly. It's not a matter of which feature my drives have, it's more a case of which feature(s) they don't have. I take it from your response that you believe that drives will eventually spin down of their own accord, after an idle timer expires. That's called APM. Some drives have it, others don't. Mine don't. In fact many users find this feature to be annoying, even to the point of modifying a drive's firmware to disable it.

Here is one such case:
http://sourceforge.net/projects/apmtimer/

As for the OP's question, I don't have an answer, just some observations and more questions. ISTM that there are 3 ways to park the drive's heads:

1/ Rely on the drive's APM timer. ISTR that some bridge firmware will set the drive's APM value at power-on according to the values programmed in the configuration EEPROM. IIRC Cypress Semiconductor's bridges do this.

2/ Rely on the bridge firmware's power management strategy. Perhaps the bridge firmware implements its own idle timeout feature. It could do this by sending the ATA STANDBY or STANDBY IMMEDIATE commands to the drive. The first command causes the drive to go into standby mode after a specified time, while the second command has immediate effect.

3/ Rely on the OS to send a spindown/standby command to the USB bridge. I don't know whether any OS actually does this, or even whether there are ways for it to do so. I believe there is a SCSI START STOP UNIT command that could achieve this end, but I don't know whether it is implemented in SAT.

Does "Safely Remove Hardware" park hard drive heads?

October 3rd, 2015, 11:48

LarrySabo wrote:SRH causes the heads to park on the ramp any sooner than not using it

Starting from Windows 7 (probably from Vista, but we don't have it anywhere) it doesn't by default.

To make sure it does you need to 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


Step-by-step guide is:
- Click Start, click Run, type regedit in the Open box, and then click OK.
- Locate and then click the following subkey in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbhub
- On the Edit menu, point to New, and then click Key.
- Type HubG for the name of the new key, and then press ENTER.
- On the Edit menu, point to New, and then click DWORD (32-bit) Value.
- Type DisableOnSoftRemove for the name of the DWORD Value, and then press ENTER.
- Right-click DisableOnSoftRemove, and then click Modify.
- In the Value data box, type 1, and then click OK.

After that system will be disconnecting USB devices properly - hard drives will be stopped, flash LEDs won't be lit, etc.

This is a global setting for all devices, the same thing can be done per-device.

Re: Does "Safely Reove Hardware" park R/W heads?

October 3rd, 2015, 13:02

Thanks Dmitri. That clue led to a full explanation of events here.

Re: Does "Safely Reove Hardware" park R/W heads?

October 3rd, 2015, 16:32

Microsoft's article is written in "programmer-speak" and just poses more questions for me.

http://web.archive.org/web/201505310112 ... kb/2401954

When a USB device is Disabled in Device Manager or Safely Removed using the system tray icon, a Remove Device request (PnP IRP IRP_MN_REMOVE_DEVICE) is issued to perform a "Soft Removal" of the USB device. The USB device is marked as Removed for Plug and Play purposes, although the device has not been physically disconnected yet.

In Windows XP and Windows Server 2003, when a USB device is marked as Removed, the USB hub port to which it is connected is Disabled. When the port is Disabled, no further USB traffic is sent to the device.

In Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2, when a USB device is marked as Removed, the USB hub port to which it is connected is not Disabled.


What does "disabled" mean? Does it simply mean that the USB port is no longer monitored and all traffic to and from the port is stopped? The following blog suggests that no actual spin-down command is sent to the device. The author's external drive remains powered up and spinning.

Power Off USB Port when Safely Removed USB Device in Windows 7:
https://www.raymond.cc/blog/power-off-u ... windows-7/

I enabled the DisableOnSoftRemove value on my test computer and rebooted it. Then I tried connecting an external Maxtor hard drive, disabled it through Windows 7 Safely Remove Hardware but the LED light is still lit up which is supposed to be turned off according to the USB Safely Remove software blog ...

To test this further, I’ve installed a USB packet sniffer software called HHD Software Device Monitoring Studio 6.22 and it didn’t find any packets being sent/received to the external Maxtor hard drive after ejecting the external hard drive from Safely Remove Hardware.


The author of the following article observes that DisableOnSoftRemove "is only effective if you eject your external HDD via system tray and not by context menu in My Computer".

http://juan2geek.com/how-and-why-you-sh ... -ejecting/
Post a reply