• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to prevent a volume to be mounted?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to prevent a volume to be mounted?


  • Subject: Re: How to prevent a volume to be mounted?
  • From: Rob McKeever <email@hidden>
  • Date: Tue, 27 Mar 2007 16:02:09 -0700

My apologies. I must've answered before I finished my morning coffee. You are correct in that this solution won't help if you haven't installed data on that machine previously. The short answer is that I don't think you'll be able to reliably do this without having some software installed on the target machine. I ran into this while working with FibreChannel SANs in a previous job.

Devices that are not mass storage don't get affected by this. The check for whether something is doing something useful or not is limited to storage devices. DiskArbitration watches for any new media, call any relevant callbacks registered to it by running applications, then will pop up a dialog alerting the user that nothing was mountable if nothing was mounted from it and nobody tried to claim the disk from inside one of the callbacks.

You might be able to find an edge case in DiskArb that allows you to do this currently, but if you want a good solution that will work going into the future, format your disk with the partitioning scheme of your choice, but with a small mountable partition on it containing a ReadMe or such alerting the user that this probably isn't the disk they want mounted. This partition is something you could filter out on machines that do have your software loaded. I seem to recall that, at one point, there was a flag you could set to tell whether a partition should be mounted automatically or not, but that no longer gets used, even if it exists. There is a flag within the Apple partition scheme to tell if a partition should be writable or not that may be useful for you.

-Rob

--
Rob McKeever, email@hidden
Developer Technical Support, CoreOS/Hardware
Apple Computer

--------------------------------
WWDC 2007 • June 11-15 • Moscone West • San Francisco, CA
http://developer.apple.com/wwdc/




On Mar 27, 2007, at 3:29 PM, MacXperte wrote:

Thanks Rob

Am I missing something?
How can any code that I write help me to control the behaviour on a machine I have never been at before?
I am looking for a portable solution, one that solely depends on the content of the disk itself.
Since there is no autostart in Mac OS X, executable code won't help me there, will it?


There must be some way to format a disk so it neither mounts nor produces an error on plugging or unplugging.
(Digital cameras in PTP-mode are treated that way, though technically they aren't disks.)


Some people even have the problem that a disk they want to be mounted automatically on plugging just won't.
I'd be happy to reproduce this kind of failure, because this is exactly what I want to happen.


I know this is not strictly a developer issue, but I figured that File-System developers might have some idea on the topic.

Florian

Am 27.03.2007 um 19:32 schrieb Rob McKeever:

Hi Florian,

You can use DiskArbitration to do this via disk approval callbacks. I'd grab a copy of the source from <http:// www.opensource.apple.com/darwinsource/> as well if you haven't already. It comes in very handy when trying to figure out how to do stuff like this.

-Rob

--
Rob McKeever, email@hidden
Developer Technical Support, CoreOS/Hardware
Apple Computer

--------------------------------
WWDC 2007 • June 11-15 • Moscone West • San Francisco, CA
http://developer.apple.com/wwdc/




On Mar 27, 2007, at 9:47 AM, MacXperte wrote:

This question has been asked in 2005 on the carbon-dev list:
http://lists.apple.com/archives/carbon-dev/2005/Jun/msg00480.html
I found a partial solution, that doesn't help in my case.

The problem is simply to have a drive, that when plugged in will neither mount as a Volume nor produce an error-message. Adding an entry to fstab with the mount-option noauto will perfectly do the trick (at least as long as fstab is still respected), but only on machines that were patched that way.

In my case it is a USB-MassStorageDevice with two separate drives (not partitions), where one of those should be silently ignored. So I am looking for a solution that will work on any unaltered Mac OS System. It must be done on the disk itself. (And no, hiding the mount-point is not enough.)

So far I've tried every partitioning trick I could think of: All documented APM-partition-types and several MBR partition-types including EE (EFI). I even tried setting the no-auto-mount bit in the APM-record. Always the same result: if there is anything mountable, it will be mounted; if not, there is an error-message.

What I did'nt try so far is playing with Software-RAID like partitions, GUID partitioning and UFS special-partitions. Any idea in those fields?

In a more global aproach: Please somebody with insight in the diskarbitration framework tell me if there is any chance of crafting a disk that will be ignored, or if there simply is no third branch in the code besides mount or error. If so, maybe there should be an exception inserted, something like: volumes named ".NoAutoMount" won't be mounted.

Thanks in advance, any idea welcome
Florian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Filesystem-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How to prevent a volume to be mounted? (From: MacXperte <email@hidden>)
 >Re: How to prevent a volume to be mounted? (From: Rob McKeever <email@hidden>)
 >Re: How to prevent a volume to be mounted? (From: MacXperte <email@hidden>)

  • Prev by Date: Re: How to prevent a volume to be mounted?
  • Previous by thread: Re: How to prevent a volume to be mounted?
  • Index(es):
    • Date
    • Thread