The Safely Remove Hardware icon in Windows 8 (and 8.1) offers the ability to eject my internal SATA drives, including the boot drive (see example):

enter image description here

I don't see myself ever needing this - especially not from the convenience of the tray icon.

For Windows 7 exists well known solution (answer 1, answer 2, etc). But in Windows 8 msahci driver has been replaced by storahci. Unfortunately, TreatAsInternalPort workaround no longer works.

  • in Win7 it helped to install the Intel drivers. Which chipset do you have? Try to install the AHCI drivers from the chipset maker (AMD, Intel, nVIDIA) Aug 5, 2014 at 17:22
  • @magicandre1981 I have Intel ICH9 (not ICH9 R ) AHCI Controller. AHCI drivers from Intel (Matrix/RST) is not officially available for this southbridge. By the way, ICH9 supported by MS storahci driver. My initial question was regarding storahci driver only. I guess I should speak more clearly.
    – Anton
    Aug 7, 2014 at 23:41

5 Answers 5


The TreatAsInternalPort value still exists in the Windows 8 storahci driver, but its syntax has changed.

It is now in the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\storahci\Parameters\Device, and is a REG_MULTI_SZ list of port numbers to force treating as internal.

For example, to disable removability on ports 0 and 1, you would use

Windows Registry Editor Version 5.00


Unfortunately, i have no idea how these ports are numbered. 😕

  • Quick hint: right click the key and select "edit binary data" to get the hex view. Otherwise, using the default view, you'll mess it up.
    – omni
    Apr 4, 2016 at 16:07
  • Worked for me on fossilized ATI/AMD X1200 with Windows 10. Thanks! Oct 6, 2016 at 11:54

I had the same issue in Windows 8.1 with HDDs connected to an ASMedia 106x on-board chip and using the storahci driver instead of the ASMedia driver (would freeze up my box fierce!).

I ended up solving it using Raiddinn's suggestion found here.

Essentially, I created a scheduled task that runs when the system starts and that imports the following registry file, altering the "Capabilities" key under the 2 HDD devices:

Windows Registry Editor Version 5.00



The problem will be for you to track down the above keys for your setup as they are slightly different for every install. However, if you find the drive in question in your "Device Manager", then look at the properties, specifically "Device instance path" on the "Details" tab, you will find where in the registry the entry is located (always below HKLM\SYSTEM\CurrentControlSet\Enum\. So by combining HKLM\SYSTEM\CurrentControlSet\Enum\ with the "Device instance path", you should find the right location that contains the "Capabilities" value.

I hope this is somewhat helpful.

  • Thank you for point out this generic solution. Works like a charm. I would like to mention, that the above solution originally credited to Guillaume at Parallel Interface (Stop internal drive from showing up in "Safely remove hardware")
    – Anton
    Apr 1, 2015 at 13:52
  • 1
    Downvoted because it is a hackjob.
    – kinokijuf
    Jun 11, 2015 at 10:25
  • 3
    Upvoted because it's the only solution I've found that actually works in Windows 10.
    – willus
    Aug 7, 2015 at 17:52
  • @willus You should check mine. It’s much cleaner.
    – kinokijuf
    Aug 11, 2015 at 8:41
  • @kinokijuf Agreed, yours is cleaner. At the time, I couldn't figure out what value this "TreatAsInternalPort" key needed to have as everything I tried would not work. Nov 2, 2015 at 15:35

or Windows 10:

Windows Registry Editor Version 5.00

(Thanks to kinokijuf for the head-start, but his code Only disabled 1 drive for me (drive 0 on my 2nd controller).
This one worked for all 5 drives I have. (and probably the 6th too).
I think it was because there was a BLANK newline in between his values (00 in hex is newline), (30 in hex is 0, 31 is 1 etc).

This one worked on all 4 of my ports: screenshot

I need to block bus 0 and 3. I had to enter in hex 30 00 00 00 33 00 00 00 for the hex value. Problem solved.

  • This worked for me, but the location of was slightly different. I found it at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\storahci\Parameters\Device
    – Sasha
    Sep 19, 2016 at 5:27

None of the methods I've seen online worked with my amd x570 setup. Partly because none explain how to know which driver is being used; and thus which registry key needs attention.

So here we go for Windows 10:

  1. In Device Manager expand either:

    • IDE ATA/ATAPI controllers
    • Storage Controllers

    enter image description here

  2. Here you can open the Properties -> Events tab for whichever controller you are using:

    • Look for the registry key name after Device started
    • AMD Sata (amd_sata)

    enter image description here

    • Intel RST (iaStorAC)

    enter image description here

  3. With these names we now know which registry key to look for in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

    • amd_sata, iaStorAC, storahci, secnvme, spaceport, etc...
    • you can tell a driver is in use if it has an Enum key inside
    • for me storahci has no Enum key so adding TreatAsInternalPort wont affect anything
  4. Now this is the tricky part as each driver looks for a different registry setting

    • amd_sata, hide 2 drives on port 0 & 1 required a setting of 3:
    • Use AmdSataExternal, alternatively, to force showing eject for drives
  5. What about my controllers' registry setting?

    • I'm sorry I don't know any others.
    • You may be able to find some clues or registry settings in different versions the driver's inf file
    • If someone knows of a way to get a driver to list its possible registry options and values that would be cool. (I imagine it involves analyzing the driver's sys files?)

Hopefully, this helps someone else stuck on this.


Instructions Text Picture To clarify earlier posts on how to stop drives from showing up in the "Safely Remove Hardware and Eject Media" dialog box.

  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Oct 29 at 9:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .