Detecting eSATA drive in Windows 7


Just got back from the store with your shiny new external hard drive, or you just tackled the UPS guy to rip open your brand new backup solution… you plug it in to your awesome Windows 7 box and!….

nada…

If you’re like me, it probably doesn’t detect your drive and you start cursing at your cat, flailing wildly and vowing to never buy another *insert manufacturer here*’s product again!
well calm down.. I have the solution!

If you don’t like to read, here is the entire project available for download:

Download Drive Detect for Windows 7Download the Project Files Download Drive Detect for Windows 7Download Setup Files

If you want to see how it works, here you go:
I knew I was going to need to utilize the Windows API to be able to interact with Device Manager, so, being not so API-inclined, I turned to my friends over on www.vbforums.com where Chris128 so graciously provided the API declarations and test code.
First, open a new project and add a new Class file to the project. Name it “WindowsApi.vb”.
In it will be the following API code:

Public Class WindowsApi
System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)
 _
 Public Structure SP_DEVINFO_DATA
 Public cbSize As UInt32
 Public ClassGuid As Guid
 Public DevInst As UInt32
 Public Reserved As IntPtr
 End Structure

 Public Const CM_LOCATE_DEVNODE_NORMAL As UInt64 = 0
 Public Const CR_SUCCESS As Integer = 0
 Public Const CM_REENUMERATE_NORMAL As UInt64 = 0

System.Runtime.InteropServices.DllImportAttribute(Cfgmgr32.dll,
EntryPoint:=CM_Reenumerate_DevNode) _

 Public Shared Function CM_Reenumerate_DevNode(ByVal dnDevInst As
UInt32, ByVal ulFlags As UInt64) As Integer
 End Function

 System.Runtime.InteropServices.DllImportAttribute(Cfgmgr32.dll,
EntryPoint:=CM_Locate_DevNode) _

 Public Shared Function CM_Locate_DevNode(ByRef PdnDevInst As UInt32,
ByVal pDeviceID As Integer, ByVal ulFlags As UInt64) As Integer
 End Function
End Class

I have added a button that lets me launch “My Computer” once it’s found, merely for convenience sake.

Here is a screenshot of the small UI that I came up with:

Drive Detect Screenshot

Get creative with it! I know this was a very annoying issue for myself, and if it’s a bug in Windows 7, hopefully it will be patched soon. But until that day comes, hopefully this will relieve a bit of the frustration!

Comments welcome.

16 thoughts on “Detecting eSATA drive in Windows 7

  1. Well, all I can say is Thank You both!!! I’ve been looking for an answer, or something that is easy to use to work around the problem.

    But weirdly, once I installed your little program and it brought up the drive, it’s auto-magically recognized and brought up each and every time now. Don’t need the little program. I’m keeping it tho.

  2. Good deal beck! Glad it’s working for you. I believe it is a “one time use” program (like you encountered) because it should recognize it after the initial detection. That should install the drivers correctly and work from then on, but as you know, things happen with drivers, so it’s a handy tool to keep around.

    Thanks again!
    -Steve

  3. wow, wordpress is picky with case sensitivity! link(s) should be working now. my apologies 🙂
    i’ve gotten mixed reviews on it actually working, but from what i gather, it is most commonly “not working” for people trying to use it as USB. it was built with the intention of detecting eSATA drives in Windows 7.

    let me know how it turns out!

    -Steve

  4. I was hoping that this software would work but…alas no luck.

    I had a Maxtor OneTouch 4 connected to this netbook running Windows 7 Starter. The drive worked fine until…I updated Adobe and plugged in a Targus USB hub.
    Suddenly the drive disappeared from Device Manager – so there is no option in reassigning the drive letter.
    I’ve tried all of the ports and disconnected the hub, with no luck.
    Tried uninstalling all of the USB ports with no success. I plugged in the drive to another Windows 7 Home machine and nothing. The drive lights up and all connections are secure. I also have Western Digital USB drive that won’t connect to either machine.

    The strange thing is that a computer at work running XP was using a USB external HD today and it was working but then Adobe updated itself and suddenly it couldn’t be found either. Coincidence?

  5. Ah. This app is more geared towards eSATA drives, but (theoretically) it should work for USB drives as well. Try this (seriously, this is gonna sound dumb), but shut down the computer and then UNPLUG the power cable from the wall/surge protector (you do use a surge protector right? ;))

    Let it sit unplugged for about 2 minutes and then fire it back up.

    Report back if it works/doesn’t work. I’d also be curious if you’re getting any of the balloon tooltips above your system tray when it’s plugged in.

    -Steve

  6. Hi Steve,

    I wish this had worked. I shut down the netbook, unplugged the surge protector from the wall and even took off the battery of the netbook for at least two minutes. Turned it all back on and still nothing – no balloon tips or anything. When I unplug the USB to the hard drive and plug it back in I get no sounds of recognition either.

  7. Did some quick googling on your specific drive and seems to be a Drive-specific problem (not the OS), which is actually a good thing as there’s usually a fix for it from the manufacturer (as opposed to waiting for Mr. Gates to push out a patch or SP).

    Try using SeaTools to run a diagnostic on your drive and see if it throws any errors. It sounds like the drive may be bad (and yes, even new hard drives can be DOA!)

    Convenient Download Link:
    http://www.seagate.com/www/en-us/support/downloads/seatools/

    Report back!

  8. Alas…that did not work either because the software didn’t detect the drive. It seems like a OS issue. Could I have shut off Plug & Play or is that impossible to shut down?

  9. Hmm… ” The drive worked fine until…I updated Adobe and plugged in a Targus USB hub” makes me about 99.9998% (It IS Windows so… -.0002%) confident that it is a drive problem and not OS.

    Something I should ask: Is this a new drive (aka, returnable) or is it an older drive?

    If it’s not returnable, you might try removing the actual hdd from the enclosure and hooking it up with an IDE cable the old fashioned way (if it’s a SATA drive inside, use a SATA cable). If the computer STILL doesn’t recognize it, then I’m gonna reward that remaining .0002% back to the drive for a full 100!

    I’ve never had much luck with Maxtor’s (re-branded SeaGates most of the time).

    Have you tried a System Restore to a point before that Adobe update? Or just uninstalling Adobe altogether?

  10. Hi there, I’ve been bashing my head against the wall trying to get my Mediasonics/Hitachi esata drive working with Win7 (works fine on my XP machine) so I was pretty excited to find this. Unfortunately, when I try installing your utility I get an error message telling me that I need to upgrade to .net framework 3.5. I already have version 4 installed; do I need to downgrade? Thanks for any help!

  11. Hey there king,
    It’s odd that you don’t have the 3.5 framework installed already as I thought it came with windows 7 by default. I would install it anyway as most applications these days are still targeting the 3.5 framework. You should be fine downloading the “compact” version as well if space is an issue. It should install alongside version 4, not replace it.
    Let me know how it turns out!

    Thanks for reading
    Steve

  12. Thanks for the fast reply. I got your program installed but alas, my drive was not found. I’ve used the drive successfully with XP and Vista but no luck with 7 so far. Thanks for the app but I guess I’ll have to keep looking!

Leave a Reply

Your email address will not be published. Required fields are marked *