How to prevent the popup "The disk you attached was not readable by the computer" from appearing?

Hello! We develop a SAS driver and a service application for DAS devices.

When users in our application create a RAID array on the device:

  1. On the 1st step, our dext driver mounts a new volume. At this step DiskUtil automatically tries to mount it. As there is no file system on the new volume - the MacOS system popup appears "The disk you attached was not readable by the computer"

  1. On the 2nd step our application creates the file system on this new volume.

So we do not need this MacOS system popup to appear (as it may frustrate our users).

We found a way to disable the global auto mount but this solution also impacts on other devices (which is not good).

Are there any other possibilities to prevent the popup "The disk you attached was not readable by the computer" from appearing?

We found a way to disable the global auto mount, but this solution also impacts other devices (which is not good).

How were you doing this? Disabling disk arbitration or something else?

Are there any other possibilities to prevent the popup "The disk you attached was not readable by the computer" from appearing?

This is all handled by the DiskArbitration framework ("DiskArb"). Two different options here:

  1. I believe blocking the mount attempt through the mount approval callback will prevent the dialog you're seeing from showing.

  2. It's not covered in the programming guide, but I believe DADiskClaim will let you acquire control exclusive "control" of the disk more directly.

I believe both of those would actually work fine; however, I think DADiskClaim allows you to claim control of whole device objects, preventing the mounting of child devices. This is primarily useful for doing things like volume partitioning where you want IOKit to parse your new partition map and create new dev nodes, but you don't want other components interacting with those new dev nodes (like the unformatted disk warning) until you've finished writing out the new volumes.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Thanks for the hint with DADiskClaim! We will try it.

Regards, Mikhail Kolesov

Thanks for the hint with DADiskClaim! We will try it.

Great! Good luck and let me know if you run into any issues.

At a purely personal level I have a soft spot for DiskArb so I'm always excited when I get to help people with it.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

How to prevent the popup "The disk you attached was not readable by the computer" from appearing?
 
 
Q