I need to get access to raw drives under High Sierra (i.e. /dev/rdisk0)

We write diagnostic tools. We need to be able to gain access to raw drives (i.e. stuff like /dev/rdisk0, /dev/rdisk0s1....etc) under High Sierra. Historically we've been able to do this under all previous OS releases either by using priviledge elevation or XPC. With High Sierra, this is no longer allowed...not even when done using XPC. The products are signed using our developer ID's so that's not the problem. The problems exist only when the targeted raw drive is the boot drive. Secondary drives have no problem. The problems only currently exist with SIP enabled under High Sierra. If SIP is disabled, everything works fine. We would prefer to not force someone to change SIP settings via csrutil (which would fix the problem) because they may very well forget to re-enable them.


Is there a way to work around this? Our products are designed to scan a drive or SSD for bad blocks, performance deviations, possible cable/connection problems between the media (i.e. rdisk0 etc) and the system, etc. etc.


Is there a way to do this? I assume there must be because otherwise drivers couldn't install without SIP being disabled.


Thanks in advance for any insight,


D.R.Turbo

Is there a way to do this?

Not that I’m aware of.

I assume there must be because otherwise drivers couldn't install without SIP being disabled.

I’m not sure what sort of “drivers” you’re referring to here but a general thing to keep mind here is that, in the SIP world, there are numerous situations where Apple tools can do things that third-party tools can’t.

We would prefer to not force someone to change SIP settings via csrutil (which would fix the problem) because they may very well forget to re-enable them.

Agreed.

One option here is to guide the user towards doing this sort of thing while booted from a completely different device. For example, if you install a copy of the OS on a USB stick, the internal drive is no longer special from a SIP perspective and your app will be able to run its tests just fine.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
I need to get access to raw drives under High Sierra (i.e. /dev/rdisk0)
 
 
Q