TITLE
    Mac OS X Server: MacOS.app Disk Access Modes
Article ID:
Created:
Modified:
60057
3/2/99
11/10/00

TOPIC

    This article discusses the tradeoffs among the three access modes available to MacOS.app: Shared, Exclusive, and SCSI.


DISCUSSION

    If you are just running Mac OS productivity applications, you should not need to switch the access mode for any of your disks or partitions. However, in case you need to run disk utilities such as Disk First Aid, Disk Copy, or Drive Setup, you may need to (temporarily) switch the access mode of one or more of your disks or partitions. The "Blue Volume Mount Options" control panel is provided to allow you to set these access modes for individual disks and disk partitions. It is described below, after the explanations of the three access modes.

    You can determine in which mode a volume is being accessed by selecting it in the Finder and choosing Get Info from the File menu. The dialog that appears includes a "Where" string that describes the mode in which the underlying disk is currently being accessed, along with an indication of the physical disk to which it corresponds. Disks accessed in Shared mode have "Shared" in this string. Similarly, disks accessed in Exclusive mode have "Exclusive" in this string. Disk image files (which are always accessed in Exclusive mode) list the pathname of the disk image file. Disks accessed in SCSI mode have a string identical to the one they would display if running native Mac OS; typically this string gives the SCSI Bus number and SCSI device ID of the disk.

    For disks accessed in Shared or Exclusive mode, the SCSI bus and ID (or ATA/IDE ID) are not given; instead, they are identified in the "Where" string by their Mac OS X Server device name. In order to understand how Mac OS X Server names disk devices, you must consult the documentation for Mac OS X Server. Briefly, SCSI (and ATAPI) disks have names like "sd0", "sd1", etc. ATA/IDE drives have names like "hd0"; and floppy disks have names like "fd0". Disk devices may also have more than one HFS(+) partition; the first HFS(+) partition of "sd0" is "sd0_hfs_a", the second is "sd0_hfs_b", etc. Disks without partition maps (such as floppies and ISO9660 CD-ROMs) are treated as though they consisted of a single HFS(+) partition, comprising the whole disk (e.g., "sd0_hfs_a").

    Shared Mode

    MacOS.app supports mounting HFS(+) volume(s) which are already mounted by Mac OS X Server. This mode of access is called Shared mode because all the files and folders on Shared volumes are simultaneously accessible from Mac OS applications running inside MacOS.app and Mac OS X Server applications running outside of it. Shared mode was chosen as the default file system access mode because it does not require the user to unmount a volume from one environment before mounting it in the other.

    Although Shared mode access provides the highest level of interoperability between Mac OS and Mac OS X Server applications, it is not compatible with Mac OS applications that require low-level disk access. Mac OS productivity applications are not affected by this incompatibility since they access files and folders through the high-level interface provided by the File Manager. On the other hand, disk utility programs typically require low-level disk access. Examples of disk utilities that require Exclusive mode access are Disk First Aid, and Norton Disk Doctor. Examples of disk utilities that require SCSI mode access include Drive Setup, and FWB's Hard Disk Toolkit. None of these utilities function correctly on a volume accessed in Shared mode.

    Exclusive Mode

    MacOS.app supports mounting HFS(+) disk volumes in a mode that permits block-level access. This mode permits certain disk utilities (such as Disk First Aid and some operations in Disk Copy) to run that would not work with a disk accessed through Shared mode. This is called Exclusive mode because disks accessed by MacOS.app in this mode appear exclusively in MacOS.app and cannot be accessed by Mac OS X Server applications. You can request that a disk or partition be accessed through Exclusive mode by using the "Blue Volume Mount Options" control panel.

    When Mac OS X Server first detects an HFS(+) disk partition (either when starting up or when a removable disk is inserted into a drive) it mounts it and notifies MacOS.app. MacOS.app is also notified about disks that are not recognized or mounted by Mac OS X Server. When MacOS.app notices a disk that has been mounted in Mac OS X Server for which the user has selected Exclusive mode, it asks Mac OS X Server to unmount the disk and then mounts it exclusively.

    Because it remains under the control of the Mac OS X Server SCSI drivers, a disk accessed through Exclusive mode cannot be accessed through the Mac OS SCSI Manager, even if the underlying disk is a SCSI disk.

    Volumes accessed in Exclusive mode can be read from and written to, regardless of the access rights of the user.

    Disk image files like the supplied StartupDisk.img are always accessed through Exclusive mode.

    The choice between Exclusive and Shared mode access can be made on a per-partition basis for disks with multiple HFS(+) partitions.

    Removable disks accessed througgh Exclusive mode are usually ejected upon Shutdown or Restart of MacOS.app. CD-ROMs are an exception and are not ejected upon shutdown, in order to more closely mimic the behavior of Mac OS.

    SCSI Mode

    MacOS.app supports SCSI disk devices that are recognized by Mac OS X Server. MacOS.app provides a special compatibility mode for accessing these devices through the SCSI Manager, just as they would be accessed under the native Mac OS. This mode provides the highest level of compatibility with Mac OS disk utilities, especially with those that require SCSI access, like Drive Setup.

    Like Exclusive mode, SCSI mode must be selected by using the "Blue Volume Mount Options" control panel. When MacOS.app first detects a disk for which SCSI mode has been selected, it attempts to unmount it from Mac OS X Server. If this succeeds, MacOS.app can access it in SCSI mode without fear of interference from Mac OS X Server applications.

    Volumes accessed in SCSI mode can be read from and written to, regardless of the access rights of the user.

    Unlike the choice between Shared and Exclusive mode access - which can be made on a per-partition basis for disks with multiple HFS(+) partitions - accessing a disk through SCSI mode precludes any other sort of access, either by Mac OS X Server or through Shared or Exclusive mode in MacOS.app. One consequence of this is that a disk containing a UFS file system partition that is mounted by Mac OS X Server cannot be accessed through SCSI mode in MacOS.app. For example, if your system has only one hard disk and has separate partitions for UFS and HFS(+) file systems, you cannot access the disk in SCSI mode.

    Removable SCSI drives without media present become reserved for SCSI mode access if probed with a SCSI disk utility like Drive Setup.

    SCSI mode access is not available for ATAPI devices (which includes the internal CD-ROM and optional Zip drive on some Power Macintosh G3 models) or IDE/ATA devices (which include the internal disks on most non-Server Power Macintosh G3 models).

    Switching Modes: The "Blue Volume Mount Options" Control Panel

    In the "Apple Extras" folder of the supplied StartupDisk.img is the control panel to set the desired access mode for disks and disk partitions. Disks can be accessed in one of three modes (Shared, Exclusive, or SCSI), although not all disks permit access in SCSI mode. A disk cannot be accessed in SCSI mode if it is not a SCSI disk (e.g., floppies, ATA/IDE/ATAPI disks). Nor can it be accessed in SCSI mode if there is a UFS file system mount point active on the disk at the time the mode switch is attempted (either when the control panel is launched or when MacOS.app is starting up).

    Launching the "Blue Volume Mount Options" control panel displays a single dialog which can be dismissed by quitting the control panel or closing the window. Any changes that are made are stored immediately upon quitting the control panel, although most changes do not take effect until MacOS.app is restarted.


    Figure 1 , Volume Mount Options control panel



    The control panel lists all the disk drives and disk partitions that it finds on the system, together with three columns of radio buttons, named after the three possible modes of operation: SCSI, Exclusive, and Shared. If a radio button does not appear in one of the columns, it means that the corresponding mode is not available for that drive (for example, SCSI mode for an ATAPI CD-ROM drive). If a disk partition is already mounted in Shared or Exclusive mode, it appears in the control panel under that name (for example, "sd0_hfs_a"). If it is a removable drive with no disk present, it appears under the name of the drive (for example, "sd0"). Finally, if it is being accessed through SCSI mode, it appears labeled with its SCSI Bus and device ID (for example, "Bus 0, ID 0"). In each case, these labels should correspond closely to what you find in the "Where" string displayed in the Finder's "Get Info" dialog for that volume.

    The same disk may appear under different names at different times in the "Blue Volume Mount Options" control panel depending on whether there is a disk in the drive. For example, the internal ATAPI CD-ROM drive on a Power Macintosh G3 appears as "ATA drive sd0" when there is no CD-ROM in the drive, but as "HFS partition sd0_hfs_a" when a CD-ROM is in the drive.

    If a disk has multiple HFS(+) partitions, they can be accessed in Shared or Exclusive mode independently from one another. In other words, the choice between Shared and Exclusive mode can be made on a per-partition basis. Similarly, Mac OS X Server can mount a UFS partition from a disk containing one or more HFS(+) partitions, each of which may be accessed in Shared or Exclusive mode. SCSI mode is different, though, because it requires complete control of all requests going to the disk. Therefore, selecting SCSI mode for one partition on a disk causes all the partitions on the disk to be accessed through SCSI mode. If you try this, the settings of the radio buttons automatically reflect this constraint. Similarly, you cannot select SCSI mode for a disk containing a mounted UFS file system. If you do select SCSI disk mode for a disk that contains an unmounted UFS file system, your selection is honored. You cannot mount that UFS file system in Mac OS X Server while MacOS.app is accessing the disk in SCSI mode.

    For fixed, non-removable disks, changes made through the "Blue Volume Mount Options" control panel do not take effect until MacOS.app is restarted. Removable disks can be ejected and reinserted without restarting MacOS.app.

    The disk mode selections made through the "Blue Volume Mount Options" control panel are only requests. In some cases, it might not be possible to honor them and MacOS.app may mount a disk in a mode other than the one selected in the control panel. To find out what mode a volume is being accessed in, consult the "Where" line in the "Get Info" window of that drive.


Document Information
Product Area: Mac OS System Software
Category: Mac OS X Server
Sub Category: General Topics

Copyright © 2000 Apple Computer, Inc. All rights reserved.