Contribute
Register

[Guide] HackrNVMeFamily co-existence with IONVMeFamily using class-code spoof

Stork

Admin
Staff member
Joined
Sep 21, 2010
Messages
13,351
Motherboard
ASUS ROG MAXIMUS X HERO Z370
CPU
i7-8700K
Graphics
RX 580
Mac
MacBook Pro, Mac mini, Mac Pro
Classic Mac
Power Mac, PowerBook
Mobile Phone
iOS
icon I have already changed it when I installed Catalina but I read somewhere that I have to create ssdt and add built in into it
Hmmm. I haven't heard you need a SSDT. I just change the disk icon by
Right clicking on the drive icon choosing Get Information;​
dragging the new icon on top of the disk icon in the Get Information window; and​
closing the Get Information window.​

I've used this procedure on my Mac Pros and MacBook Pros for years.
 
Joined
Oct 23, 2010
Messages
903
Motherboard
GA-Z77X-UP5-TH
CPU
i7-3770K
Graphics
RX 580
Mac
iMac, MacBook Pro
Mobile Phone
Android, iOS,
Hmmm. I haven't heard you need a SSDT. I just change the disk icon by
Right clicking on the drive icon choosing Get Information;​
dragging the new icon on top of the disk icon in the Get Information window; and​
closing the Get Information window.​

I've used this procedure on my Mac Pros and MacBook Pros for years.
With respect, it not simple as changing the disk icon. That is, it's not cosmetic. MacOS truly believes that the NVMe drive is external and EJECTABLE (like a USB drive). In Finder, the Volume actually has an EJECT button in the sidebar.
In @tsrattan's IOREG picture, it shows "Physical Interconnect Location" property is set to External - which makes it ejectable. It's something that should not happen if the drive is bootable.

@tsrattan, there are a couple of solutions:
1. SSDT similar to @RehabMan's SSDT example (minus the spoofing as it's not needed anymore).
2. There's a Lilu Plugin kext called Innie that injects the appropriate properties in any NMVe device (google it).

I just installed (literally arrived this afternoon) a Sabrent Rocket 1TB NVMe and found this issue (external drive for NVME). This is on my ageing Z77X-UP5 system. I bought a NVMe-to-PCIe adapter and installed it in the right-most PCIe x16 slot (as seen from the rear).

I did not want yet another kext (whose sources I cannot find) so I wrote an SSDT based on @RehabMan's guide here and it now shows the NVMe as Internal and it no longer appears on the desktop as an ejectable drive.

Here's is the SSDT:
C-like:
DefinitionBlock ("", "SSDT", 2, "hack", "nvme", 0x00000000)
{
    External (_SB_.PCI0, DeviceObj)

    Scope (\_SB.PCI0)
    {
        Device (PEG2)
        {
            Name (_ADR, 0x00010002)  // _ADR: Address (of PCI Bridge - 3rd PEG slot)
            
            Device (NVMe)
            {
                Name (_ADR, Zero)  // _ADR: Address (first device on this bus)

                Method (\_SB.PCI0.PEG2.NVMe._DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                {
                    If (!Arg2) { Return (Buffer () { 0x03 }) }
                    Return (Package ()
                    {
                        "built-in", Buffer () { 0 }
                    })
                }
            }
        }
    }
}
My IOREG now looks like this:
Screenshot 2019-12-10 at 23.26.10.png


Your IOREG looks similar to mine (same PCI addresses and names).
Use the above SSDT (attached as source so you'll need to compile it) and try it.
In my case, the PEG2 device does not exist so I defined it in the SSDT at address 0x00010002 but in your case, it is already defined but should be fine.
If not, then your SSDT would be:
C-like:
DefinitionBlock ("", "SSDT", 2, "hack", "nvme", 0x00000000)
{
    External (_SB_.PCI0.PEG2, DeviceObj)

    Scope (\_SB.PCI0.PEG2)
    {
        Device (NVMe)
        {
            Name (_ADR, Zero)  // _ADR: Address (first device on this bus)
            Method (\_SB.PCI0.PEG2.NVMe._DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (!Arg2) { Return (Buffer () { 0x03 }) }
                Return (Package ()
                {
                    "built-in", Buffer () { 0 }
                })
            }
        }
    }
}
Try both.
 

Attachments

Joined
Dec 17, 2014
Messages
7
Motherboard
Gigabyte GA-H97-D3H
CPU
i4790k
Mac
Classic Mac
Mobile Phone
Is there an idiot proof guide for installing, from 10.11.6 install, a 970 EVO NVMe M.2 into a H97-D3H + i7-4790K build? I'm getting lost in the updates that have been posted since this thread was born.
 
Joined
Nov 25, 2013
Messages
75
Motherboard
P9X79 Pro
CPU
Xeon > need model #E5-2697V2
Graphics
Radeon VII
Hello all,

Here is my configuration: Asus Hyper Mini M.2 // M.2 -> U.2 cable // Samsung PM1733 // OS X 10.11.6

I ran the patch by typing this from the terminal:

./patch_nvme.sh 10_11_6_sec2017-005-15G18013
This is the exact OSX version I have. It made the .kext and gave the MD5 results. No error. Then, I imported it to S/L/E with KextBeast. You can read it in attachment. From then, I'm getting troubles: OSX runs very slowly with big freezes. I just can reach the session login. Those freezes disappear immediatly as soon as I remove the drive (while the PCI-Express Hyper Mini card keeps being plugged). I'm using a dock for hotswap... but cold plug give also the same results.

I removed IONVMeFamily.kext in case it would make a conflict but it doesn't change anything.

This SSD U.2 works fine with Windows and Ubuntu on the same computer so it's not a hardware issue.

Any help appreciated.

Thank you.

EDIT1: Clover and kext attached.
EDIT2: I destroyed the partition of the SSD and reinitialized just as GPT, no change.
EDIT3: Very similar bug here with a Samsung PM1725a using also U.2 interface
EDIT4: I installed IOREG application, HackrNVMeFamily doesn't appear anywhere (when the U.2 is unplugged)

EDIT5: I followed this method to change the sector to 4096 bytes with Smartmontools on Ubuntu. Successfully. So then I restored IONVMeFamily.kext and loaded it using terminal. But I can't still see the drive in the MAC drive utility. Same with smartctl tool from OS X Terminal.
@RehabMan : You said it would launch without your patch if the drive is set to 4096 bytes sector. Do you think it's not the case for OS X 10.11.6?
 

Attachments

Last edited:
Joined
Mar 13, 2020
Messages
4
Motherboard
Asus > need model # > See Rules!
CPU
i5-5300U
Graphics
HD 5500
Dear sir,
My PC is dell optiplex 9030 aio, i5 4590s, hd 4600, liteon m.2 2242 nvme 256gb.
I installed successfully catalina on nvme ssd using OC 0.5.8. However, I cannot boot directly from nvme ssd (not supported by my motherboard). Before I used nvmepressdxe.efi I worked. After that my PC had problems, I re-installed macos again, also used the same efi, and config.plist, but cannot boot from nvme, have to boot from usb. I found your guide and followed. When I complied SSDT_NVMe-Pcc.aml in maciasl the errors happened as shown in the photo. COuld you please help me to fix this problem? Thank you!
 

Attachments

Stork

Admin
Staff member
Joined
Sep 21, 2010
Messages
13,351
Motherboard
ASUS ROG MAXIMUS X HERO Z370
CPU
i7-8700K
Graphics
RX 580
Mac
MacBook Pro, Mac mini, Mac Pro
Classic Mac
Power Mac, PowerBook
Mobile Phone
iOS
Dea Rehabman, I fixed complied error, but failed to load ssdt.
You don't need RehabMan's NVMe kext or SSDT for Cataline. Apple's macOS started recognizing NVMe drives several versions of macOS ago.
 
Joined
Mar 13, 2020
Messages
4
Motherboard
Asus > need model # > See Rules!
CPU
i5-5300U
Graphics
HD 5500
You don't need RehabMan's NVMe kext or SSDT for Cataline. Apple's macOS started recognizing NVMe drives several versions of macOS ago.
Thank you Admin for your reply, because I cannot boot directly from nvme sad, I have tried different methods, all failed. Because my motherboard does not support booting from nvme sad natively. DO you have any guide for make Opencore boot from nvme directly without using usb.
Thank you again,
Hope the problem will be solved.
 
Joined
Apr 5, 2016
Messages
858
Motherboard
GIGABYTE Z170X-Gaming 7
CPU
i7-6700K
Graphics
GTX TITAN X
Mac
iMac, MacBook, MacBook Air, MacBook Pro, Mac mini, Mac Pro
Classic Mac
Apple, LC, Power Mac
Mobile Phone
iOS
Thank you Admin for your reply, because I cannot boot directly from nvme sad, I have tried different methods, all failed. Because my motherboard does not support booting from nvme sad natively. DO you have any guide for make Opencore boot from nvme directly without using usb.
Thank you again,
Hope the problem will be solved.
Put OpenCore on SATA SSD, include an NVME efi driver, and install macOS to NVMe?
 
Top