Error code 47 (USB hd)

C

Cristiano

When I use the tray icon to remove the external USB hd, the hd is
correctly removed, but XP SP3 still sees the hd and I have no access to
the hd (I need to reboot the OS).
In device manager I see: "Windows cannot use this hardware device
because it has been prepared for "safe removal", but it has not been
removed from the computer. (Code 47)".

I tried to uninstall the driver, but it doesn't work.

How to fix the problem?

Thanks
Cristiano
 
G

glee

Cristiano said:
When I use the tray icon to remove the external USB hd, the hd is
correctly removed, but XP SP3 still sees the hd and I have no access
to the hd (I need to reboot the OS).
In device manager I see: "Windows cannot use this hardware device
because it has been prepared for "safe removal", but it has not been
removed from the computer. (Code 47)".

I tried to uninstall the driver, but it doesn't work.

How to fix the problem?


Code 47: Windows cannot use this hardware device because it has been
prepared for safe removal, but it has not been removed from the computer
http://technet.microsoft.com/en-us/library/cc755209(v=ws.10).aspx

Well, you can't access the drive if you have successfully clicked to
remove it. Did you physically unplug the drive from the computer after
removing it via the tray icon?

Are you saying that you physically remove the drive but it still appears
in the Safely Remove Hardware dialog, and if you insert the drive again
it is not recognized until you reboot?

If that's the case, try this:
Reboot the computer, then plug in the USB hard drive so it is
recognized.
While the drive is recognized, go to Device Manager, select the drive
under Disk Drives, and click the Uninstall button on the toolbar of
Device Manager.
After it is uninstalled, unplug the drive, then reboot.
Plug the drive in again after Windows restarts, let it be detected and
installed.
Now see if the problem still exists.
 
P

philo

When I use the tray icon to remove the external USB hd, the hd is
correctly removed, but XP SP3 still sees the hd and I have no access to
the hd (I need to reboot the OS).
In device manager I see: "Windows cannot use this hardware device
because it has been prepared for "safe removal", but it has not been
removed from the computer. (Code 47)".

I tried to uninstall the driver, but it doesn't work.

How to fix the problem?

Thanks
Cristiano


Makes no sense. If you have elected to remove the HD why are you
surprised that your machine can not read it.

Try right clicking on the drive's icon and opt for "eject"
 
C

Cristiano

On 22/09/2012 21:06, glee wrote:> Code 47: Windows cannot use this
hardware device because it has been
prepared for safe removal, but it has not been removed from the computer
http://technet.microsoft.com/en-us/library/cc755209(v=ws.10).aspx

Well, you can't access the drive if you have successfully clicked to
remove it. Did you physically unplug the drive from the computer after
removing it via the tray icon?

No.
The problem is that after I have successfully clicked to remove the
driver I still see it in the system (for example in Windows Explorer),
but I cannot access it (I got an error message).
Are you saying that you physically remove the drive but it still appears
in the Safely Remove Hardware dialog, and if you insert the drive again
it is not recognized until you reboot?

If I safely remove the drive, it no longer appear in the Safely Remove
Hardware dialog, but it still appear in Windows Explorer.
If I insert the drive again it is not recognized until reboot and when I
try to reboot, the PC hangs and I need to press the reset button on the
PC case.
If that's the case, try this:
Reboot the computer, then plug in the USB hard drive so it is recognized.
While the drive is recognized, go to Device Manager, select the drive
under Disk Drives, and click the Uninstall button on the toolbar of
Device Manager.

Device Manager hangs and I need to terminate it; I can't uninstall the
drive.

Cristiano
 
V

VanguardLH

Cristiano said:
When I use the tray icon to remove the external USB hd, the hd is
correctly removed, but XP SP3 still sees the hd and I have no access to
the hd (I need to reboot the OS).
In device manager I see: "Windows cannot use this hardware device
because it has been prepared for "safe removal", but it has not been
removed from the computer. (Code 47)".

I tried to uninstall the driver, but it doesn't work.

How to fix the problem?

There is no "remove" action in the Safely Remove Hardware wizard. There
is a "Stop" action. You stop the device and then later can decide if
and when you want to physically remove it.

http://fixexe.com/pictures/safely-remove-hardware.png

The device may not be physically detected later until you physically
unplug and replug the device. Leaving it in the USB port after stopping
it may not permit you to simply restart the device. You unplug the
device and then later replug it to redetect it. I've heard but not
tested that some 3rd party software overcomes that limitation so you can
stop the device, leave it plugged in, and restart it later while still
plugged in; e.g., USB Safely Remove (http://safelyremove.com/, $20) and
Zentimo Storage Manager (http://zentimo.com/, $20). Another trick I've
been told about is to use Device Manager to disable the USB hub on which
the still-plugged-in device is connected and then reenable the USB hub
to force redetection of the still-connected devices on it (although you
might have to reenable those still-connected devices after reenabling
their USB hub). Of course, disabling the USB hub means all devices
still connected to it are also going to be affected.

After you unplug a USB device, it may not necessarily disappear from
Windows Explorer until you refresh Windows Explorer. You didn't mention
if you had Windows Explorer loaded at the time you stopped AND unplugged
the device. You didn't mention if you closed the still-open Windows
Explorer to reload it and have it scan for devices again. Close Windows
Explorer, stop the device, unplug the device, and then load Windows
Explorer.

After stopping the device and after physically removing it, can you plug
it in again to get it redetected and usable?

After stopping the device and after physically removing it from the USB
port, have you tried plugging the USB device into a different USB port?
Has this USB device been plugged into every available USB port in the
past? If so and the device is not detected upon reinsertion then it
could be an enumeration (registry) problem. If that's the problem then
registry editing to delete the old ENUM entries can force redetection of
the device but using Nirsoft's USBDevView is probably safer; however, if
enumeration is the problem then usually even after a reboot the ENUM
data is still going to be the same as before and still cause detection
problems (and you noted that a reboot got the device detected okay).

Note that some USB devices are poorly designed. They don't properly
transmit their presentation data on initiation (the USB handshaking)
when plugged in but previously powered up and used before. That is,
they were powered up, used before, stopped (and unplugged) but left
powered up, and upon initiation (plugging in) they don't present
presentation data the OS can understand. I've had that problem with
some MagicJack USB dongles where Nirsoft's USBDevView or Microsoft's USB
Device View show the OS couldn't understand the device's presentation
data (what it sends to the OS to identify its device type). The device
requires a reset on its hardware. Alas, few USB devices comes with a
reset and instead rely on a power cycle (power off, power on) on
themself or on their interface to do a reset.

Presumablly when you use the Stop action (there's no Remove action) in
the Safely Remove wizard, and because you're asking about a device that
has buffers (cache), they should get flushed before the device is
actually in stopped status and BEFORE it get physically removed. I've
read where other users had slow or stubborn USB hard disks (more likely
a poor USB interface in the external case rather than with the drive
itself) after trying to stop them so they used SysInternal's 'sync'
utility to flush the hard disk's cache (force an immediate write from
cache to platters). 'sync' has both flush and eject functions, so you
could stop the device using the Safely Remove wizard, use 'sync' to
flush the drive's cache, and use 'sync' to eject the device (change its
logical connection status) or use Windows Explorer for that.

SysInternals 'sync'
http://technet.microsoft.com/en-us/sysinternals/bb897438.aspx

Even if you stop a device, processes may still be loaded that have open
file handles on files on that device which can prevent flushing.
Zentimo and USB Safely Remove have a Forced Stop function to unload any
apps launched from the drive or unlock the inuse files. SysInternals'
'sync' (freeware) might also work for that but I haven't tested it since
I always close any apps ran from the device or close those files since
I'm obviously trying to yank away the storage device for them.

See http://safelyremove.com/fullFeaturesList.htm in the "Stopping via
disabling". This is were stopping the device in the Safely Remove
wizard doesn't really stop the device (the driver for the device doesn't
perform the requested action) and instead you have to disable the device
in Device Manager. Because the device gets disabled to properly "stop"
it, replugging it in won't get it automatically enabled (so it goes
through its handshaking to transmit its presentation data to identify it
to the OS) - unless you use 3rd party software to automatically reenable
the device upon reconnection.

USB has been somewhat a crappy interface specification not so much due
to its definition (after v2.1) but mostly due to poor implementation in
the hardware. You might find better management of USB devices by using
the 3rd party programs. While SysInternals has freeware, they don't
provide all the functionality of the payware tools. At one time,
Zentimo was more expensive than USB Safely Remove. It had a few more
features but not critical so I used to recommend USB Safely Remove as a
3rd party solution; however, Zentimo lowered their pricing so it's the
same as USB Safely Remove. Here's a comparison between those two
products:

http://zentimo.com/zentimovsusbsr.htm
 
C

Cristiano

You do NOT uninstall Drivers when you want to remove an external
read/write storage device !

I meant: "the problem is that after I have successfully clicked to
remove the *drive* (i.e. the external hd, not the "driver") I still see
it in the system [...]".
Sorry, but my English is not too good.

Cristiano
 
G

glee

Cristiano said:
On 22/09/2012 21:06, glee wrote:> Code 47: Windows cannot use this
hardware device because it has been

No.
The problem is that after I have successfully clicked to remove the
driver I still see it in the system (for example in Windows Explorer),
but I cannot access it (I got an error message).


If I safely remove the drive, it no longer appear in the Safely Remove
Hardware dialog, but it still appear in Windows Explorer.
If I insert the drive again it is not recognized until reboot and when
I try to reboot, the PC hangs and I need to press the reset button on
the PC case.


Device Manager hangs and I need to terminate it; I can't uninstall the
drive.

Stop the drive, using the Safely Remove Hardware tray icon.
Then physically unplug the drive from the computer.
REBOOT the computer.
When Windows is loaded, plug the drive in again, so it is detected and
you can access it.
Open Device Manager and uninstall the drive, then remove the drive
physically AFTER that.

Are you saying that you can't open Device Manager even after you have
rebooted and inserted the drive and can access it?
 
C

Cristiano

There is no "remove" action in the Safely Remove Hardware wizard. There
is a "Stop" action. You stop the device and then later can decide if
and when you want to physically remove it.

http://fixexe.com/pictures/safely-remove-hardware.png

Unfortunately, I have the Italian locale and I don't know the exact
words. Anyway, when I want to safely remove the hd, I click the tray
icon with the left mouse button (I don't use the windows in your picture).
After stopping the device and after physically removing it, can you plug
it in again to get it redetected and usable?

No, I need to reboot.
After stopping the device and after physically removing it from the USB
port, have you tried plugging the USB device into a different USB port?

Yes; always the same result.
Has this USB device been plugged into every available USB port in the
past?

No; I always use the same port.
Note that some USB devices are poorly designed. [...]

It worked well until yesterday, so I guess the hd is good and I guess
that some strange software problems happened.
Presumablly when you use the Stop action (there's no Remove action) in
the Safely Remove wizard, and because you're asking about a device that
has buffers (cache), they should get flushed before the device is
actually in stopped status and BEFORE it get physically removed.

The strange thing is that I don't use the cache; I use the option where
the write cache is disabled.
[...]. Here's a comparison between those two products:
http://zentimo.com/zentimovsusbsr.htm

Thank you, but I think that it is just a software problem.
I connected the hd in my notebook and it worked well; I can connect and
disconnect it without any problem.

Cristiano
 
C

Cristiano

Stop the drive, using the Safely Remove Hardware tray icon.
Then physically unplug the drive from the computer.
REBOOT the computer.
When Windows is loaded, plug the drive in again, so it is detected and
you can access it.
Open Device Manager and uninstall the drive, then remove the drive
physically AFTER that.

Are you saying that you can't open Device Manager even after you have
rebooted and inserted the drive and can access it?

I can open Device Manager, but when I click the menu item to uninstall
the drive, Device Manager hangs and the only thing I can do is to
terminate Device Manager.
I also tried NirSoft's USBDeview and the same thing happens.

Cristiano
 
G

glee

Cristiano said:
I can open Device Manager, but when I click the menu item to uninstall
the drive, Device Manager hangs and the only thing I can do is to
terminate Device Manager.
I also tried NirSoft's USBDeview and the same thing happens.


Start the computer in Safe Mode, and try the procedure I described to
uninstall the drive, while in Safe Mode.
Then restart in normal mode and see if the drive problem still exists.
 
G

glee

Cristiano said:
I can open Device Manager, but when I click the menu item to uninstall
the drive, Device Manager hangs and the only thing I can do is to
terminate Device Manager.
I also tried NirSoft's USBDeview and the same thing happens.

If trying the procedure in Safe Mode does not work, download
DriveCleanup v.0.8.1 from here:
http://www.uwe-sieber.de/drivetools_e.html#drivecleanup

Unzip it into its associated folders, then run the 32-bit version. It
is a command line tool, you must run it from a command prompt.
 
C

Cristiano

If trying the procedure in Safe Mode does not work,

In safe mode I can uninstall the drive, but the problem still persist.
download DriveCleanup v.0.8.1 from here:
http://www.uwe-sieber.de/drivetools_e.html#drivecleanup

Unzip it into its associated folders, then run the 32-bit version. It
is a command line tool, you must run it from a command prompt.

It deleted 57 registry keys, but the problem still persist.

I'm starting to think that it is a network problem. I could be wrong,
but when I safely remove the drive, I still see it in Windows Explorer
(as I told you, but not in Disk Management).
When I double click the drive icon, I get the error in the "SYMPTOMS"
paragraph:
http://support.microsoft.com/kb/840749
"E:\ refers to...".

Cristiano
 
G

glee

Cristiano said:
In safe mode I can uninstall the drive, but the problem still persist.


It deleted 57 registry keys, but the problem still persist.

I'm starting to think that it is a network problem. I could be wrong,
but when I safely remove the drive, I still see it in Windows Explorer
(as I told you, but not in Disk Management).
When I double click the drive icon, I get the error in the "SYMPTOMS"
paragraph:
http://support.microsoft.com/kb/840749
"E:\ refers to...".

No.... that doesn't indicate you have a network problem. You have
stopped the drive via the Safely Remove tray icon. Although it is
visible in Explorer, it is no longer mounted and so you get the error.

The only way it would be a "network problem" is if you have, for some
strange reason, mapped the USB drive as a network drive... I can't
imagine a reason why you would have done that, though.
 
G

glee

Cristiano said:
In safe mode I can uninstall the drive, but the problem still persist.


It deleted 57 registry keys, but the problem still persist.

I'm starting to think that it is a network problem. I could be wrong,
but when I safely remove the drive, I still see it in Windows Explorer
(as I told you, but not in Disk Management).
When I double click the drive icon, I get the error in the "SYMPTOMS"
paragraph:
http://support.microsoft.com/kb/840749
"E:\ refers to...".

Please answer these questions:
Do other USB drives (hard drives, flash drives) get stopped and removed
correctly? Is this the only drive with this issue?
Does the drive stop and remove correctly on other computers?

By the way, you must run DriveCleanup while the USB drive is NOT
connected and NOT visible in Explorer, or it won't remove the entries
for that drive.... Reboot after running it, also.

If DriveCleanup still does not fix your problem, try this.
Make sure the USB drive is physically removed and does not appear in
Explorer.... reboot if needed to remove it.
Shut down the computer.
Unplug the computer from the power. If it is a laptop, also remove the
battery.
With ALL power disconnected, press and HOLD the power button on the
computer (the button used to turn on the computer) for 30 seconds.
Leave the computer off for a while.... I would wait 10 to 20 minutes.

Plug the computer back into power and insert the battery if it's a
laptop.
Do NOT insert the USB drive.
Run DriveCleanup again to remove all entries for non-present devices.

Now try the drive again and see if the problem still exists.
I'm out of further ideas at the moment.
 
C

Cristiano

Please answer these questions:
Do other USB drives (hard drives, flash drives) get stopped and removed
correctly? Is this the only drive with this issue?

I have 3 external drives and they all have the same problem.
My 2 flash drives are correctly removed.
Does the drive stop and remove correctly on other computers?

Yes (notebook with Win7).
By the way, you must run DriveCleanup while the USB drive is NOT
connected and NOT visible in Explorer, or it won't remove the entries
for that drive.... Reboot after running it, also.

I already done that (as you told me).
If DriveCleanup still does not fix your problem, try this.
Make sure the USB drive is physically removed and does not appear in
Explorer.... reboot if needed to remove it.
Shut down the computer.
Unplug the computer from the power. If it is a laptop, also remove the
battery.
With ALL power disconnected, press and HOLD the power button on the
computer (the button used to turn on the computer) for 30 seconds.
Leave the computer off for a while.... I would wait 10 to 20 minutes.

Plug the computer back into power and insert the battery if it's a laptop.
Do NOT insert the USB drive.
Run DriveCleanup again to remove all entries for non-present devices.

Now try the drive again and see if the problem still exists.

I'll try your "strange" :) procedure (now I can't).
I'm out of further ideas at the moment.

Anyway, thank you.
Cristiano
 
C

Cristiano

No.... that doesn't indicate you have a network problem. You have
stopped the drive via the Safely Remove tray icon. Although it is
visible in Explorer, it is no longer mounted and so you get the error.

The only way it would be a "network problem" is if you have, for some
strange reason, mapped the USB drive as a network drive... I can't
imagine a reason why you would have done that, though.

I didn't.

The strange thing is that I don't use the cache, but after I safely
removed the drive, I right click the C icon (the OS drive) in Windows
Explorer to access the property sheet; then, in the hardware page I
double click the USB drive. In the second tab I see the second option
checked, where it is said that the drive uses the cache (after I safely
removed the drive I can't change the cache settings because the options
are grayed and disabled). A bit strange...

I don't know if I am clear enough, but with the Italian locale I don't
know what exactly you see with your US locale.

Cristiano
 
C

Cristiano

When I use the tray icon to remove the external USB hd, the hd is
correctly removed, but XP SP3 still sees the hd and I have no access to
the hd (I need to reboot the OS).
In device manager I see: "Windows cannot use this hardware device
because it has been prepared for "safe removal", but it has not been
removed from the computer. (Code 47)".

I tried to uninstall the driver, but it doesn't work.

How to fix the problem?

Gee! I can't believe it!
I just uninstalled the free download version of Returnil:
http://www.returnilvirtualsystem.com/
and now is all working well as before.

After the safe removal of the hd, I also see that the audio doesn't
work, changing the network settings doesn't work, the video players
don't work...
I installed Returnil few days ago and it was the only thing which can
interfere so deeply with the OS, hence...

Thank you to all
Cristiano
 
G

glee

Cristiano said:
Gee! I can't believe it!
I just uninstalled the free download version of Returnil:
http://www.returnilvirtualsystem.com/
and now is all working well as before.

After the safe removal of the hd, I also see that the audio doesn't
work, changing the network settings doesn't work, the video players
don't work...
I installed Returnil few days ago and it was the only thing which can
interfere so deeply with the OS, hence...

Thank you to all
Cristiano

Aha! You were running a virtual environment that prevents changes to
the system... interesting, the side effects it had.
 
V

VanguardLH

Cristiano said:
I just uninstalled the free download version of Returnil and now is
all working well as before.

While I like the concept of Returnil, I have also had problems with that
product. For me (and reported by others), it slammed CPU usage to 100%
which destroyed responsiveness of my computer. This was even when it
was quiescent (loaded but not running in its safe mode). While I use
virtual machines (VMs) to isolate trial, unknown, or untrusted software,
I wanted to use Returnil for temporary protection without the slowdown
incurred by using a VM. Hardware is emulated in software except the CPU
in a VM but Returnil allows access to the real hardware and only
virtualizes the disk I/O (to discard changes in the virtualized disk)
which *should* incurs little impact to the host. The impact from disk
virtualization was neglible (benchmarks showed such a small change in
performance that their statistical variation in multiple measurements
would swamp the reported performance decrease) but the 100% CPU usage
results in making my host unusable. I finally gave up on Returnil when
it generated BSODs on reboot (to exit its safe mode and reboot back into
normal [non-virtualized] mode). The crashes didn't damage any files but
I didn't care for a product that crashed on exit even though a reboot
was needed anyway to switch modes. Returnil loaded, switch into safe
mode, do stuff, exit safe mode which requires a reboot, BSOD, hit Reset
to do another reboot, and finally back into normal mode.

I encountered the 100% CPU usage bug that has been reported by other
users for several years. I hit the anti-executable bug reported 10
months ago (http://www.wilderssecurity.com/showthread.php?t=312666).
Then I hit the BSOD bug on safe mode exit that I reported 5 months ago
(http://www.wilderssecurity.com/showthread.php?t=322643). That was the
last straw and I got rid of Returnil. Their development team is too
slow or underpowered as it takes way too long for them to fix critical
defects in their software. That latest version (REL14) was released way
back on 06-JUL-2011, they have a boat load of fixes to do (some
critical), and their development and support is fading. Another good
product dying from neglect. They were calling for beta testers (so
alpha testing was completed which means all functionality changes and
critical fixes have already been applied and they want various platforms
on which to test the new version to find any minor changes needed) back
on 12-JAN-2012 but still no new version after 9 months. They can't even
bother to release minor versions that address critical bugs. It's
become a lost cause.

Better start saving backup images of your partitions at regular
intervals rather than rely on the cleanup actions of an uninstaller.
 
C

Cristiano

Aha! You were running a virtual environment that prevents changes to
the system... interesting, the side effects it had.

No, Returnil was totally disabled (program not running and no running
services)! O_O

Cristiano
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

HD not recognised 4
HELP: lost HD partition woes... 2
Is broken my hd?? 2
USB 1
External HD question 6
Plugged in USB 2.0 HD Not recoginized in Windows XP 8
Re: Recover User Profile 15
External HD Display 2

Top